Version Description
January 21, 2021 = * fixed : [menu module] clicking on a sub menu item doesn't open the link * added : [user sections] edit icon to modify the title and description of the section
Download this release
Release Info
Developer | nikeo |
Plugin | Nimble Page Builder |
Version | 2.1.33 |
Comparing to | |
See all releases |
Code changes from version 2.1.32 to 2.1.33
- assets/admin/img/empty_tmpl_collection_notice.jpg +0 -0
- assets/czr/sek/css/sek-control.css +85 -13
- assets/czr/sek/css/sek-control.min.css +1 -1
- assets/czr/sek/js/ccat-sek-control.js +582 -513
- assets/czr/sek/js/ccat-sek-control.min.js +1 -1
- assets/front/js/partials/menu-module.js +13 -2
- assets/front/js/partials/menu-module.min.js +1 -1
- inc/admin/nimble-admin.php +2 -2
- inc/sektions/ccat-constants-and-helper-functions.php +150 -60
- inc/sektions/ccat-czr-sektions.php +112 -109
- nimble-builder.php +2 -2
- readme.txt +6 -2
assets/admin/img/empty_tmpl_collection_notice.jpg
ADDED
Binary file
|
assets/czr/sek/css/sek-control.css
CHANGED
@@ -130,13 +130,15 @@ li[id^="accordion-section-__nimble__"] > h3 {
|
|
130 |
}
|
131 |
.sek-is-pro {
|
132 |
position: absolute;
|
133 |
-
top:
|
134 |
z-index: 10;
|
135 |
-
right:
|
136 |
height: 20px;
|
137 |
width: 28px;
|
138 |
}
|
139 |
-
|
|
|
|
|
140 |
|
141 |
|
142 |
/* When sections are displayed in the module picker. Typically the columns sections */
|
@@ -262,7 +264,7 @@ li[id*="sek_draggable_modules"] [data-sek-content-type="preset_section"] {
|
|
262 |
font-size: italic;
|
263 |
}
|
264 |
|
265 |
-
.sek-sec-info > .remove-user-sec {
|
266 |
cursor: pointer;
|
267 |
font-size: 16px;
|
268 |
width: 30px;
|
@@ -270,7 +272,7 @@ li[id*="sek_draggable_modules"] [data-sek-content-type="preset_section"] {
|
|
270 |
color: #535353;
|
271 |
background: rgba(255, 255, 255, 0.7);
|
272 |
border-radius: 30px;
|
273 |
-
opacity: 0;
|
274 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
275 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
276 |
-webkit-transition: all .20s ease;
|
@@ -286,17 +288,29 @@ li[id*="sek_draggable_modules"] [data-sek-content-type="preset_section"] {
|
|
286 |
-ms-flex-pack: center;
|
287 |
justify-content: center;
|
288 |
position: absolute;
|
|
|
|
|
289 |
bottom: 0px;
|
290 |
right: 5px;
|
291 |
}
|
|
|
|
|
|
|
|
|
292 |
.sek-sec-info:hover > .remove-user-sec {
|
293 |
opacity: 0.7;
|
294 |
}
|
|
|
|
|
|
|
295 |
.sek-sec-info > .remove-user-sec:hover {
|
296 |
opacity: 0.95;
|
297 |
color: red;
|
298 |
}
|
299 |
-
|
|
|
|
|
|
|
300 |
/* DRAGGING STUFFS */
|
301 |
.sek-dragging [data-sek-content-type] {
|
302 |
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,.25)!important;
|
@@ -1659,29 +1673,55 @@ select.sek-saved-section-picker {
|
|
1659 |
}
|
1660 |
|
1661 |
/* TMPL UI VISIBILITY = f(mode) */
|
|
|
1662 |
[data-sek-tmpl-dialog-mode="save"] .sek-saved-tmpl-picker {display: none;}
|
1663 |
[data-sek-tmpl-dialog-mode="save"] .sek-tmpl-title {display: block;}
|
1664 |
[data-sek-tmpl-dialog-mode="save"] .sek-tmpl-description {display: block;}
|
1665 |
[data-sek-tmpl-dialog-mode="save"] .sek-do-save-tmpl {display: block;border-color: #ffff00;background: #f9f9b6f7;border-radius: 3px!important;}
|
1666 |
|
|
|
1667 |
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-tmpl-title {display: block;}
|
1668 |
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-tmpl-description {display: block;}
|
1669 |
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-do-update-tmpl {display: block;}
|
1670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1671 |
[data-sek-tmpl-dialog-mode="remove"].sek-tmpl-remove-selected .sek-open-remove-confirmation {display: block;}
|
1672 |
[data-sek-tmpl-dialog-mode="remove"].sek-removal-confirmation-opened .sek-open-remove-confirmation {display: none!important;}
|
1673 |
[data-sek-tmpl-dialog-mode="remove"].sek-removal-confirmation-opened .sek-tmpl-remove-dialog { display: block;}
|
1674 |
|
1675 |
/* SECTION UI VISIBILITY = f(mode) */
|
|
|
1676 |
[data-sek-section-dialog-mode="save"] .sek-saved-section-picker {display: none;}
|
1677 |
[data-sek-section-dialog-mode="save"] .sek-section-title {display: block;}
|
1678 |
[data-sek-section-dialog-mode="save"] .sek-section-description {display: block;}
|
1679 |
[data-sek-section-dialog-mode="save"] .sek-do-save-section {display: block;border-color: #ffff00;background: #f9f9b6f7;border-radius: 3px!important;}
|
1680 |
|
|
|
1681 |
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-section-title {display: block;}
|
1682 |
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-section-description {display: block;}
|
1683 |
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-do-update-section {display: block;}
|
1684 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1685 |
[data-sek-section-dialog-mode="remove"].sek-section-remove-selected .sek-open-remove-confirmation {display: block;}
|
1686 |
[data-sek-section-dialog-mode="remove"].sek-removal-confirmation-opened .sek-open-remove-confirmation {display: none!important;}
|
1687 |
[data-sek-section-dialog-mode="remove"].sek-removal-confirmation-opened .sek-section-remove-dialog { display: block;}
|
@@ -1908,7 +1948,7 @@ body.sek-save-section-ui-visible #nimble-top-section-save-ui {
|
|
1908 |
}
|
1909 |
|
1910 |
/* REMOVE TMPL BUTTON */
|
1911 |
-
.sek-tmpl-info > .remove-tmpl {
|
1912 |
cursor: pointer;
|
1913 |
font-size: 16px;
|
1914 |
width: 30px;
|
@@ -1916,7 +1956,7 @@ body.sek-save-section-ui-visible #nimble-top-section-save-ui {
|
|
1916 |
color: #535353;
|
1917 |
background: rgba(255, 255, 255, 0.7);
|
1918 |
border-radius: 30px;
|
1919 |
-
opacity: 0;
|
1920 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
1921 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
1922 |
-webkit-transition: all .20s ease;
|
@@ -1932,16 +1972,26 @@ body.sek-save-section-ui-visible #nimble-top-section-save-ui {
|
|
1932 |
-ms-flex-pack: center;
|
1933 |
justify-content: center;
|
1934 |
position: absolute;
|
1935 |
-
bottom: 10px;
|
1936 |
-
right: 10px;
|
1937 |
}
|
1938 |
-
.sek-tmpl-info
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1939 |
opacity: 0.7;
|
1940 |
}
|
1941 |
-
.sek-tmpl-info > .remove-tmpl:hover
|
1942 |
opacity: 0.95;
|
1943 |
color: red;
|
1944 |
}
|
|
|
|
|
|
|
|
|
1945 |
|
1946 |
/*.sek-tmpl-gallery-inner .sek-tmpl-item:after, .sek-tmpl-gallery-inner .sek-tmpl-item:before {
|
1947 |
box-sizing: inherit;
|
@@ -1949,6 +1999,11 @@ body.sek-save-section-ui-visible #nimble-top-section-save-ui {
|
|
1949 |
.sek-tmpl-gallery-inner .sek-tmpl-thumb {
|
1950 |
cursor: pointer;
|
1951 |
position: relative;
|
|
|
|
|
|
|
|
|
|
|
1952 |
}
|
1953 |
.sek-tmpl-thumb img { max-width: 100%; }
|
1954 |
.sek-tmpl-gallery-inner .sek-tmpl-thumb::after {
|
@@ -1994,7 +2049,24 @@ input.sek-filter-tmpl {
|
|
1994 |
display: -ms-flexbox;
|
1995 |
display: flex;
|
1996 |
}
|
1997 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1998 |
#nimble-level-tree {
|
1999 |
-webkit-transition: top 0.3s ease-in-out;
|
2000 |
-moz-transition: top, 0.3s ease-in-out;
|
130 |
}
|
131 |
.sek-is-pro {
|
132 |
position: absolute;
|
133 |
+
top: 5px;
|
134 |
z-index: 10;
|
135 |
+
right: 5px;
|
136 |
height: 20px;
|
137 |
width: 28px;
|
138 |
}
|
139 |
+
[data-sek-content-type="preset_section"]:hover .sek-is-pro img, [data-sek-tmpl-item-id]:hover .sek-is-pro img {
|
140 |
+
opacity: 0.5;
|
141 |
+
}
|
142 |
|
143 |
|
144 |
/* When sections are displayed in the module picker. Typically the columns sections */
|
264 |
font-size: italic;
|
265 |
}
|
266 |
|
267 |
+
.sek-sec-info > .remove-user-sec, .sek-sec-info > .edit-user-sec {
|
268 |
cursor: pointer;
|
269 |
font-size: 16px;
|
270 |
width: 30px;
|
272 |
color: #535353;
|
273 |
background: rgba(255, 255, 255, 0.7);
|
274 |
border-radius: 30px;
|
275 |
+
opacity: 0.3;
|
276 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
277 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
278 |
-webkit-transition: all .20s ease;
|
288 |
-ms-flex-pack: center;
|
289 |
justify-content: center;
|
290 |
position: absolute;
|
291 |
+
}
|
292 |
+
.sek-sec-info > .remove-user-sec {
|
293 |
bottom: 0px;
|
294 |
right: 5px;
|
295 |
}
|
296 |
+
.sek-sec-info > .edit-user-sec {
|
297 |
+
bottom: 0px;
|
298 |
+
left: 5px;
|
299 |
+
}
|
300 |
.sek-sec-info:hover > .remove-user-sec {
|
301 |
opacity: 0.7;
|
302 |
}
|
303 |
+
.sek-sec-info:hover > .edit-user-sec {
|
304 |
+
opacity: 0.7;
|
305 |
+
}
|
306 |
.sek-sec-info > .remove-user-sec:hover {
|
307 |
opacity: 0.95;
|
308 |
color: red;
|
309 |
}
|
310 |
+
.sek-sec-info > .edit-user-sec:hover {
|
311 |
+
opacity: 0.95;
|
312 |
+
color: #000000;
|
313 |
+
}
|
314 |
/* DRAGGING STUFFS */
|
315 |
.sek-dragging [data-sek-content-type] {
|
316 |
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,.25)!important;
|
1673 |
}
|
1674 |
|
1675 |
/* TMPL UI VISIBILITY = f(mode) */
|
1676 |
+
[data-sek-tmpl-dialog-mode="save"] [data-tmpl-mode-switcher="remove"] {display: none;}
|
1677 |
[data-sek-tmpl-dialog-mode="save"] .sek-saved-tmpl-picker {display: none;}
|
1678 |
[data-sek-tmpl-dialog-mode="save"] .sek-tmpl-title {display: block;}
|
1679 |
[data-sek-tmpl-dialog-mode="save"] .sek-tmpl-description {display: block;}
|
1680 |
[data-sek-tmpl-dialog-mode="save"] .sek-do-save-tmpl {display: block;border-color: #ffff00;background: #f9f9b6f7;border-radius: 3px!important;}
|
1681 |
|
1682 |
+
[data-sek-tmpl-dialog-mode="update"] [data-tmpl-mode-switcher="remove"] {display: none;}
|
1683 |
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-tmpl-title {display: block;}
|
1684 |
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-tmpl-description {display: block;}
|
1685 |
[data-sek-tmpl-dialog-mode="update"].sek-tmpl-update-selected .sek-do-update-tmpl {display: block;}
|
1686 |
|
1687 |
+
.sek-save-tmpl-mode-switcher .sek-ui-button[data-tmpl-mode-switcher="edit"] {display: none;}
|
1688 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="edit"] {display: inline-block!important;}
|
1689 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="update"] {display: none;}
|
1690 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="save"] {display: none;}
|
1691 |
+
[data-sek-tmpl-dialog-mode="edit"] [data-tmpl-mode-switcher="remove"] {display: none;}
|
1692 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-saved-tmpl-picker {display: block;}
|
1693 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-tmpl-title {display: block;}
|
1694 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-tmpl-description {display: block;}
|
1695 |
+
[data-sek-tmpl-dialog-mode="edit"] .sek-do-update-tmpl {display: block;}
|
1696 |
+
|
1697 |
+
[data-sek-tmpl-dialog-mode="remove"] [data-tmpl-mode-switcher="update"] {display: none;}
|
1698 |
+
[data-sek-tmpl-dialog-mode="remove"] [data-tmpl-mode-switcher="save"] {display: none;}
|
1699 |
[data-sek-tmpl-dialog-mode="remove"].sek-tmpl-remove-selected .sek-open-remove-confirmation {display: block;}
|
1700 |
[data-sek-tmpl-dialog-mode="remove"].sek-removal-confirmation-opened .sek-open-remove-confirmation {display: none!important;}
|
1701 |
[data-sek-tmpl-dialog-mode="remove"].sek-removal-confirmation-opened .sek-tmpl-remove-dialog { display: block;}
|
1702 |
|
1703 |
/* SECTION UI VISIBILITY = f(mode) */
|
1704 |
+
[data-sek-section-dialog-mode="save"] [data-section-mode-switcher="remove"] {display: none;}
|
1705 |
[data-sek-section-dialog-mode="save"] .sek-saved-section-picker {display: none;}
|
1706 |
[data-sek-section-dialog-mode="save"] .sek-section-title {display: block;}
|
1707 |
[data-sek-section-dialog-mode="save"] .sek-section-description {display: block;}
|
1708 |
[data-sek-section-dialog-mode="save"] .sek-do-save-section {display: block;border-color: #ffff00;background: #f9f9b6f7;border-radius: 3px!important;}
|
1709 |
|
1710 |
+
[data-sek-section-dialog-mode="update"] [data-section-mode-switcher="remove"] {display: none;}
|
1711 |
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-section-title {display: block;}
|
1712 |
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-section-description {display: block;}
|
1713 |
[data-sek-section-dialog-mode="update"].sek-section-update-selected .sek-do-update-section {display: block;}
|
1714 |
|
1715 |
+
.sek-save-section-mode-switcher .sek-ui-button[data-section-mode-switcher="edit"] {display: none;}
|
1716 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="edit"] {display: inline-block!important;}
|
1717 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="update"] {display: none;}
|
1718 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="save"] {display: none;}
|
1719 |
+
[data-sek-section-dialog-mode="edit"] [data-section-mode-switcher="remove"] {display: none;}
|
1720 |
+
[data-sek-section-dialog-mode="edit"] .sek-saved-section-picker {display: block;}
|
1721 |
+
[data-sek-section-dialog-mode="edit"] .sek-section-title {display: block;}
|
1722 |
+
[data-sek-section-dialog-mode="edit"] .sek-section-description {display: block;}
|
1723 |
+
[data-sek-section-dialog-mode="edit"] .sek-do-update-section {display: block;}
|
1724 |
+
|
1725 |
[data-sek-section-dialog-mode="remove"].sek-section-remove-selected .sek-open-remove-confirmation {display: block;}
|
1726 |
[data-sek-section-dialog-mode="remove"].sek-removal-confirmation-opened .sek-open-remove-confirmation {display: none!important;}
|
1727 |
[data-sek-section-dialog-mode="remove"].sek-removal-confirmation-opened .sek-section-remove-dialog { display: block;}
|
1948 |
}
|
1949 |
|
1950 |
/* REMOVE TMPL BUTTON */
|
1951 |
+
.sek-tmpl-info > .remove-tmpl, .sek-tmpl-info > .edit-tmpl {
|
1952 |
cursor: pointer;
|
1953 |
font-size: 16px;
|
1954 |
width: 30px;
|
1956 |
color: #535353;
|
1957 |
background: rgba(255, 255, 255, 0.7);
|
1958 |
border-radius: 30px;
|
1959 |
+
opacity: 0.4;
|
1960 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
1961 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
1962 |
-webkit-transition: all .20s ease;
|
1972 |
-ms-flex-pack: center;
|
1973 |
justify-content: center;
|
1974 |
position: absolute;
|
|
|
|
|
1975 |
}
|
1976 |
+
.sek-tmpl-info > .remove-tmpl {
|
1977 |
+
bottom: 10px;
|
1978 |
+
right: 10px;
|
1979 |
+
}
|
1980 |
+
.sek-tmpl-info > .edit-tmpl {
|
1981 |
+
bottom: 10px;
|
1982 |
+
left: 10px;
|
1983 |
+
}
|
1984 |
+
.sek-tmpl-info:hover > .remove-tmpl, .sek-tmpl-info:hover > .edit-tmpl {
|
1985 |
opacity: 0.7;
|
1986 |
}
|
1987 |
+
.sek-tmpl-info > .remove-tmpl:hover{
|
1988 |
opacity: 0.95;
|
1989 |
color: red;
|
1990 |
}
|
1991 |
+
.sek-tmpl-info > .edit-tmpl:hover {
|
1992 |
+
opacity: 0.95;
|
1993 |
+
color: #000000;
|
1994 |
+
}
|
1995 |
|
1996 |
/*.sek-tmpl-gallery-inner .sek-tmpl-item:after, .sek-tmpl-gallery-inner .sek-tmpl-item:before {
|
1997 |
box-sizing: inherit;
|
1999 |
.sek-tmpl-gallery-inner .sek-tmpl-thumb {
|
2000 |
cursor: pointer;
|
2001 |
position: relative;
|
2002 |
+
height: 380px;
|
2003 |
+
width: 100%;
|
2004 |
+
background-size: cover;
|
2005 |
+
background-repeat: no-repeat;
|
2006 |
+
background-position: center;
|
2007 |
}
|
2008 |
.sek-tmpl-thumb img { max-width: 100%; }
|
2009 |
.sek-tmpl-gallery-inner .sek-tmpl-thumb::after {
|
2049 |
display: -ms-flexbox;
|
2050 |
display: flex;
|
2051 |
}
|
2052 |
+
|
2053 |
+
/* TMPL SOURCE SWITCHER */
|
2054 |
+
#sek-tmpl-source-switcher{
|
2055 |
+
display: none;/* <= rendered only if we could access NB api */
|
2056 |
+
width:100%;
|
2057 |
+
padding: 10px 0;
|
2058 |
+
}
|
2059 |
+
#sek-tmpl-source-switcher .sek-ui-button-group {
|
2060 |
+
display: -webkit-box;
|
2061 |
+
display: -ms-flexbox;
|
2062 |
+
display: flex;
|
2063 |
+
-webkit-box-align: center;
|
2064 |
+
-ms-flex-align: center;
|
2065 |
+
align-items: center;
|
2066 |
+
/* flex-direction: column; */
|
2067 |
+
flex: 0 0 100%;
|
2068 |
+
max-width: 100%;
|
2069 |
+
}/* LEVEL TREE */
|
2070 |
#nimble-level-tree {
|
2071 |
-webkit-transition: top 0.3s ease-in-out;
|
2072 |
-moz-transition: top, 0.3s ease-in-out;
|
assets/czr/sek/css/sek-control.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@font-face{font-family:'Material Icons';font-style:normal;font-weight:400;src:url(../fonts/material-icons/MaterialIcons-Regular.eot);src:local('Material Icons'),local('MaterialIcons-Regular'),url(../fonts/material-icons/MaterialIcons-Regular.woff2) format('woff2'),url(../fonts/material-icons/MaterialIcons-Regular.woff) format('woff'),url(../fonts/material-icons/MaterialIcons-Regular.ttf) format('truetype')}.material-icons{font-family:'Material Icons';font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:'liga';font-feature-settings:'liga'}#customize-preview iframe,#nimble-level-tree{-webkit-transition:top .3s ease-in-out;-moz-transition:top,.3s ease-in-out;-ms-transition:top,.3s ease-in-out;-o-transition:top,.3s ease-in-out;transition:top .3s ease-in-out}#customize-preview iframe{z-index:1}ul[id*=sub-accordion-section-__nimble__]{background:#f2f2f2!important}#customize-theme-controls .customize-pane-child[id*="__nimble__"]{-webkit-transition:unset;-o-transition:unset;transition:unset}li[id*="__nimble__"].customize-control{margin:8px 0;padding:2px;width:calc(100% - 4px);border:1px solid rgba(221,221,221,.43);box-shadow:1px 1px 2px 0 rgba(75,75,85,.2);-webkit-box-shadow:1px 1px 2px 0 rgba(75,75,85,.2);background-color:#fff}li[id*="__nimble__"].customize-control span.customize-control-title:first-child{margin-left:21px}#customize-theme-controls ul[id*=sub-accordion-section-__nimble__].open{top:0!important}.sek-float-right{float:right}.sek-float-left{float:left}.sek-flex-vertical-center{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}li[id^=accordion-section-__nimble__]{margin-top:16px}li[id^=accordion-section-__nimble__]>h3{border-top:1px solid #ddd}[data-sek-content-type]{float:left;padding:0;margin:1.8%;text-align:center;cursor:move;-webkit-transition:-webkit-box-shadow .2s ease;transition:-webkit-box-shadow .2s ease;-o-transition:box-shadow .2s ease;transition:box-shadow .2s ease;transition:box-shadow .2s ease,-webkit-box-shadow .2s ease;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.25);box-shadow:0 2px 5px rgba(0,0,0,.25);border-radius:4px}[data-sek-content-type=module]{width:29%;height:130px;position:relative}.sek-is-pro{position:absolute;top:0;z-index:10;right:2px;height:20px;width:28px}li[id*=sek_draggable_modules] [data-sek-content-type=preset_section]{width:29%;height:130px}.sek-content-type-wrapper [data-sek-content-type=preset_section]{width:95%;height:165px;position:relative;overflow:hidden}.sek-demo-link{position:absolute;bottom:-22px;z-index:20;height:18px;width:100%;padding:2px 0;background:#000;background-color:rgba(0,0,0,.5);color:#fff;font-size:13px;cursor:pointer;-webkit-transition:bottom .2s ease-in-out;-moz-transition:bottom,.2s ease-in-out;-ms-transition:bottom,.2s ease-in-out;-o-transition:bottom,.2s ease-in-out;transition:bottom .2s ease-in-out}.sek-demo-link a,.sek-demo-link a:focus,.sek-demo-link a:visited,.sek-demo-link i{color:#fff}.sek-demo-link a{text-decoration:none;text-transform:uppercase;font-size:12px}.sek-demo-link a:hover{color:#fff;text-decoration:underline}[data-sek-content-type=preset_section]:hover .sek-demo-link{bottom:0}[data-sek-content-type=preset_section] .sek-overlay{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:0;-webkit-transition:opacity .35s ease;transition:opacity .35s ease;-o-transition:opacity .35s ease}[data-sek-content-type=preset_section]:hover .sek-overlay{opacity:.15}[data-sek-content-type][draggable=true]:hover{-webkit-box-shadow:0 12px 20px rgba(0,0,0,.2);box-shadow:0 12px 20px rgba(0,0,0,.2)}[data-sek-content-type][draggable=false]{background:#eee;opacity:.8}.sek-user-section-wrapper{margin-bottom:15px;float:left;width:100%}.sek-user-section-wrapper [data-sek-content-type=preset_section] .sek-overlay{opacity:.4}.sek-user-section-wrapper [data-sek-content-type=preset_section]:hover .sek-overlay{opacity:.5}.sek-user-section-wrapper [data-sek-is-user-section=true]{height:165px;margin:0;width:97%}.sek-user-section-wrapper .sek-sec-thumb{position:absolute;opacity:.5;z-index:0;top:0;bottom:0;height:100%;width:100%}.sek-user-section-wrapper .sek-sec-info{position:relative;color:#fff;padding:2%;overflow:hidden;height:100%;max-height:138px;padding:10px}.sek-sec-info .sec-title{color:#fff;margin:0;line-height:20px;max-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sek-sec-info .sec-date,.sek-sec-info .sec-desc{margin:0;margin-top:5px;font-size:12px}.sek-sec-info .sec-date{font-size:italic}.sek-sec-info>.remove-user-sec{cursor:pointer;font-size:16px;width:30px;height:30px;color:#535353;background:rgba(255,255,255,.7);border-radius:30px;opacity:0;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:0;right:5px}.sek-sec-info:hover>.remove-user-sec{opacity:.7}.sek-sec-info>.remove-user-sec:hover{opacity:.95;color:red}.sek-dragging [data-sek-content-type]{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.25)!important;box-shadow:0 2px 5px rgba(0,0,0,.25)!important}.sek-dragged{background:#33b3db3d;background:rgba(51,179,219,.24)}[data-sek-content-type] .sek-module-icon{display:block;padding:0}[data-sek-content-type] .sek-module-icon .nimble-module-icons{font-size:3rem;max-width:100%;color:#878787;max-height:86px}[data-sek-content-type] .sek-module-icon.is-font-icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%;min-height:70%}[data-sek-content-type] .sek-module-icon.is-font-icon i{font-size:35px}[data-sek-content-type] .sek-module-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 6px 0;font-size:.75rem;height:45px;justify-content:center;position:relative;top:-18px}.sek-centered-module-title{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.sek-new-label{background:#ff0;border:1px solid #ff0;padding:3px 4px;line-height:12px;border-radius:8px;font-size:12px}.sek-accord-title{color:#4b4a4a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:120px;height:23px;line-height:22px;font-size:13px;float:left;padding-left:10px}.sek-pad-marg-inner{font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;margin:10px auto 10px auto;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:0;background-color:#e6e6e6;border:1px solid #c5c5c5;height:192px;width:232px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-pm-top-bottom-wrap{height:46px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-center-stretch{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.sek-pm-input{width:35px;height:15px;padding:0;text-align:center;font-family:Source Sans Pro;padding:5px;border-radius:3px;text-align:left;font-size:13px;outline:0;-webkit-box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);border:1px solid #ced6d9}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131}.sek-pm-middle-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;height:100px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-margin-left,.sek-pm-margin-right{width:46px}.sek-pm-padding-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background-color:#fff;border:1px solid #ced6d9;height:100px;width:140px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:5px;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease;-webkit-box-sizing:border-box;box-sizing:border-box;margin:auto}.sek-flex-justify-center{min-height:0;min-width:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-space-between{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-input-parent{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.sek-pm-input-parent .sek-pm-input{min-height:25px;min-width:40px;background-color:#fff}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px!important;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131;width:40px!important;text-align:center}.sek-pm-padding-wrapper label{margin:0}.sek-pad-marg-inner label{-webkit-box-flex:0;-ms-flex:0;flex:0}.reset-spacing-wrap{padding:10px 0 0;font-size:.8em;text-decoration:underline;cursor:pointer;text-align:center}.reset-spacing-wrap:hover{color:#006799}.sek-bg-pos-wrapper{padding:10px;text-align:center;display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper{display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper .sek-bg-pos{cursor:pointer;width:24px;height:24px;margin:3px;float:left}.sek-bg-pos-wrapper input[type=radio]{display:none}.sek-bg-pos-wrapper .sek-bg-pos span{display:inline-block;width:100%;height:100%;border-radius:6px;background:#e6e6e6 no-repeat center;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-bg-pos-wrapper .sek-bg-pos span:hover{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos span:hover svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos span svg{visibility:hidden;shape-rendering:crispEdges}.sek-bg-pos-wrapper .sek-svg-bg-pos{fill:#fff}div[data-sek-align]{margin:0 5px;padding:4px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;position:relative;text-align:center;width:23px;height:24px;top:-4px;border-radius:4px;cursor:pointer}div[data-input-type=horizTextAlignmentWithDeviceSwitcher] .czr-input{text-align:center}div[data-input-type=horizTextAlignmentWithDeviceSwitcher] .sek-h-align-wrapper{display:inline-block}div[data-input-type=horizAlignmentWithDeviceSwitcher] .czr-input{text-align:center}div[data-input-type=horizAlignmentWithDeviceSwitcher] .sek-h-align-wrapper{display:inline-block}.sek-h-align-wrapper .sek-align-icons{float:right}div[data-sek-align]:hover{-webkit-box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff}div[data-sek-align].selected{outline:0;color:#fff;-webkit-box-shadow:none;box-shadow:none;background:#555d66}div[data-sek-grid-layout]{margin:0 5px;padding:1px 3px 1px 1px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;position:relative;text-align:center;border-radius:4px;cursor:pointer}div[data-sek-grid-layout] i{font-size:50px}div[data-input-type=grid_layout] .czr-input{text-align:center}div[data-input-type=grid_layout] .sek-grid-layout-wrapper{display:inline-block}.sek-grid-layout-wrapper .sek-grid-icons{float:right}div[data-sek-grid-layout]:hover{-webkit-box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff}div[data-sek-grid-layout].selected{outline:0;color:#fff;-webkit-box-shadow:none;box-shadow:none;background:#33b3db}.customize-control select[data-czrtype=categories]{height:28px}.sek-input-device-switcher .sek-switcher:before,.sek-mobile-device-icons .sek-switcher:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;color:#656a6f;position:relative;top:-5px}.sek-input-device-switcher .sek-switcher{cursor:pointer}.sek-input-device-switcher .sek-switcher,.sek-mobile-device-icons .sek-switcher{background:0 0;border:none;padding:0 1px;margin:0 0 0 -2px;box-shadow:none;border-top:1px solid transparent;border-bottom:4px solid transparent;-webkit-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;-o-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}.sek-input-device-switcher .sek-switcher:focus,.sek-input-device-switcher .sek-switcher:hover{background-color:#fff}.sek-input-device-switcher .sek-switcher.active:before{color:#191e23}.sek-input-device-switcher .sek-switcher:focus:before,.sek-input-device-switcher .sek-switcher:hover:before{color:#0073aa}.sek-input-device-switcher .preview-desktop:before,.sek-mobile-device-icons .preview-desktop:before{content:"\f472"}.sek-input-device-switcher .preview-tablet:before,.sek-mobile-device-icons .preview-tablet:before{content:"\f471"}.sek-input-device-switcher .preview-mobile:before,.sek-mobile-device-icons .preview-mobile:before{content:"\f470"}.sek-borders{width:100%;float:left;margin-bottom:8px}.sek-borders>div{float:left;width:100%}.sek-borders .sek-range-unit-wrapper>div{float:left}.sek-borders .sek-border-type-wrapper{margin-bottom:5px}.sek-borders .sek-range-unit-wrapper{margin-bottom:5px}.sek-borders .sek-range-unit-wrapper .sek-unit-wrapper{float:right}.sek-borders .sek-color-wrapper{width:100%}.sek-borders .sek-color-wrapper .sek-color-picker{width:50%;float:left}.sek-borders .sek-color-wrapper .sek-reset-button{width:50%;float:right}[data-sek-radius-type=top_right]>i.material-icons{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}[data-sek-radius-type=bottom_right]>i.material-icons{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}[data-sek-radius-type=bottom_left]>i.material-icons{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sek-range-with-unit-picker-wrapper{width:100%;float:left;margin-bottom:8px}.sek-range-with-unit-picker-wrapper .sek-unit-wrapper{float:right}.sek-range-with-unit-picker-wrapper>div{float:left}.sek-range-wrapper{width:44%;margin-right:4px}.sek-no-unit-picker .sek-range-wrapper{width:70%}.sek-number-wrapper,.sek-simple-number-wrapper{width:60px;margin-right:5px}.sek-simple-number-wrapper{text-align:right}.sek-range-input{flex:1;width:100%;padding:0;-webkit-appearance:none;background:0 0;height:26px}.sek-range-input::-webkit-slider-thumb{-webkit-appearance:none;height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-8px}.sek-range-input::-moz-range-thumb{height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-7px}.sek-range-input::-ms-thumb{height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-8px}.sek-range-input:focus{outline:0}.sek-range-input::-webkit-slider-runnable-track{height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px;margin-top:-4px}.sek-range-input::-moz-range-track{height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px}.sek-range-input::-ms-track{margin-top:-4px;background:0 0;border-color:transparent;color:transparent;height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px}.sek-import-btn-wrap{padding:20px 0}.sek-import-btn-wrap input.sek-import-file{margin-bottom:10px}.sek-export-btn-wrap{padding-bottom:20px;border-bottom:1px solid #ddd}.sek-import-file{background:#eee;width:100%;margin:10px 0;padding:10px;font-size:12px}.sek-uploading{background:#eee;display:none;margin:10px 0;padding:10px;font-size:12px}.czr-import-dialog{display:none;padding:11px}.czr-import-message{padding-bottom:10px}.sek-import-btn-wrap .czr-import-dialog .czr-import-message{font-size:12px!important}.sek-import-btn-wrap .czr-import-dialog .button{margin:4px 0;font-size:12px!important}.sek-slide-thumb{width:32px;height:32px;overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;float:left}.sek-slide-title{color:#4b4a4a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:120px;height:32px;line-height:32px;font-size:13px;float:left;padding-left:10px}.sek-pro-notice{position:relative;padding-left:36px;font-size:13px}.sek-pro-notice a,.sek-pro-notice a:focus,.sek-pro-notice a:hover{color:#f07829;font-weight:700;text-decoration:none}.sek-pro-notice a:hover{text-decoration:underline}.sek-pro-icon{position:absolute;width:32px;left:0;top:-2px}.sek-pro-notice .sek-pro-notice-icon-bef-text{display:inline-block;width:23px;height:15px;position:relative}.sek-pro-notice .sek-pro-notice-icon-bef-text img{position:absolute;top:0}.sek-unit-wrapper{text-align:center}.sek-ui-button-group{display:inline-block}.sek-ui-button-group .sek-ui-button:first-child{border-radius:3px 0 0 3px}.sek-ui-button-group .sek-ui-button+.sek-ui-button{margin-left:-1px}.sek-ui-button-group .sek-ui-button:last-child{border-radius:0 3px 3px 0}.sek-ui-button{height:28px;padding:0 10px 2px;border-radius:3px;white-space:nowrap;border-width:1px;border-style:solid;display:inline-flex;text-decoration:none;font-size:12px;line-height:25px;font-weight:400;margin:0;cursor:pointer;-webkit-appearance:none;background:0 0;color:#555;border-color:#ccc;background:#f7f7f7;box-shadow:inset 0 -1px 0 #ccc;vertical-align:top;-webkit-transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-ms-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out}.sek-ui-button:hover{background:#fafafa;border-color:#999;box-shadow:inset 0 -1px 0 #999;color:#23282d;opacity:1!important}.sek-ui-button:active:not(:disabled){background:#eee;border-color:#999;box-shadow:inset 0 1px 0 #999}.sek-ui-button:focus:not(:disabled){background:#fafafa;color:#23282d;border-color:#999;box-shadow:inset 0 -1px 0 #999,0 0 0 2px #fbfbfb;outline:0}.sek-ui-button[aria-pressed=true]{background:#555d66;border-color:#555d66;box-shadow:inset 0 -1px 0 #555d66;color:#fff;text-decoration:none}.sek-ui-button[aria-pressed=true]:focus:not(:disabled),.sek-ui-button[aria-pressed=true]:hover{background:#555d66;border-color:#4f4f4f;color:#fff}.sek-ui-button[aria-pressed=true]:focus:not(:disabled){box-shadow:inset 0 -1px 0 #4f4f4f}.sek-ui-button[aria-pressed=true]:focus:not(:disabled){outline:0}.sek-content-type-wrapper,.sek-save-section-action,.sek-save-section-mode-switcher,.sek-save-tmpl-action,.sek-save-tmpl-mode-switcher{margin-bottom:8px;width:100%;float:left}#nimble-tmpl-gallery .sek-ui-button-group,.sek-content-type-wrapper .sek-ui-button-group,.sek-save-section-action .sek-ui-button-group,.sek-save-section-mode-switcher .sek-ui-button-group,.sek-save-tmpl-action .sek-ui-button-group,.sek-save-tmpl-mode-switcher .sek-ui-button-group{display:block}#nimble-tmpl-gallery .sek-ui-button,.sek-content-type-wrapper .sek-ui-button,.sek-save-section-action .sek-ui-button,.sek-save-section-mode-switcher .sek-ui-button,.sek-save-tmpl-action .sek-ui-button,.sek-save-tmpl-mode-switcher .sek-ui-button{text-align:center;display:inline-block;padding:3px 10px;height:auto;text-transform:uppercase}.sek-content-type-wrapper .sek-ui-button{width:49%}.sek-save-section-mode-switcher .sek-ui-button,.sek-save-tmpl-mode-switcher .sek-ui-button{width:32%}.sek-content-type-wrapper [data-sek-content-type=template]{width:98%;margin-top:5px}[data-input-type=module_option_switcher] .sek-content-type-wrapper{margin-bottom:0}[data-input-type=module_option_switcher] [aria-pressed=false]{opacity:.7}[data-input-type=module_option_switcher] [data-sek-option-type]{position:relative}.sek-wrap-opt-switch-btn{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}[data-input-type=module_option_switcher] [data-sek-option-type] .sek-wrap-opt-switch-btn>i{font-size:21px;line-height:24px}[data-input-type=module_option_switcher] [data-sek-option-type] .sek-wrap-opt-switch-btn>span{position:relative;padding-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.wp-core-ui .button.sek-reset-button{font-size:11px;padding:0 5px 1px;line-height:18px;height:25px;min-height:25px;color:#555;border-color:#ccc}.sek-animated-arrow{position:absolute;left:-20px;margin-left:6px;top:3px;font-size:10px;color:#617379;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;-o-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center}[data-sek-expanded=true] label>.customize-control-title .sek-animated-arrow{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}[data-sek-expanded=true] label>.customize-control-title .sek-ctrl-accordion-title,[data-sek-expanded] label>.customize-control-title .sek-ctrl-accordion-title:hover{text-decoration:underline;text-underline-position:under}.customize-control-title .sek-ctrl-accordion-title>i{font-size:1.2em;position:relative;top:4px;padding-right:4px}.sek-level-option-icon{padding-right:5px;min-width:22px;text-align:center}.sek-input-title-icon{position:relative;top:6px}.sek-pro-icon-next-title{padding:5px;min-width:22px}[data-sek-expanded=false]>.czr-open-pre-add-new{display:none}[data-sek-expanded=false]>.czr-items-wrapper{display:none}.sek-side-nimble-logo-wrapper{padding:4px 25px 0 2px!important;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}.sek-side-nimble-logo-wrapper .sek-nimble-logo{height:45px}.sek-side-nimble-logo-wrapper .sek-pro-pastil{height:30px}[data-input-type=code_editor] .czr-input{width:100%;float:left}#customize-preview iframe{top:36px}#nimble-top-bar{max-height:36px;position:absolute;text-align:center;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;opacity:.3;top:0;background:rgba(0,0,0,.5);padding:2px;z-index:99999;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}.outer-section-open #nimble-top-bar,.themes-panel-expanded #nimble-top-bar{display:none}body.nimble-top-bar-visible #nimble-top-bar{opacity:1}#nimble-top-bar:hover{background:rgba(0,0,0,.7)}#nimble-top-bar .nimble-top-bar-content{display:inline-block;line-height:20px;width:80%}#nimble-top-bar .sek-do-undo .icon:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;color:#fff}#nimble-top-bar .sek-settings,#nimble-top-bar .sek-tmpl-saving{font-size:18px;padding:0 5px}#nimble-top-bar button{background:0 0;border:none;color:#fff;cursor:pointer}#nimble-top-bar button[data-nimble-state=disabled]{cursor:inherit;opacity:.4!important;cursor:not-allowed}#nimble-top-bar .sek-do-undo button:hover{opacity:1}#nimble-top-bar .sek-do-undo button:focus{outline:0}#nimble-top-bar .sek-do-undo .icon:before{position:relative}#nimble-top-bar .sek-do-undo .icon.undo:before{content:"\f171";-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg)}#nimble-top-bar .sek-do-undo .icon.do:before{content:"\f172";-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}#nimble-top-bar .sek-add-content button{padding-top:3px}#nimble-top-bar .sek-nimble-doc{position:absolute;right:10px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}.rtl #nimble-top-bar .sek-nimble-doc{left:10px;right:auto}#nimble-top-bar .sek-nimble-doc img{width:30px;height:30px;position:relative;top:2px;-webkit-filter:grayscale(100%);filter:grayscale(100%);-webkit-filter:gray;filter:gray}#nimble-top-bar .sek-nimble-doc:hover img{-webkit-filter:none;filter:none}#nimble-top-bar .sek-notifications{max-width:410px;overflow:hidden}#nimble-top-bar .sek-notifications .debug-mode-notif{color:red;line-height:1.5em;padding:3px;background:#fff;display:inline-block;overflow:hidden}#nimble-top-section-save-ui,#nimble-top-tmpl-save-ui{height:auto;min-height:300px;padding:20px;position:absolute;top:-300px;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;opacity:.3;background:rgba(0,0,0,.7);z-index:99999;max-width:100%;font-size:16px;line-height:1.5em}#nimble-top-section-save-ui .nb-section-save-inner,#nimble-top-tmpl-save-ui .nb-tmpl-save-inner{max-width:800px;margin:auto}body.sek-save-section-ui-visible #nimble-top-section-save-ui,body.sek-save-tmpl-ui-visible #nimble-top-tmpl-save-ui{opacity:1;top:36px}#nimble-top-section-save-ui .sek-close-dialog,#nimble-top-tmpl-save-ui .sek-close-dialog{position:absolute;bottom:10px;right:10px;border-radius:3px!important}#nimble-top-section-save-ui #sek-saved-section-title.error,#nimble-top-tmpl-save-ui #sek-saved-tmpl-title.error{border:1px solid red}.sek-section-description,.sek-section-title,.sek-tmpl-description,.sek-tmpl-title,select.sek-saved-section-picker,select.sek-saved-tmpl-picker{margin-top:10px;float:left;clear:both;width:100%}.sek-section-description textarea,.sek-tmpl-description textarea,input#sek-saved-section-title,input#sek-saved-tmpl-title,select.sek-saved-section-picker,select.sek-saved-tmpl-picker{width:97%;max-width:none;margin-bottom:10px}.sek-section-description textarea,.sek-tmpl-description textarea{min-height:100px}.sek-save-section-action .sek-do-save-section,.sek-save-section-action .sek-do-update-section,.sek-save-section-action .sek-open-remove-confirmation,.sek-save-tmpl-action .sek-do-save-tmpl,.sek-save-tmpl-action .sek-do-update-tmpl,.sek-save-tmpl-action .sek-open-remove-confirmation,.sek-saved-section-picker,.sek-saved-tmpl-picker,.sek-section-description,.sek-section-title,.sek-tmpl-description,.sek-tmpl-title{display:none}.section-collection-populated .sek-saved-section-picker,.tmpl-collection-populated .sek-saved-tmpl-picker{display:block}.sek-section-remove-dialog,.sek-tmpl-remove-dialog{display:none;color:red;background:#fff;padding:5px;text-transform:uppercase;float:left;width:96%}.sek-section-remove-dialog .sek-do-remove-section,.sek-tmpl-remove-dialog .sek-do-remove-tmpl{color:red}[data-sek-tmpl-dialog-mode=save] .sek-saved-tmpl-picker{display:none}[data-sek-tmpl-dialog-mode=save] .sek-tmpl-title{display:block}[data-sek-tmpl-dialog-mode=save] .sek-tmpl-description{display:block}[data-sek-tmpl-dialog-mode=save] .sek-do-save-tmpl{display:block;border-color:#ff0;background:#f9f9b6f7;border-radius:3px!important}[data-sek-tmpl-dialog-mode=update].sek-tmpl-update-selected .sek-tmpl-title{display:block}[data-sek-tmpl-dialog-mode=update].sek-tmpl-update-selected .sek-tmpl-description{display:block}[data-sek-tmpl-dialog-mode=update].sek-tmpl-update-selected .sek-do-update-tmpl{display:block}[data-sek-tmpl-dialog-mode=remove].sek-tmpl-remove-selected .sek-open-remove-confirmation{display:block}[data-sek-tmpl-dialog-mode=remove].sek-removal-confirmation-opened .sek-open-remove-confirmation{display:none!important}[data-sek-tmpl-dialog-mode=remove].sek-removal-confirmation-opened .sek-tmpl-remove-dialog{display:block}[data-sek-section-dialog-mode=save] .sek-saved-section-picker{display:none}[data-sek-section-dialog-mode=save] .sek-section-title{display:block}[data-sek-section-dialog-mode=save] .sek-section-description{display:block}[data-sek-section-dialog-mode=save] .sek-do-save-section{display:block;border-color:#ff0;background:#f9f9b6f7;border-radius:3px!important}[data-sek-section-dialog-mode=update].sek-section-update-selected .sek-section-title{display:block}[data-sek-section-dialog-mode=update].sek-section-update-selected .sek-section-description{display:block}[data-sek-section-dialog-mode=update].sek-section-update-selected .sek-do-update-section{display:block}[data-sek-section-dialog-mode=remove].sek-section-remove-selected .sek-open-remove-confirmation{display:block}[data-sek-section-dialog-mode=remove].sek-removal-confirmation-opened .sek-open-remove-confirmation{display:none!important}[data-sek-section-dialog-mode=remove].sek-removal-confirmation-opened .sek-section-remove-dialog{display:block}[data-sek-section-dialog-mode=remove].sek-is-removal-only [data-section-mode-switcher=save],[data-sek-section-dialog-mode=remove].sek-is-removal-only [data-section-mode-switcher=update]{display:none}#nimble-top-section-save-ui .spinner,#nimble-top-tmpl-save-ui .spinner{display:none}#nimble-top-section-save-ui.nimble-section-processing-ajax .spinner,#nimble-top-tmpl-save-ui.nimble-tmpl-processing-ajax .spinner{display:block;visibility:visible}#nimble-tmpl-gallery,#nimble-tmpl-gallery .sek-tmpl-gal-import-dialog{-webkit-transition:top .3s ease-in-out;-moz-transition:top,.3s ease-in-out;-ms-transition:top,.3s ease-in-out;-o-transition:top,.3s ease-in-out;transition:top .3s ease-in-out}#nimble-tmpl-gallery{background:rgba(240,240,240,.89)!important;border-bottom:1px solid #aaa!important;color:#222!important;font-size:12px!important;position:absolute;top:-100vh;right:0;left:0;height:calc(100vh - 36px);overflow:auto;padding:15px;z-index:1000}.sek-template-gallery-expanded #nimble-tmpl-gallery{top:36px}#nimble-tmpl-gallery .sek-tmpl-gal-import-dialog{background:rgba(240,240,240,.89)!important;border-bottom:1px solid #aaa!important;color:#222!important;font-size:12px!important;position:absolute;top:-100vh;right:0;left:0;height:calc(100vh - 36px);overflow:auto;padding:15px;z-index:1001}.sek-tmpl-dialog-expanded #nimble-tmpl-gallery .sek-tmpl-gal-import-dialog{top:36px}#nimble-tmpl-gallery .sek-tmpl-gallery-inner{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%;margin-right:-10px;margin-left:-10px}#nimble-tmpl-gallery .sek-tmpl-gallery-inner *,#nimble-tmpl-gallery .sek-tmpl-gallery-inner :after,#nimble-tmpl-gallery .sek-tmpl-gallery-inner :before{box-sizing:border-box}.sek-tmpl-gallery-inner .sek-tmpl-item{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%;padding:5px 10px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;position:relative;cursor:pointer}@media (max-width:1300px){.sek-tmpl-gallery-inner .sek-tmpl-item{-ms-flex:0 0 33.333%;flex:0 0 33.333%;max-width:33.333%}}@media (max-width:1000px){.sek-tmpl-gallery-inner .sek-tmpl-item{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}}.sek-tmpl-info{position:absolute;top:0;bottom:0;width:calc(100% - 20px);max-height:calc(100% - 20px);padding:10px;overflow:hidden}.sek-tmpl-info>h3,.sek-tmpl-info>p{color:#fff;overflow:hidden}.sek-tmpl-info>h3{font-size:15px;margin:.5em 0}.sek-tmpl-info>p{font-size:13px;margin:.5em 0}.sek-tmpl-info>.use-tmpl{cursor:pointer;font-size:25px;width:50px;height:50px;color:#535353;background:rgba(255,255,255,.7);border-radius:30px;opacity:0;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;top:calc(50% - 25px);left:calc(50% - 25px)}.sek-tmpl-info:hover>.use-tmpl{opacity:.7}.sek-tmpl-info>.use-tmpl:hover{opacity:.95}.sek-tmpl-info>.remove-tmpl{cursor:pointer;font-size:16px;width:30px;height:30px;color:#535353;background:rgba(255,255,255,.7);border-radius:30px;opacity:0;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:10px;right:10px}.sek-tmpl-info:hover>.remove-tmpl{opacity:.7}.sek-tmpl-info>.remove-tmpl:hover{opacity:.95;color:red}.sek-tmpl-gallery-inner .sek-tmpl-thumb{cursor:pointer;position:relative}.sek-tmpl-thumb img{max-width:100%}.sek-tmpl-gallery-inner .sek-tmpl-thumb::after{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:.45;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.sek-tmpl-gallery-inner .sek-tmpl-item:hover .sek-tmpl-thumb::after{opacity:.65}#sek-gal-top-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}input.sek-filter-tmpl{width:60%}#sek-gal-top-bar .sek-ui-button-group{width:37%;text-align:right}.search-active .sek-tmpl-item{display:none}.search-active .sek-tmpl-item.search-match{display:-webkit-box;display:-ms-flexbox;display:flex}#nimble-level-tree{-webkit-transition:top .3s ease-in-out;-moz-transition:top,.3s ease-in-out;-ms-transition:top,.3s ease-in-out;-o-transition:top,.3s ease-in-out;transition:top .3s ease-in-out}.sek-level-tree-expanded #customize-preview iframe{top:366px;height:calc(100vh - 366px)}.sek-level-tree-expanded #nimble-top-bar .sek-level-tree button{color:#44b9e2}#nimble-level-tree{background:#f0f0f0!important;border-bottom:1px solid #aaa!important;color:#222!important;font-size:12px!important;position:absolute;top:36px;right:0;left:0;height:299px;overflow:auto;padding:15px;z-index:0}#nimble-level-tree ul li{padding-left:30px;cursor:pointer;margin-bottom:8px}#nimble-level-tree ul li .sek-remove-level{font-size:16px;opacity:.6}#nimble-level-tree ul li .sek-remove-level:hover{opacity:1}#nimble-level-tree ul li .sek-level-infos{line-height:30px;height:30px;padding-left:33px;position:relative;width:calc(100% - 25px)}.sek-level-infos .sek-inner-level-infos{background:inherit;width:inherit;height:inherit;line-height:inherit;padding-left:4px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:background .2s ease;transition:background .2s ease;-o-transition:background .2s ease}.sek-inner-level-infos:hover{color:#000;background:#fff}.sek-close-level-tree{position:fixed;top:44px;right:25px}img.sek-svg-mod-icon{max-width:45px}.sek-level-infos::before{position:absolute;left:-31px;background:#a2aab2;width:63px;height:2px;content:"";top:calc(50% - 1px)}#nimble-level-tree ul>li:first-child::before{position:absolute;content:"";background:#a2aab2;top:-15px;height:16px;bottom:0;left:-2px;width:2px}#nimble-level-tree ul>li:last-child::after{position:absolute;content:"";background:#f0f0f0;top:16px;bottom:0;left:-2px;width:2px}#nimble-level-tree ul{border-left:2px solid #a2aab2;position:relative}#nimble-level-tree ul>li:last-child{position:relative}
|
1 |
+
@font-face{font-family:'Material Icons';font-style:normal;font-weight:400;src:url(../fonts/material-icons/MaterialIcons-Regular.eot);src:local('Material Icons'),local('MaterialIcons-Regular'),url(../fonts/material-icons/MaterialIcons-Regular.woff2) format('woff2'),url(../fonts/material-icons/MaterialIcons-Regular.woff) format('woff'),url(../fonts/material-icons/MaterialIcons-Regular.ttf) format('truetype')}.material-icons{font-family:'Material Icons';font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:'liga';font-feature-settings:'liga'}#customize-preview iframe,#nimble-level-tree{-webkit-transition:top .3s ease-in-out;-moz-transition:top,.3s ease-in-out;-ms-transition:top,.3s ease-in-out;-o-transition:top,.3s ease-in-out;transition:top .3s ease-in-out}#customize-preview iframe{z-index:1}ul[id*=sub-accordion-section-__nimble__]{background:#f2f2f2!important}#customize-theme-controls .customize-pane-child[id*="__nimble__"]{-webkit-transition:unset;-o-transition:unset;transition:unset}li[id*="__nimble__"].customize-control{margin:8px 0;padding:2px;width:calc(100% - 4px);border:1px solid rgba(221,221,221,.43);box-shadow:1px 1px 2px 0 rgba(75,75,85,.2);-webkit-box-shadow:1px 1px 2px 0 rgba(75,75,85,.2);background-color:#fff}li[id*="__nimble__"].customize-control span.customize-control-title:first-child{margin-left:21px}#customize-theme-controls ul[id*=sub-accordion-section-__nimble__].open{top:0!important}.sek-float-right{float:right}.sek-float-left{float:left}.sek-flex-vertical-center{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}li[id^=accordion-section-__nimble__]{margin-top:16px}li[id^=accordion-section-__nimble__]>h3{border-top:1px solid #ddd}[data-sek-content-type]{float:left;padding:0;margin:1.8%;text-align:center;cursor:move;-webkit-transition:-webkit-box-shadow .2s ease;transition:-webkit-box-shadow .2s ease;-o-transition:box-shadow .2s ease;transition:box-shadow .2s ease;transition:box-shadow .2s ease,-webkit-box-shadow .2s ease;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.25);box-shadow:0 2px 5px rgba(0,0,0,.25);border-radius:4px}[data-sek-content-type=module]{width:29%;height:130px;position:relative}.sek-is-pro{position:absolute;top:5px;z-index:10;right:5px;height:20px;width:28px}[data-sek-content-type=preset_section]:hover .sek-is-pro img,[data-sek-tmpl-item-id]:hover .sek-is-pro img{opacity:.5}li[id*=sek_draggable_modules] [data-sek-content-type=preset_section]{width:29%;height:130px}.sek-content-type-wrapper [data-sek-content-type=preset_section]{width:95%;height:165px;position:relative;overflow:hidden}.sek-demo-link{position:absolute;bottom:-22px;z-index:20;height:18px;width:100%;padding:2px 0;background:#000;background-color:rgba(0,0,0,.5);color:#fff;font-size:13px;cursor:pointer;-webkit-transition:bottom .2s ease-in-out;-moz-transition:bottom,.2s ease-in-out;-ms-transition:bottom,.2s ease-in-out;-o-transition:bottom,.2s ease-in-out;transition:bottom .2s ease-in-out}.sek-demo-link a,.sek-demo-link a:focus,.sek-demo-link a:visited,.sek-demo-link i{color:#fff}.sek-demo-link a{text-decoration:none;text-transform:uppercase;font-size:12px}.sek-demo-link a:hover{color:#fff;text-decoration:underline}[data-sek-content-type=preset_section]:hover .sek-demo-link{bottom:0}[data-sek-content-type=preset_section] .sek-overlay{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:0;-webkit-transition:opacity .35s ease;transition:opacity .35s ease;-o-transition:opacity .35s ease}[data-sek-content-type=preset_section]:hover .sek-overlay{opacity:.15}[data-sek-content-type][draggable=true]:hover{-webkit-box-shadow:0 12px 20px rgba(0,0,0,.2);box-shadow:0 12px 20px rgba(0,0,0,.2)}[data-sek-content-type][draggable=false]{background:#eee;opacity:.8}.sek-user-section-wrapper{margin-bottom:15px;float:left;width:100%}.sek-user-section-wrapper [data-sek-content-type=preset_section] .sek-overlay{opacity:.4}.sek-user-section-wrapper [data-sek-content-type=preset_section]:hover .sek-overlay{opacity:.5}.sek-user-section-wrapper [data-sek-is-user-section=true]{height:165px;margin:0;width:97%}.sek-user-section-wrapper .sek-sec-thumb{position:absolute;opacity:.5;z-index:0;top:0;bottom:0;height:100%;width:100%}.sek-user-section-wrapper .sek-sec-info{position:relative;color:#fff;padding:2%;overflow:hidden;height:100%;max-height:138px;padding:10px}.sek-sec-info .sec-title{color:#fff;margin:0;line-height:20px;max-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sek-sec-info .sec-date,.sek-sec-info .sec-desc{margin:0;margin-top:5px;font-size:12px}.sek-sec-info .sec-date{font-size:italic}.sek-sec-info>.edit-user-sec,.sek-sec-info>.remove-user-sec{cursor:pointer;font-size:16px;width:30px;height:30px;color:#535353;background:rgba(255,255,255,.7);border-radius:30px;opacity:.3;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute}.sek-sec-info>.remove-user-sec{bottom:0;right:5px}.sek-sec-info>.edit-user-sec{bottom:0;left:5px}.sek-sec-info:hover>.remove-user-sec{opacity:.7}.sek-sec-info:hover>.edit-user-sec{opacity:.7}.sek-sec-info>.remove-user-sec:hover{opacity:.95;color:red}.sek-sec-info>.edit-user-sec:hover{opacity:.95;color:#000}.sek-dragging [data-sek-content-type]{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.25)!important;box-shadow:0 2px 5px rgba(0,0,0,.25)!important}.sek-dragged{background:#33b3db3d;background:rgba(51,179,219,.24)}[data-sek-content-type] .sek-module-icon{display:block;padding:0}[data-sek-content-type] .sek-module-icon .nimble-module-icons{font-size:3rem;max-width:100%;color:#878787;max-height:86px}[data-sek-content-type] .sek-module-icon.is-font-icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%;min-height:70%}[data-sek-content-type] .sek-module-icon.is-font-icon i{font-size:35px}[data-sek-content-type] .sek-module-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 6px 0;font-size:.75rem;height:45px;justify-content:center;position:relative;top:-18px}.sek-centered-module-title{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.sek-new-label{background:#ff0;border:1px solid #ff0;padding:3px 4px;line-height:12px;border-radius:8px;font-size:12px}.sek-accord-title{color:#4b4a4a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:120px;height:23px;line-height:22px;font-size:13px;float:left;padding-left:10px}.sek-pad-marg-inner{font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;margin:10px auto 10px auto;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:0;background-color:#e6e6e6;border:1px solid #c5c5c5;height:192px;width:232px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-pm-top-bottom-wrap{height:46px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-center-stretch{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.sek-pm-input{width:35px;height:15px;padding:0;text-align:center;font-family:Source Sans Pro;padding:5px;border-radius:3px;text-align:left;font-size:13px;outline:0;-webkit-box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);border:1px solid #ced6d9}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131}.sek-pm-middle-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;height:100px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-margin-left,.sek-pm-margin-right{width:46px}.sek-pm-padding-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background-color:#fff;border:1px solid #ced6d9;height:100px;width:140px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:5px;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease;-webkit-box-sizing:border-box;box-sizing:border-box;margin:auto}.sek-flex-justify-center{min-height:0;min-width:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-space-between{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-input-parent{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.sek-pm-input-parent .sek-pm-input{min-height:25px;min-width:40px;background-color:#fff}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px!important;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131;width:40px!important;text-align:center}.sek-pm-padding-wrapper label{margin:0}.sek-pad-marg-inner label{-webkit-box-flex:0;-ms-flex:0;flex:0}.reset-spacing-wrap{padding:10px 0 0;font-size:.8em;text-decoration:underline;cursor:pointer;text-align:center}.reset-spacing-wrap:hover{color:#006799}.sek-bg-pos-wrapper{padding:10px;text-align:center;display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper{display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper .sek-bg-pos{cursor:pointer;width:24px;height:24px;margin:3px;float:left}.sek-bg-pos-wrapper input[type=radio]{display:none}.sek-bg-pos-wrapper .sek-bg-pos span{display:inline-block;width:100%;height:100%;border-radius:6px;background:#e6e6e6 no-repeat center;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-bg-pos-wrapper .sek-bg-pos span:hover{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos span:hover svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos span svg{visibility:hidden;shape-rendering:crispEdges}.sek-bg-pos-wrapper .sek-svg-bg-pos{fill:#fff}div[data-sek-align]{margin:0 5px;padding:4px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;position:relative;text-align:center;width:23px;height:24px;top:-4px;border-radius:4px;cursor:pointer}div[data-input-type=horizTextAlignmentWithDeviceSwitcher] .czr-input{text-align:center}div[data-input-type=horizTextAlignmentWithDeviceSwitcher] .sek-h-align-wrapper{display:inline-block}div[data-input-type=horizAlignmentWithDeviceSwitcher] .czr-input{text-align:center}div[data-input-type=horizAlignmentWithDeviceSwitcher] .sek-h-align-wrapper{display:inline-block}.sek-h-align-wrapper .sek-align-icons{float:right}div[data-sek-align]:hover{-webkit-box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff}div[data-sek-align].selected{outline:0;color:#fff;-webkit-box-shadow:none;box-shadow:none;background:#555d66}div[data-sek-grid-layout]{margin:0 5px;padding:1px 3px 1px 1px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;position:relative;text-align:center;border-radius:4px;cursor:pointer}div[data-sek-grid-layout] i{font-size:50px}div[data-input-type=grid_layout] .czr-input{text-align:center}div[data-input-type=grid_layout] .sek-grid-layout-wrapper{display:inline-block}.sek-grid-layout-wrapper .sek-grid-icons{float:right}div[data-sek-grid-layout]:hover{-webkit-box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff}div[data-sek-grid-layout].selected{outline:0;color:#fff;-webkit-box-shadow:none;box-shadow:none;background:#33b3db}.customize-control select[data-czrtype=categories]{height:28px}.sek-input-device-switcher .sek-switcher:before,.sek-mobile-device-icons .sek-switcher:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;color:#656a6f;position:relative;top:-5px}.sek-input-device-switcher .sek-switcher{cursor:pointer}.sek-input-device-switcher .sek-switcher,.sek-mobile-device-icons .sek-switcher{background:0 0;border:none;padding:0 1px;margin:0 0 0 -2px;box-shadow:none;border-top:1px solid transparent;border-bottom:4px solid transparent;-webkit-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;-o-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}.sek-input-device-switcher .sek-switcher:focus,.sek-input-device-switcher .sek-switcher:hover{background-color:#fff}.sek-input-device-switcher .sek-switcher.active:before{color:#191e23}.sek-input-device-switcher .sek-switcher:focus:before,.sek-input-device-switcher .sek-switcher:hover:before{color:#0073aa}.sek-input-device-switcher .preview-desktop:before,.sek-mobile-device-icons .preview-desktop:before{content:"\f472"}.sek-input-device-switcher .preview-tablet:before,.sek-mobile-device-icons .preview-tablet:before{content:"\f471"}.sek-input-device-switcher .preview-mobile:before,.sek-mobile-device-icons .preview-mobile:before{content:"\f470"}.sek-borders{width:100%;float:left;margin-bottom:8px}.sek-borders>div{float:left;width:100%}.sek-borders .sek-range-unit-wrapper>div{float:left}.sek-borders .sek-border-type-wrapper{margin-bottom:5px}.sek-borders .sek-range-unit-wrapper{margin-bottom:5px}.sek-borders .sek-range-unit-wrapper .sek-unit-wrapper{float:right}.sek-borders .sek-color-wrapper{width:100%}.sek-borders .sek-color-wrapper .sek-color-picker{width:50%;float:left}.sek-borders .sek-color-wrapper .sek-reset-button{width:50%;float:right}[data-sek-radius-type=top_right]>i.material-icons{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}[data-sek-radius-type=bottom_right]>i.material-icons{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}[data-sek-radius-type=bottom_left]>i.material-icons{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sek-range-with-unit-picker-wrapper{width:100%;float:left;margin-bottom:8px}.sek-range-with-unit-picker-wrapper .sek-unit-wrapper{float:right}.sek-range-with-unit-picker-wrapper>div{float:left}.sek-range-wrapper{width:44%;margin-right:4px}.sek-no-unit-picker .sek-range-wrapper{width:70%}.sek-number-wrapper,.sek-simple-number-wrapper{width:60px;margin-right:5px}.sek-simple-number-wrapper{text-align:right}.sek-range-input{flex:1;width:100%;padding:0;-webkit-appearance:none;background:0 0;height:26px}.sek-range-input::-webkit-slider-thumb{-webkit-appearance:none;height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-8px}.sek-range-input::-moz-range-thumb{height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-7px}.sek-range-input::-ms-thumb{height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-8px}.sek-range-input:focus{outline:0}.sek-range-input::-webkit-slider-runnable-track{height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px;margin-top:-4px}.sek-range-input::-moz-range-track{height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px}.sek-range-input::-ms-track{margin-top:-4px;background:0 0;border-color:transparent;color:transparent;height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px}.sek-import-btn-wrap{padding:20px 0}.sek-import-btn-wrap input.sek-import-file{margin-bottom:10px}.sek-export-btn-wrap{padding-bottom:20px;border-bottom:1px solid #ddd}.sek-import-file{background:#eee;width:100%;margin:10px 0;padding:10px;font-size:12px}.sek-uploading{background:#eee;display:none;margin:10px 0;padding:10px;font-size:12px}.czr-import-dialog{display:none;padding:11px}.czr-import-message{padding-bottom:10px}.sek-import-btn-wrap .czr-import-dialog .czr-import-message{font-size:12px!important}.sek-import-btn-wrap .czr-import-dialog .button{margin:4px 0;font-size:12px!important}.sek-slide-thumb{width:32px;height:32px;overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;float:left}.sek-slide-title{color:#4b4a4a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:120px;height:32px;line-height:32px;font-size:13px;float:left;padding-left:10px}.sek-pro-notice{position:relative;padding-left:36px;font-size:13px}.sek-pro-notice a,.sek-pro-notice a:focus,.sek-pro-notice a:hover{color:#f07829;font-weight:700;text-decoration:none}.sek-pro-notice a:hover{text-decoration:underline}.sek-pro-icon{position:absolute;width:32px;left:0;top:-2px}.sek-pro-notice .sek-pro-notice-icon-bef-text{display:inline-block;width:23px;height:15px;position:relative}.sek-pro-notice .sek-pro-notice-icon-bef-text img{position:absolute;top:0}.sek-unit-wrapper{text-align:center}.sek-ui-button-group{display:inline-block}.sek-ui-button-group .sek-ui-button:first-child{border-radius:3px 0 0 3px}.sek-ui-button-group .sek-ui-button+.sek-ui-button{margin-left:-1px}.sek-ui-button-group .sek-ui-button:last-child{border-radius:0 3px 3px 0}.sek-ui-button{height:28px;padding:0 10px 2px;border-radius:3px;white-space:nowrap;border-width:1px;border-style:solid;display:inline-flex;text-decoration:none;font-size:12px;line-height:25px;font-weight:400;margin:0;cursor:pointer;-webkit-appearance:none;background:0 0;color:#555;border-color:#ccc;background:#f7f7f7;box-shadow:inset 0 -1px 0 #ccc;vertical-align:top;-webkit-transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-ms-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out}.sek-ui-button:hover{background:#fafafa;border-color:#999;box-shadow:inset 0 -1px 0 #999;color:#23282d;opacity:1!important}.sek-ui-button:active:not(:disabled){background:#eee;border-color:#999;box-shadow:inset 0 1px 0 #999}.sek-ui-button:focus:not(:disabled){background:#fafafa;color:#23282d;border-color:#999;box-shadow:inset 0 -1px 0 #999,0 0 0 2px #fbfbfb;outline:0}.sek-ui-button[aria-pressed=true]{background:#555d66;border-color:#555d66;box-shadow:inset 0 -1px 0 #555d66;color:#fff;text-decoration:none}.sek-ui-button[aria-pressed=true]:focus:not(:disabled),.sek-ui-button[aria-pressed=true]:hover{background:#555d66;border-color:#4f4f4f;color:#fff}.sek-ui-button[aria-pressed=true]:focus:not(:disabled){box-shadow:inset 0 -1px 0 #4f4f4f}.sek-ui-button[aria-pressed=true]:focus:not(:disabled){outline:0}.sek-content-type-wrapper,.sek-save-section-action,.sek-save-section-mode-switcher,.sek-save-tmpl-action,.sek-save-tmpl-mode-switcher{margin-bottom:8px;width:100%;float:left}#nimble-tmpl-gallery .sek-ui-button-group,.sek-content-type-wrapper .sek-ui-button-group,.sek-save-section-action .sek-ui-button-group,.sek-save-section-mode-switcher .sek-ui-button-group,.sek-save-tmpl-action .sek-ui-button-group,.sek-save-tmpl-mode-switcher .sek-ui-button-group{display:block}#nimble-tmpl-gallery .sek-ui-button,.sek-content-type-wrapper .sek-ui-button,.sek-save-section-action .sek-ui-button,.sek-save-section-mode-switcher .sek-ui-button,.sek-save-tmpl-action .sek-ui-button,.sek-save-tmpl-mode-switcher .sek-ui-button{text-align:center;display:inline-block;padding:3px 10px;height:auto;text-transform:uppercase}.sek-content-type-wrapper .sek-ui-button{width:49%}.sek-save-section-mode-switcher .sek-ui-button,.sek-save-tmpl-mode-switcher .sek-ui-button{width:32%}.sek-content-type-wrapper [data-sek-content-type=template]{width:98%;margin-top:5px}[data-input-type=module_option_switcher] .sek-content-type-wrapper{margin-bottom:0}[data-input-type=module_option_switcher] [aria-pressed=false]{opacity:.7}[data-input-type=module_option_switcher] [data-sek-option-type]{position:relative}.sek-wrap-opt-switch-btn{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}[data-input-type=module_option_switcher] [data-sek-option-type] .sek-wrap-opt-switch-btn>i{font-size:21px;line-height:24px}[data-input-type=module_option_switcher] [data-sek-option-type] .sek-wrap-opt-switch-btn>span{position:relative;padding-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.wp-core-ui .button.sek-reset-button{font-size:11px;padding:0 5px 1px;line-height:18px;height:25px;min-height:25px;color:#555;border-color:#ccc}.sek-animated-arrow{position:absolute;left:-20px;margin-left:6px;top:3px;font-size:10px;color:#617379;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;-o-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center}[data-sek-expanded=true] label>.customize-control-title .sek-animated-arrow{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}[data-sek-expanded=true] label>.customize-control-title .sek-ctrl-accordion-title,[data-sek-expanded] label>.customize-control-title .sek-ctrl-accordion-title:hover{text-decoration:underline;text-underline-position:under}.customize-control-title .sek-ctrl-accordion-title>i{font-size:1.2em;position:relative;top:4px;padding-right:4px}.sek-level-option-icon{padding-right:5px;min-width:22px;text-align:center}.sek-input-title-icon{position:relative;top:6px}.sek-pro-icon-next-title{padding:5px;min-width:22px}[data-sek-expanded=false]>.czr-open-pre-add-new{display:none}[data-sek-expanded=false]>.czr-items-wrapper{display:none}.sek-side-nimble-logo-wrapper{padding:4px 25px 0 2px!important;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}.sek-side-nimble-logo-wrapper .sek-nimble-logo{height:45px}.sek-side-nimble-logo-wrapper .sek-pro-pastil{height:30px}[data-input-type=code_editor] .czr-input{width:100%;float:left}#customize-preview iframe{top:36px}#nimble-top-bar{max-height:36px;position:absolute;text-align:center;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;opacity:.3;top:0;background:rgba(0,0,0,.5);padding:2px;z-index:99999;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}.outer-section-open #nimble-top-bar,.themes-panel-expanded #nimble-top-bar{display:none}body.nimble-top-bar-visible #nimble-top-bar{opacity:1}#nimble-top-bar:hover{background:rgba(0,0,0,.7)}#nimble-top-bar .nimble-top-bar-content{display:inline-block;line-height:20px;width:80%}#nimble-top-bar .sek-do-undo .icon:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;color:#fff}#nimble-top-bar .sek-settings,#nimble-top-bar .sek-tmpl-saving{font-size:18px;padding:0 5px}#nimble-top-bar button{background:0 0;border:none;color:#fff;cursor:pointer}#nimble-top-bar button[data-nimble-state=disabled]{cursor:inherit;opacity:.4!important;cursor:not-allowed}#nimble-top-bar .sek-do-undo button:hover{opacity:1}#nimble-top-bar .sek-do-undo button:focus{outline:0}#nimble-top-bar .sek-do-undo .icon:before{position:relative}#nimble-top-bar .sek-do-undo .icon.undo:before{content:"\f171";-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg)}#nimble-top-bar .sek-do-undo .icon.do:before{content:"\f172";-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}#nimble-top-bar .sek-add-content button{padding-top:3px}#nimble-top-bar .sek-nimble-doc{position:absolute;right:10px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}.rtl #nimble-top-bar .sek-nimble-doc{left:10px;right:auto}#nimble-top-bar .sek-nimble-doc img{width:30px;height:30px;position:relative;top:2px;-webkit-filter:grayscale(100%);filter:grayscale(100%);-webkit-filter:gray;filter:gray}#nimble-top-bar .sek-nimble-doc:hover img{-webkit-filter:none;filter:none}#nimble-top-bar .sek-notifications{max-width:410px;overflow:hidden}#nimble-top-bar .sek-notifications .debug-mode-notif{color:red;line-height:1.5em;padding:3px;background:#fff;display:inline-block;overflow:hidden}#nimble-top-section-save-ui,#nimble-top-tmpl-save-ui{height:auto;min-height:300px;padding:20px;position:absolute;top:-300px;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;opacity:.3;background:rgba(0,0,0,.7);z-index:99999;max-width:100%;font-size:16px;line-height:1.5em}#nimble-top-section-save-ui .nb-section-save-inner,#nimble-top-tmpl-save-ui .nb-tmpl-save-inner{max-width:800px;margin:auto}body.sek-save-section-ui-visible #nimble-top-section-save-ui,body.sek-save-tmpl-ui-visible #nimble-top-tmpl-save-ui{opacity:1;top:36px}#nimble-top-section-save-ui .sek-close-dialog,#nimble-top-tmpl-save-ui .sek-close-dialog{position:absolute;bottom:10px;right:10px;border-radius:3px!important}#nimble-top-section-save-ui #sek-saved-section-title.error,#nimble-top-tmpl-save-ui #sek-saved-tmpl-title.error{border:1px solid red}.sek-section-description,.sek-section-title,.sek-tmpl-description,.sek-tmpl-title,select.sek-saved-section-picker,select.sek-saved-tmpl-picker{margin-top:10px;float:left;clear:both;width:100%}.sek-section-description textarea,.sek-tmpl-description textarea,input#sek-saved-section-title,input#sek-saved-tmpl-title,select.sek-saved-section-picker,select.sek-saved-tmpl-picker{width:97%;max-width:none;margin-bottom:10px}.sek-section-description textarea,.sek-tmpl-description textarea{min-height:100px}.sek-save-section-action .sek-do-save-section,.sek-save-section-action .sek-do-update-section,.sek-save-section-action .sek-open-remove-confirmation,.sek-save-tmpl-action .sek-do-save-tmpl,.sek-save-tmpl-action .sek-do-update-tmpl,.sek-save-tmpl-action .sek-open-remove-confirmation,.sek-saved-section-picker,.sek-saved-tmpl-picker,.sek-section-description,.sek-section-title,.sek-tmpl-description,.sek-tmpl-title{display:none}.section-collection-populated .sek-saved-section-picker,.tmpl-collection-populated .sek-saved-tmpl-picker{display:block}.sek-section-remove-dialog,.sek-tmpl-remove-dialog{display:none;color:red;background:#fff;padding:5px;text-transform:uppercase;float:left;width:96%}.sek-section-remove-dialog .sek-do-remove-section,.sek-tmpl-remove-dialog .sek-do-remove-tmpl{color:red}[data-sek-tmpl-dialog-mode=save] [data-tmpl-mode-switcher=remove]{display:none}[data-sek-tmpl-dialog-mode=save] .sek-saved-tmpl-picker{display:none}[data-sek-tmpl-dialog-mode=save] .sek-tmpl-title{display:block}[data-sek-tmpl-dialog-mode=save] .sek-tmpl-description{display:block}[data-sek-tmpl-dialog-mode=save] .sek-do-save-tmpl{display:block;border-color:#ff0;background:#f9f9b6f7;border-radius:3px!important}[data-sek-tmpl-dialog-mode=update] [data-tmpl-mode-switcher=remove]{display:none}[data-sek-tmpl-dialog-mode=update].sek-tmpl-update-selected .sek-tmpl-title{display:block}[data-sek-tmpl-dialog-mode=update].sek-tmpl-update-selected .sek-tmpl-description{display:block}[data-sek-tmpl-dialog-mode=update].sek-tmpl-update-selected .sek-do-update-tmpl{display:block}.sek-save-tmpl-mode-switcher .sek-ui-button[data-tmpl-mode-switcher=edit]{display:none}[data-sek-tmpl-dialog-mode=edit] [data-tmpl-mode-switcher=edit]{display:inline-block!important}[data-sek-tmpl-dialog-mode=edit] [data-tmpl-mode-switcher=update]{display:none}[data-sek-tmpl-dialog-mode=edit] [data-tmpl-mode-switcher=save]{display:none}[data-sek-tmpl-dialog-mode=edit] [data-tmpl-mode-switcher=remove]{display:none}[data-sek-tmpl-dialog-mode=edit] .sek-saved-tmpl-picker{display:block}[data-sek-tmpl-dialog-mode=edit] .sek-tmpl-title{display:block}[data-sek-tmpl-dialog-mode=edit] .sek-tmpl-description{display:block}[data-sek-tmpl-dialog-mode=edit] .sek-do-update-tmpl{display:block}[data-sek-tmpl-dialog-mode=remove] [data-tmpl-mode-switcher=update]{display:none}[data-sek-tmpl-dialog-mode=remove] [data-tmpl-mode-switcher=save]{display:none}[data-sek-tmpl-dialog-mode=remove].sek-tmpl-remove-selected .sek-open-remove-confirmation{display:block}[data-sek-tmpl-dialog-mode=remove].sek-removal-confirmation-opened .sek-open-remove-confirmation{display:none!important}[data-sek-tmpl-dialog-mode=remove].sek-removal-confirmation-opened .sek-tmpl-remove-dialog{display:block}[data-sek-section-dialog-mode=save] [data-section-mode-switcher=remove]{display:none}[data-sek-section-dialog-mode=save] .sek-saved-section-picker{display:none}[data-sek-section-dialog-mode=save] .sek-section-title{display:block}[data-sek-section-dialog-mode=save] .sek-section-description{display:block}[data-sek-section-dialog-mode=save] .sek-do-save-section{display:block;border-color:#ff0;background:#f9f9b6f7;border-radius:3px!important}[data-sek-section-dialog-mode=update] [data-section-mode-switcher=remove]{display:none}[data-sek-section-dialog-mode=update].sek-section-update-selected .sek-section-title{display:block}[data-sek-section-dialog-mode=update].sek-section-update-selected .sek-section-description{display:block}[data-sek-section-dialog-mode=update].sek-section-update-selected .sek-do-update-section{display:block}.sek-save-section-mode-switcher .sek-ui-button[data-section-mode-switcher=edit]{display:none}[data-sek-section-dialog-mode=edit] [data-section-mode-switcher=edit]{display:inline-block!important}[data-sek-section-dialog-mode=edit] [data-section-mode-switcher=update]{display:none}[data-sek-section-dialog-mode=edit] [data-section-mode-switcher=save]{display:none}[data-sek-section-dialog-mode=edit] [data-section-mode-switcher=remove]{display:none}[data-sek-section-dialog-mode=edit] .sek-saved-section-picker{display:block}[data-sek-section-dialog-mode=edit] .sek-section-title{display:block}[data-sek-section-dialog-mode=edit] .sek-section-description{display:block}[data-sek-section-dialog-mode=edit] .sek-do-update-section{display:block}[data-sek-section-dialog-mode=remove].sek-section-remove-selected .sek-open-remove-confirmation{display:block}[data-sek-section-dialog-mode=remove].sek-removal-confirmation-opened .sek-open-remove-confirmation{display:none!important}[data-sek-section-dialog-mode=remove].sek-removal-confirmation-opened .sek-section-remove-dialog{display:block}[data-sek-section-dialog-mode=remove].sek-is-removal-only [data-section-mode-switcher=save],[data-sek-section-dialog-mode=remove].sek-is-removal-only [data-section-mode-switcher=update]{display:none}#nimble-top-section-save-ui .spinner,#nimble-top-tmpl-save-ui .spinner{display:none}#nimble-top-section-save-ui.nimble-section-processing-ajax .spinner,#nimble-top-tmpl-save-ui.nimble-tmpl-processing-ajax .spinner{display:block;visibility:visible}#nimble-tmpl-gallery,#nimble-tmpl-gallery .sek-tmpl-gal-import-dialog{-webkit-transition:top .3s ease-in-out;-moz-transition:top,.3s ease-in-out;-ms-transition:top,.3s ease-in-out;-o-transition:top,.3s ease-in-out;transition:top .3s ease-in-out}#nimble-tmpl-gallery{background:rgba(240,240,240,.89)!important;border-bottom:1px solid #aaa!important;color:#222!important;font-size:12px!important;position:absolute;top:-100vh;right:0;left:0;height:calc(100vh - 36px);overflow:auto;padding:15px;z-index:1000}.sek-template-gallery-expanded #nimble-tmpl-gallery{top:36px}#nimble-tmpl-gallery .sek-tmpl-gal-import-dialog{background:rgba(240,240,240,.89)!important;border-bottom:1px solid #aaa!important;color:#222!important;font-size:12px!important;position:absolute;top:-100vh;right:0;left:0;height:calc(100vh - 36px);overflow:auto;padding:15px;z-index:1001}.sek-tmpl-dialog-expanded #nimble-tmpl-gallery .sek-tmpl-gal-import-dialog{top:36px}#nimble-tmpl-gallery .sek-tmpl-gallery-inner{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%;margin-right:-10px;margin-left:-10px}#nimble-tmpl-gallery .sek-tmpl-gallery-inner *,#nimble-tmpl-gallery .sek-tmpl-gallery-inner :after,#nimble-tmpl-gallery .sek-tmpl-gallery-inner :before{box-sizing:border-box}.sek-tmpl-gallery-inner .sek-tmpl-item{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%;padding:5px 10px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;position:relative;cursor:pointer}@media (max-width:1300px){.sek-tmpl-gallery-inner .sek-tmpl-item{-ms-flex:0 0 33.333%;flex:0 0 33.333%;max-width:33.333%}}@media (max-width:1000px){.sek-tmpl-gallery-inner .sek-tmpl-item{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}}.sek-tmpl-info{position:absolute;top:0;bottom:0;width:calc(100% - 20px);max-height:calc(100% - 20px);padding:10px;overflow:hidden}.sek-tmpl-info>h3,.sek-tmpl-info>p{color:#fff;overflow:hidden}.sek-tmpl-info>h3{font-size:15px;margin:.5em 0}.sek-tmpl-info>p{font-size:13px;margin:.5em 0}.sek-tmpl-info>.use-tmpl{cursor:pointer;font-size:25px;width:50px;height:50px;color:#535353;background:rgba(255,255,255,.7);border-radius:30px;opacity:0;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;top:calc(50% - 25px);left:calc(50% - 25px)}.sek-tmpl-info:hover>.use-tmpl{opacity:.7}.sek-tmpl-info>.use-tmpl:hover{opacity:.95}.sek-tmpl-info>.edit-tmpl,.sek-tmpl-info>.remove-tmpl{cursor:pointer;font-size:16px;width:30px;height:30px;color:#535353;background:rgba(255,255,255,.7);border-radius:30px;opacity:.4;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute}.sek-tmpl-info>.remove-tmpl{bottom:10px;right:10px}.sek-tmpl-info>.edit-tmpl{bottom:10px;left:10px}.sek-tmpl-info:hover>.edit-tmpl,.sek-tmpl-info:hover>.remove-tmpl{opacity:.7}.sek-tmpl-info>.remove-tmpl:hover{opacity:.95;color:red}.sek-tmpl-info>.edit-tmpl:hover{opacity:.95;color:#000}.sek-tmpl-gallery-inner .sek-tmpl-thumb{cursor:pointer;position:relative;height:380px;width:100%;background-size:cover;background-repeat:no-repeat;background-position:center}.sek-tmpl-thumb img{max-width:100%}.sek-tmpl-gallery-inner .sek-tmpl-thumb::after{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:.45;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.sek-tmpl-gallery-inner .sek-tmpl-item:hover .sek-tmpl-thumb::after{opacity:.65}#sek-gal-top-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}input.sek-filter-tmpl{width:60%}#sek-gal-top-bar .sek-ui-button-group{width:37%;text-align:right}.search-active .sek-tmpl-item{display:none}.search-active .sek-tmpl-item.search-match{display:-webkit-box;display:-ms-flexbox;display:flex}#sek-tmpl-source-switcher{display:none;width:100%;padding:10px 0}#sek-tmpl-source-switcher .sek-ui-button-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}#nimble-level-tree{-webkit-transition:top .3s ease-in-out;-moz-transition:top,.3s ease-in-out;-ms-transition:top,.3s ease-in-out;-o-transition:top,.3s ease-in-out;transition:top .3s ease-in-out}.sek-level-tree-expanded #customize-preview iframe{top:366px;height:calc(100vh - 366px)}.sek-level-tree-expanded #nimble-top-bar .sek-level-tree button{color:#44b9e2}#nimble-level-tree{background:#f0f0f0!important;border-bottom:1px solid #aaa!important;color:#222!important;font-size:12px!important;position:absolute;top:36px;right:0;left:0;height:299px;overflow:auto;padding:15px;z-index:0}#nimble-level-tree ul li{padding-left:30px;cursor:pointer;margin-bottom:8px}#nimble-level-tree ul li .sek-remove-level{font-size:16px;opacity:.6}#nimble-level-tree ul li .sek-remove-level:hover{opacity:1}#nimble-level-tree ul li .sek-level-infos{line-height:30px;height:30px;padding-left:33px;position:relative;width:calc(100% - 25px)}.sek-level-infos .sek-inner-level-infos{background:inherit;width:inherit;height:inherit;line-height:inherit;padding-left:4px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:background .2s ease;transition:background .2s ease;-o-transition:background .2s ease}.sek-inner-level-infos:hover{color:#000;background:#fff}.sek-close-level-tree{position:fixed;top:44px;right:25px}img.sek-svg-mod-icon{max-width:45px}.sek-level-infos::before{position:absolute;left:-31px;background:#a2aab2;width:63px;height:2px;content:"";top:calc(50% - 1px)}#nimble-level-tree ul>li:first-child::before{position:absolute;content:"";background:#a2aab2;top:-15px;height:16px;bottom:0;left:-2px;width:2px}#nimble-level-tree ul>li:last-child::after{position:absolute;content:"";background:#f0f0f0;top:16px;bottom:0;left:-2px;width:2px}#nimble-level-tree ul{border-left:2px solid #a2aab2;position:relative}#nimble-level-tree ul>li:last-child{position:relative}
|
assets/czr/sek/js/ccat-sek-control.js
CHANGED
@@ -1777,7 +1777,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1777 |
|
1778 |
self.saveSectionDialogMode = new api.Value('hidden');// 'save' default mode is set when dialog html is rendered
|
1779 |
self.saveSectionDialogMode.bind( function(mode){
|
1780 |
-
if ( !_.contains(['hidden', 'save', 'update', 'remove' ], mode ) ) {
|
1781 |
api.errare('error setupSaveSectionUI => unknown section dialog mode', mode );
|
1782 |
mode = 'save';
|
1783 |
}
|
@@ -1795,7 +1795,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1795 |
|
1796 |
// make sure the remove dialog is hidden
|
1797 |
$secSaveDialogWrap.removeClass('sek-removal-confirmation-opened');
|
1798 |
-
|
1799 |
// execute actions depending on the selected mode
|
1800 |
switch( mode ) {
|
1801 |
case 'save' :
|
@@ -1804,14 +1804,29 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1804 |
$descInput.val('');
|
1805 |
break;
|
1806 |
case 'update' :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1807 |
case 'remove' :
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
|
|
1811 |
|
1812 |
self.setSavedSectionCollection().done( function( sec_collection ) {
|
1813 |
// refresh section picker in case the user updated without changing anything
|
1814 |
self.refreshSectionPickerHtml();
|
|
|
|
|
1815 |
});
|
1816 |
break;
|
1817 |
}//switch
|
@@ -1904,77 +1919,78 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1904 |
|
1905 |
// ATTACH DOM EVENTS
|
1906 |
// Dialog Mode Switcher
|
1907 |
-
$secSaveDialogWrap
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
|
|
1911 |
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1915 |
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
if (
|
1922 |
-
|
1923 |
-
self.setSavedSectionCollection( { refresh : true } );// <= true for refresh
|
1924 |
-
}
|
1925 |
-
});
|
1926 |
-
});
|
1927 |
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1935 |
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
self.setSavedSectionCollection( { refresh : true } )// <= true for refresh
|
1942 |
-
.done( function( sec_collection ) {
|
1943 |
-
// refresh section picker in case the user updated without changing anything
|
1944 |
-
self.refreshSectionPickerHtml();
|
1945 |
-
});
|
1946 |
-
}
|
1947 |
-
});
|
1948 |
-
});
|
1949 |
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
|
|
|
|
1955 |
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
|
|
|
|
1963 |
|
1964 |
-
|
1965 |
-
|
1966 |
-
$secSaveDialogWrap.removeClass('nimble-section-processing-ajax');
|
1967 |
$secSaveDialogWrap.removeClass('sek-removal-confirmation-opened');
|
1968 |
-
if ( response.success ) {
|
1969 |
-
self.setSavedSectionCollection( { refresh : true } );// <= true for refresh
|
1970 |
-
}
|
1971 |
});
|
1972 |
-
});
|
1973 |
-
|
1974 |
-
// Cancel Remove
|
1975 |
-
$secSaveDialogWrap.on( 'click', '.sek-cancel-remove-section', function(evt){
|
1976 |
-
$secSaveDialogWrap.removeClass('sek-removal-confirmation-opened');
|
1977 |
-
});
|
1978 |
|
1979 |
|
1980 |
// Switch to update mode
|
@@ -2031,22 +2047,38 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2031 |
// Fired on 'click' on .sek-do-save-section btn
|
2032 |
// @param sectionPostNameCandidateForUpdate is only provided when saving
|
2033 |
saveOrUpdateSavedSection : function(evt, sectionPostNameCandidateForUpdate ) {
|
2034 |
-
var self = this,
|
|
|
|
|
|
|
2035 |
// idOfSectionToSave is set when reacting to click action
|
2036 |
// @see react to preview 'sek-toggle-save-section-ui'
|
2037 |
-
if ( !
|
2038 |
-
|
2039 |
-
|
|
|
|
|
2040 |
}
|
2041 |
evt.preventDefault();
|
2042 |
var $_title = $('#sek-saved-section-title'),
|
2043 |
section_title = $_title.val(),
|
2044 |
section_description = $('#sek-saved-section-description').val(),
|
2045 |
-
sectionModel
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2050 |
}
|
2051 |
|
2052 |
if ( _.isEmpty( section_title ) ) {
|
@@ -2066,22 +2098,15 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2066 |
|
2067 |
$('#sek-saved-section-title').removeClass('error');
|
2068 |
|
2069 |
-
// Do some pre-processing before ajaxing
|
2070 |
-
// Note : ids will be replaced server side
|
2071 |
-
sectionModel = self.preProcessSection( sectionModel );
|
2072 |
-
if ( !_.isObject( sectionModel ) ) {
|
2073 |
-
api.errare('::saveOrUpdateSavedSection => error => invalid sectionModel');
|
2074 |
-
_dfd_.resolve( {success:false});
|
2075 |
-
}
|
2076 |
-
|
2077 |
wp.ajax.post( 'sek_save_user_section', {
|
2078 |
nonce: api.settings.nonce.save,
|
2079 |
-
section_data: JSON.stringify( sectionModel ),
|
2080 |
// the following will be saved in 'metas'
|
2081 |
section_title: section_title,
|
2082 |
section_description: section_description,
|
2083 |
section_post_name: sectionPostNameCandidateForUpdate || '',// <= provided when updating a section
|
2084 |
skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
|
|
|
2085 |
//active_locations : api.czr_sektions.activeLocations()
|
2086 |
})
|
2087 |
.done( function( response ) {
|
@@ -2299,7 +2324,9 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2299 |
self.sectionCollectionPromise.resolve( sec_collection );
|
2300 |
} else {
|
2301 |
self.sectionCollectionPromise.resolve( {} );
|
2302 |
-
|
|
|
|
|
2303 |
}
|
2304 |
|
2305 |
// response is {section_post_id: 436}
|
@@ -2309,7 +2336,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2309 |
// duration : 10000,
|
2310 |
// message : [
|
2311 |
// '<span style="font-size:0.95em">',
|
2312 |
-
// '<strong
|
2313 |
// '</span>'
|
2314 |
// ].join('')
|
2315 |
// });
|
@@ -2375,9 +2402,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2375 |
self.refreshTmplPickerHtml( tmpl_collection );
|
2376 |
});
|
2377 |
|
|
|
|
|
|
|
2378 |
self.tmplDialogMode = new api.Value('hidden');// 'save' default mode is set when dialog html is rendered
|
2379 |
self.tmplDialogMode.bind( function(mode){
|
2380 |
-
if ( !_.contains(['hidden', 'save', 'update', 'remove' ], mode ) ) {
|
2381 |
api.errare('::setupSaveTmplUI => unknown tmpl dialog mode', mode );
|
2382 |
mode = 'save';
|
2383 |
}
|
@@ -2395,7 +2425,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2395 |
|
2396 |
// make sure the remove dialog is hidden
|
2397 |
$tmplDialogWrapper.removeClass('sek-removal-confirmation-opened');
|
2398 |
-
|
2399 |
// execute actions depending on the selected mode
|
2400 |
switch( mode ) {
|
2401 |
case 'save' :
|
@@ -2405,13 +2435,27 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2405 |
break;
|
2406 |
case 'update' :
|
2407 |
case 'remove' :
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2411 |
|
2412 |
self.setSavedTmplCollection().done( function( tmpl_collection ) {
|
2413 |
// refresh tmpl picker in case the user updated without changing anything
|
2414 |
self.refreshTmplPickerHtml();
|
|
|
|
|
2415 |
});
|
2416 |
break;
|
2417 |
}//switch
|
@@ -2650,11 +2694,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2650 |
|
2651 |
wp.ajax.post( 'sek_save_user_template', {
|
2652 |
nonce: api.settings.nonce.save,
|
2653 |
-
tmpl_data: JSON.stringify( currentLocalSettingValue ),
|
2654 |
// the following will be saved in 'metas'
|
2655 |
tmpl_title: tmpl_title,
|
2656 |
tmpl_description: tmpl_description,
|
2657 |
tmpl_post_name: tmplPostNameCandidateForUpdate || '',// <= provided when updating a template
|
|
|
2658 |
skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
|
2659 |
tmpl_locations : self.getActiveLocationsForTmpl( currentLocalSettingValue ),
|
2660 |
tmpl_header_location : self.getHeaderOrFooterLocationIdForTmpl( 'header', currentLocalSettingValue ),
|
@@ -2893,23 +2938,13 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2893 |
.done( function( tmpl_collection ) {
|
2894 |
if ( _.isObject(tmpl_collection) && !_.isArray( tmpl_collection ) ) {
|
2895 |
self.templateCollectionPromise.resolve( tmpl_collection );
|
2896 |
-
console.log('GET SAVED TMPL COLLECTION', tmpl_collection );
|
2897 |
} else {
|
2898 |
self.templateCollectionPromise.resolve( {} );
|
2899 |
-
|
|
|
|
|
2900 |
}
|
2901 |
-
|
2902 |
-
// response is {tmpl_post_id: 436}
|
2903 |
-
//self.tmplDialogVisible( false );
|
2904 |
-
// api.previewer.trigger('sek-notify', {
|
2905 |
-
// type : 'success',
|
2906 |
-
// duration : 10000,
|
2907 |
-
// message : [
|
2908 |
-
// '<span style="font-size:0.95em">',
|
2909 |
-
// '<strong>@missi18n Your template has been saved.</strong>',
|
2910 |
-
// '</span>'
|
2911 |
-
// ].join('')
|
2912 |
-
// });
|
2913 |
})
|
2914 |
.fail( function( er ) {
|
2915 |
api.errorLog( 'ajax sek_get_all_saved_tmpl => error', er );
|
@@ -2926,7 +2961,49 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2926 |
});
|
2927 |
|
2928 |
return self.templateCollectionPromise;
|
2929 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2930 |
});//$.extend()
|
2931 |
})( wp.customize, jQuery );
|
2932 |
//global sektionsLocalizedData
|
@@ -2935,14 +3012,14 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2935 |
(function ( api, $ ) {
|
2936 |
$.extend( CZRSeksPrototype, {
|
2937 |
////////////////////////////////////////////////////////
|
2938 |
-
//
|
2939 |
////////////////////////////////////////////////////////
|
2940 |
// @return promise
|
2941 |
-
getTmplJsonFromUserTmpl : function(
|
2942 |
var self = this, _dfd_ = $.Deferred();
|
2943 |
wp.ajax.post( 'sek_get_user_tmpl_json', {
|
2944 |
nonce: api.settings.nonce.save,
|
2945 |
-
tmpl_post_name:
|
2946 |
//skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' )
|
2947 |
})
|
2948 |
.done( function( response ) {
|
@@ -2956,7 +3033,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2956 |
duration : 10000,
|
2957 |
message : [
|
2958 |
'<span style="font-size:0.95em">',
|
2959 |
-
'<strong
|
2960 |
'</span>'
|
2961 |
].join('')
|
2962 |
});
|
@@ -2965,72 +3042,55 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2965 |
return _dfd_;
|
2966 |
},
|
2967 |
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
}
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
'@missi18n the requested template is not available',
|
2993 |
-
'</strong>',
|
2994 |
-
'</span>'
|
2995 |
-
].join('')
|
2996 |
-
});
|
2997 |
-
_dfd_.resolve({success:false});
|
2998 |
-
return;
|
2999 |
-
}
|
3000 |
-
self.apiTmplGalleryJson = _json_data;
|
3001 |
-
_dfd_.resolve( {success:true, tmpl_json:self.apiTmplGalleryJson } );
|
3002 |
-
|
3003 |
-
})
|
3004 |
-
.fail(function( er ) {
|
3005 |
-
api.errare( '::get_gallery_tmpl_json_and_import failed => ', er );
|
3006 |
-
_dfd_.resolve({success:false});
|
3007 |
-
});
|
3008 |
-
}
|
3009 |
-
|
3010 |
-
return _dfd_.promise();
|
3011 |
},
|
3012 |
|
|
|
|
|
3013 |
|
3014 |
// April 2020 : added for https://github.com/presscustomizr/nimble-builder/issues/651
|
3015 |
// @param params {
|
3016 |
-
//
|
3017 |
-
//
|
3018 |
-
//
|
3019 |
// }
|
3020 |
-
|
3021 |
var self = this;
|
3022 |
params = $.extend( {
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
3026 |
}, params || {});
|
3027 |
-
var tmpl_name = params.
|
3028 |
if ( _.isEmpty( tmpl_name ) || ! _.isString( tmpl_name ) ) {
|
3029 |
-
api.errare('::
|
3030 |
}
|
3031 |
-
//console.log('
|
3032 |
var _promise;
|
3033 |
-
if ( '
|
3034 |
// doc : https://api.jquery.com/jQuery.getJSON/
|
3035 |
_promise = self.getTmplJsonFromApi(tmpl_name);
|
3036 |
} else {
|
@@ -3049,139 +3109,77 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3049 |
// }
|
3050 |
// }
|
3051 |
_promise.done( function( response ) {
|
3052 |
-
//console.log('
|
3053 |
if ( response.success ) {
|
3054 |
-
//console.log('
|
3055 |
-
self.
|
3056 |
-
|
3057 |
-
template_name : tmpl_name,
|
3058 |
template_data : response.tmpl_json,
|
3059 |
-
|
3060 |
});
|
3061 |
}
|
3062 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3063 |
},
|
3064 |
|
3065 |
-
//
|
3066 |
// => REMOTE API COLLECTION + USER COLLECTION
|
3067 |
// @param params
|
3068 |
// {
|
3069 |
-
//
|
3070 |
-
// template_name : tmpl_name,
|
3071 |
// template_data : response.tmpl_json,
|
3072 |
-
//
|
3073 |
// }
|
3074 |
-
|
3075 |
-
//console.log('
|
3076 |
var self = this;
|
3077 |
params = params || {};
|
3078 |
// normalize params
|
3079 |
params = $.extend({
|
3080 |
-
|
3081 |
-
pre_import_check : false,
|
3082 |
-
tmpl_import_mode : 'replace'
|
3083 |
}, params );
|
3084 |
|
3085 |
-
|
3086 |
-
|
3087 |
-
|
3088 |
-
|
3089 |
-
|
3090 |
-
// remote template import case
|
3091 |
if ( !params.template_data ) {
|
3092 |
-
throw new Error( '::
|
3093 |
}
|
3094 |
-
__request__ = wp.ajax.post( 'sek_process_template_json', {
|
3095 |
-
nonce: api.settings.nonce.save,
|
3096 |
-
template_data : JSON.stringify( params.template_data ),
|
3097 |
-
pre_import_check : false//<= might be used in the future do stuffs. For example when importing manually, this property is used to skip the img sniffing on the first pass.
|
3098 |
-
//sek_export_nonce : api.settings.nonce.save,
|
3099 |
-
//skope_id : 'local' === params.scope ? api.czr_skopeBase.getSkopeProperty( 'skope_id' ) : sektionsLocalizedData.globalSkopeId,
|
3100 |
-
//active_locations : api.czr_sektions.activeLocations()
|
3101 |
-
}).done( function( server_resp ) {
|
3102 |
-
//api.infoLog('TEMPLATE PRE PROCESS DONE', server_resp );
|
3103 |
-
}).fail( function( error_resp ) {
|
3104 |
-
api.previewer.trigger('sek-notify', {
|
3105 |
-
notif_id : 'import-failed',
|
3106 |
-
type : 'error',
|
3107 |
-
duration : 30000,
|
3108 |
-
message : [
|
3109 |
-
'<span>',
|
3110 |
-
'<strong>',
|
3111 |
-
[ sektionsLocalizedData.i18n['Export failed'], encodeURIComponent( error_resp ) ].join(' '),
|
3112 |
-
'</strong>',
|
3113 |
-
'</span>'
|
3114 |
-
].join('')
|
3115 |
-
});
|
3116 |
-
});
|
3117 |
-
|
3118 |
-
|
3119 |
|
3120 |
/////////////////////////////////////////////
|
3121 |
-
/// NOW THAT WE HAVE OUR PROMISE
|
3122 |
/// 1) CHECK IF CONTENT IS WELL FORMED AND ELIGIBLE FOR API
|
3123 |
/// 2) LET'S PROCESS THE SETTING ID'S
|
3124 |
-
/// 3) ATTEMPT TO UPDATE THE SETTING API, LOCAL OR GLOBAL. ( always local for template
|
3125 |
-
|
3126 |
// fire a previewer loader removed on .always()
|
3127 |
api.previewer.send( 'sek-maybe-print-loader', { fullPageLoader : true, duration : 30000 });
|
|
|
|
|
|
|
|
|
|
|
3128 |
|
3129 |
-
|
3130 |
-
//
|
3131 |
-
|
3132 |
-
|
3133 |
-
return;
|
3134 |
-
api.previewer.trigger('sek-notify', {
|
3135 |
-
notif_id : 'import-too-long',
|
3136 |
-
type : 'error',
|
3137 |
-
duration : 20000,
|
3138 |
-
message : [
|
3139 |
-
'<span>',
|
3140 |
-
'<strong>',
|
3141 |
-
sektionsLocalizedData.i18n['Import exceeds server response time, try to uncheck "import images" option.'],
|
3142 |
-
'</strong>',
|
3143 |
-
'</span>'
|
3144 |
-
].join('')
|
3145 |
-
});
|
3146 |
-
}, 30000 );
|
3147 |
-
|
3148 |
-
|
3149 |
-
// At this stage, we are not in a pre-check case
|
3150 |
-
// the ajax request is processed and will upload images if needed
|
3151 |
-
__request__
|
3152 |
-
.done( function( server_resp ) {
|
3153 |
-
// When manually importing a file, the server adds a "success" property
|
3154 |
-
// When loading a template this property is not sent. Let's normalize.
|
3155 |
-
if ( _.isObject(server_resp) ) {
|
3156 |
-
server_resp = {success:true, data:server_resp};
|
3157 |
-
}
|
3158 |
-
//console.log('SERVER RESP 2 ?', server_resp );
|
3159 |
-
if ( !api.czr_sektions.isImportedContentEligibleForAPI( server_resp, params ) ) {
|
3160 |
-
api.infoLog('::import_template problem => !api.czr_sektions.isImportedContentEligibleForAPI', server_resp, params );
|
3161 |
-
return;
|
3162 |
-
}
|
3163 |
-
|
3164 |
-
//console.log('MANUAL IMPORT DATA', server_resp );
|
3165 |
-
server_resp.data.data.collection = self.setIdsForImportedTmpl( server_resp.data.data.collection );
|
3166 |
-
// and try to update the api setting
|
3167 |
-
api.czr_sektions.doUpdateApiSettingAfter_TmplGalleryImport( server_resp, params );
|
3168 |
-
})
|
3169 |
-
.fail( function( response ) {
|
3170 |
-
api.errare( '::import_template => ajax error', response );
|
3171 |
-
api.previewer.trigger('sek-notify', {
|
3172 |
-
notif_id : 'import-failed',
|
3173 |
-
type : 'error',
|
3174 |
-
duration : 30000,
|
3175 |
-
message : [
|
3176 |
-
'<span>',
|
3177 |
-
'<strong>',
|
3178 |
-
sektionsLocalizedData.i18n['Import failed, file problem'],
|
3179 |
-
'</strong>',
|
3180 |
-
'</span>'
|
3181 |
-
].join('')
|
3182 |
-
});
|
3183 |
-
});
|
3184 |
-
},//import_tmpl_from_gallery
|
3185 |
|
3186 |
|
3187 |
// fired on ajaxrequest done
|
@@ -3189,36 +3187,34 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3189 |
// We can try to the update the api setting
|
3190 |
// @param params
|
3191 |
// {
|
3192 |
-
//
|
3193 |
-
// template_name : tmpl_name,
|
3194 |
// template_data : response.tmpl_json,
|
3195 |
-
//
|
3196 |
-
// is_file_import : false
|
3197 |
// }
|
3198 |
doUpdateApiSettingAfter_TmplGalleryImport : function( server_resp, params ){
|
3199 |
//console.log('doUpdateApiSettingAfter_TmplGalleryImport ???', params, server_resp );
|
3200 |
params = params || {};
|
3201 |
-
if ( !api.czr_sektions.isImportedContentEligibleForAPI( server_resp, params )
|
3202 |
api.previewer.send( 'sek-clean-loader', { cleanFullPageLoader : true });
|
3203 |
return;
|
3204 |
}
|
3205 |
|
3206 |
-
var _scope = 'local';// <= always local when template gallery
|
3207 |
|
3208 |
//api.infoLog('TODO => verify metas => version, active locations, etc ... ');
|
3209 |
|
3210 |
// Update the setting api via the normalized method
|
3211 |
// the scope will determine the setting id, local or global
|
3212 |
api.czr_sektions.updateAPISetting({
|
3213 |
-
action : 'sek-
|
3214 |
scope : _scope,//'global' or 'local'<= will determine which setting will be updated,
|
3215 |
// => self.getGlobalSectionsSettingId() or self.localSectionsSettingId()
|
3216 |
-
|
3217 |
-
|
3218 |
}).done( function() {
|
3219 |
// Clean an regenerate the local option setting
|
3220 |
// Settings are normally registered once and never cleaned, unlike controls.
|
3221 |
-
// After the
|
3222 |
// but the local options, persisted in separate settings, won't be updated if the settings are not cleaned
|
3223 |
if ( 'local' === _scope ) {
|
3224 |
api.czr_sektions.generateUI({
|
@@ -6694,8 +6690,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
6694 |
//-------------------------------------------------------------------------------------------------
|
6695 |
//-- INJECT TEMPLATE FROM GALLERY
|
6696 |
//-------------------------------------------------------------------------------------------------
|
6697 |
-
case 'sek-
|
6698 |
-
self.
|
6699 |
break;
|
6700 |
|
6701 |
//-------------------------------------------------------------------------------------------------
|
@@ -8487,42 +8483,42 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8487 |
}// if true === params.merge
|
8488 |
|
8489 |
self.updAPISetParams.newSetValue = params.imported_content.data;
|
8490 |
-
}
|
8491 |
-
|
8492 |
-
|
8493 |
-
|
8494 |
-
|
8495 |
-
|
8496 |
-
|
8497 |
-
|
8498 |
-
|
8499 |
-
|
8500 |
-
|
8501 |
-
|
8502 |
-
|
8503 |
//-------------------------------------------------------------------------------------------------
|
8504 |
-
//--
|
8505 |
//-------------------------------------------------------------------------------------------------
|
8506 |
// self.updAPISetParams.params : {
|
8507 |
-
// action: "sek-
|
8508 |
// assign_missing_locations: undefined
|
8509 |
// cloneId: ""
|
8510 |
-
//
|
8511 |
// is_global_location: false
|
8512 |
// scope: "local"
|
8513 |
-
//
|
8514 |
// }
|
8515 |
-
|
8516 |
var self = this,
|
8517 |
params;
|
8518 |
|
8519 |
params = self.updAPISetParams.params;
|
8520 |
|
8521 |
-
api.infoLog( 'sek-
|
8522 |
|
8523 |
-
// DO WE HAVE PROPER CONTENT DO
|
8524 |
-
if ( _.isUndefined( params.
|
8525 |
-
api.errare( 'updateAPISetting::sek-
|
8526 |
return;
|
8527 |
}
|
8528 |
|
@@ -8541,12 +8537,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8541 |
|
8542 |
// @return bool
|
8543 |
var _isTmplHeaderLocId = function( loc_id ) {
|
8544 |
-
return params.
|
8545 |
};
|
8546 |
|
8547 |
// @return bool
|
8548 |
var _isTmplFooterLocId = function( loc_id ) {
|
8549 |
-
return params.
|
8550 |
};
|
8551 |
|
8552 |
// The template has a header/footer if we find the header or the footer location
|
@@ -8570,8 +8566,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8570 |
return tmplLocalOptions && tmplLocalOptions.template && 'nimble_template' === tmplLocalOptions.template.local_template;
|
8571 |
};
|
8572 |
|
8573 |
-
var tmplCollection = _.isArray( params.
|
8574 |
-
tmplLocations = params.
|
8575 |
localLocations = [],
|
8576 |
currentSettingCollection = self.updAPISetParams.newSetValue.collection;
|
8577 |
|
@@ -8585,7 +8581,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8585 |
|
8586 |
// Imported Active Locations has to be an array not empty
|
8587 |
if ( !_.isArray(tmplLocations) || _.isEmpty(tmplLocations) ) {
|
8588 |
-
api.errare( 'updateAPISetting::sek-
|
8589 |
return;
|
8590 |
}
|
8591 |
|
@@ -8593,9 +8589,9 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8593 |
// Important :
|
8594 |
// - Local options is structured as an object : { local_header_footer: {…}, widths: {…}} }. But when not populated, it can be an array []. So make sure the type if set as object before merging it with current page local options
|
8595 |
// - Fonts is a collection described with an array
|
8596 |
-
var tmplLocalOptions = params.
|
8597 |
tmplLocalOptions = $.extend( true, {}, _.isObject( tmplLocalOptions ) ? tmplLocalOptions : {} );
|
8598 |
-
var tmplFonts = params.
|
8599 |
tmplFonts = _.isArray( tmplFonts ) ? $.extend( true, [], tmplFonts ) : [];
|
8600 |
|
8601 |
// Define variables uses for all cases
|
@@ -8628,7 +8624,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8628 |
// console.log('NEW SET VALUE COLLECTION? ', $.extend( true, [], newSetValueCollection ) );
|
8629 |
// If the current page already has NB sections, the user can chose 3 options : REPLACE, BEFORE, AFTER.
|
8630 |
// when the page has no NB sections, the default option is REPLACE
|
8631 |
-
switch( params.
|
8632 |
//-------------------------------------------------------------------------------------------------
|
8633 |
//-- REPLACE CASE ( default case )
|
8634 |
//-------------------------------------------------------------------------------------------------
|
@@ -8680,14 +8676,14 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8680 |
}
|
8681 |
// At this point, we need a target location id
|
8682 |
if ( '__not_set__' === targetLocationId ) {
|
8683 |
-
api.errare( 'updateAPISetting::sek-
|
8684 |
break;
|
8685 |
}
|
8686 |
|
8687 |
// Get the current target location model
|
8688 |
targetLocationModel = self.getLevelModel( targetLocationId, newSetValueCollection );
|
8689 |
if ( 'no_match' === targetLocationModel ) {
|
8690 |
-
api.errare('::
|
8691 |
break;
|
8692 |
}
|
8693 |
targetLocationModel = $.extend( true, {}, targetLocationModel );// <= create a deep copy
|
@@ -8705,7 +8701,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8705 |
if ( _isTmplHeaderLocId( loc_id ) || _isTmplFooterLocId( loc_id ) ) {
|
8706 |
tmplLocCandidate = self.getLevelModel( loc_id, tmplCollection );
|
8707 |
if ( 'no_match' === tmplLocCandidate ) {
|
8708 |
-
api.errare('::
|
8709 |
return;
|
8710 |
} else {
|
8711 |
newSetValueCollection.push( tmplLocCandidate );
|
@@ -8724,7 +8720,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8724 |
}
|
8725 |
localLocModel = self.getLevelModel( loc_id, currentSettingCollection );
|
8726 |
if ( 'no_match' === localLocModel ) {
|
8727 |
-
api.errare('::
|
8728 |
return;
|
8729 |
}
|
8730 |
// re-add header and footer if _hasTmplHeaderFooter()
|
@@ -8752,7 +8748,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8752 |
|
8753 |
locModel = self.getLevelModel( loc_id, newSetValueCollection );
|
8754 |
if ( 'no_match' === locModel ) {
|
8755 |
-
api.errare('::
|
8756 |
return;
|
8757 |
}
|
8758 |
if ( !self.isHeaderLocation( loc_id ) && !self.isFooterLocation( loc_id ) ) {
|
@@ -8765,7 +8761,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8765 |
|
8766 |
// At this point, we need a target location id
|
8767 |
if ( '__not_set__' === targetLocationId ) {
|
8768 |
-
api.errare( 'updateAPISetting::sek-
|
8769 |
break;
|
8770 |
}
|
8771 |
|
@@ -8784,7 +8780,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8784 |
newSetValueCollection.push( targetLocationModel );
|
8785 |
} else {
|
8786 |
if ( 'no_match' === locModel ) {
|
8787 |
-
api.errare('::
|
8788 |
return;
|
8789 |
}
|
8790 |
newSetValueCollection.push( self.getLevelModel( loc_id, currentSettingCollection ) );
|
@@ -8806,7 +8802,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8806 |
|
8807 |
locModel = self.getLevelModel( loc_id, newSetValueCollection );
|
8808 |
if ( 'no_match' === locModel ) {
|
8809 |
-
api.errare('::
|
8810 |
return;
|
8811 |
}
|
8812 |
if ( !self.isHeaderLocation( loc_id ) && !self.isFooterLocation( loc_id ) ) {
|
@@ -8819,7 +8815,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8819 |
|
8820 |
// At this point, we need a target location id
|
8821 |
if ( '__not_set__' === targetLocationId ) {
|
8822 |
-
api.errare( 'updateAPISetting::sek-
|
8823 |
break;
|
8824 |
}
|
8825 |
|
@@ -8839,7 +8835,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8839 |
} else {
|
8840 |
locModel = self.getLevelModel( loc_id, currentSettingCollection );
|
8841 |
if ( 'no_match' === locModel ) {
|
8842 |
-
api.errare('::
|
8843 |
return;
|
8844 |
}
|
8845 |
newSetValueCollection.push( locModel );
|
@@ -8860,12 +8856,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8860 |
// insert 'before' or 'after' => existing local options are preserved
|
8861 |
//
|
8862 |
// Scenario :
|
8863 |
-
// 1) user has created NB sections on a single post and wants to insert a NB template before the existing sections ( 'before'
|
8864 |
// => in this case, we need to keep the default theme template, local options must be the existing ones => no extension of local options.
|
8865 |
//
|
8866 |
// 2) the current page has no NB sections yet, import mode is 'replace' by default
|
8867 |
// => it means that if the imported template uses NB template as canvas, it must be set in local options => extension of local options
|
8868 |
-
if ( !_.isEmpty( tmplLocalOptions ) && 'replace' === params.
|
8869 |
var currentLocalOptions = self.updAPISetParams.newSetValue.local_options;
|
8870 |
currentLocalOptions = $.extend( true, {}, _.isObject( currentLocalOptions ) ? currentLocalOptions : {} );
|
8871 |
self.updAPISetParams.newSetValue.local_options = _.extend( currentLocalOptions, tmplLocalOptions );
|
@@ -8874,7 +8870,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8874 |
// FONTS
|
8875 |
// If there are imported fonts, we need to merge when import mode is not 'replace', otherwise we need to copy the imported font collection in .fonts property of the API setting.
|
8876 |
if ( _.isArray( tmplFonts ) && !_.isEmpty( tmplFonts ) ) {
|
8877 |
-
if ( 'replace' != params.
|
8878 |
var currentFonts = self.updAPISetParams.newSetValue.fonts;
|
8879 |
currentFonts = $.extend( true, [], _.isArray( currentFonts ) ? currentFonts : [] );
|
8880 |
// merge two collection of fonts without duplicates
|
@@ -8885,7 +8881,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8885 |
}
|
8886 |
|
8887 |
//api.infoLog('SETTING VALUE AFTER ?', self.updAPISetParams.newSetValue );
|
8888 |
-
}//
|
8889 |
|
8890 |
});//$.extend()
|
8891 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
@@ -11958,9 +11954,10 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
11958 |
self.levelTreeExpanded(false);
|
11959 |
self.tmplImportDialogVisible(false);
|
11960 |
$('#customize-preview iframe').css('z-index', 1);
|
11961 |
-
self.renderOrRefreshTempGallery();
|
11962 |
} else {
|
11963 |
$('#customize-preview iframe').css('z-index', '');
|
|
|
11964 |
}
|
11965 |
});
|
11966 |
|
@@ -11998,9 +11995,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
11998 |
},
|
11999 |
|
12000 |
// print and schedule dom events
|
12001 |
-
renderOrRefreshTempGallery : function() {
|
|
|
12002 |
var self = this,
|
12003 |
-
_tmpl
|
|
|
12004 |
if( $('#nimble-tmpl-gallery').length < 1 ) {
|
12005 |
$.when( self.renderTmplGalleryUI({}) ).done( function() {
|
12006 |
self.setupTmplGalleryDOMEvents();
|
@@ -12008,116 +12007,34 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
12008 |
}
|
12009 |
|
12010 |
// Clean previous html
|
12011 |
-
|
12012 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12013 |
// Wait for the gallery to be fetched and rendered
|
12014 |
-
|
12015 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12016 |
});
|
12017 |
},
|
12018 |
|
12019 |
-
|
12020 |
-
// @return void()
|
12021 |
-
setupTmplGalleryDOMEvents : function() {
|
12022 |
-
var $galWrapper = $('#nimble-tmpl-gallery');
|
12023 |
-
var self = this;
|
12024 |
-
$galWrapper
|
12025 |
-
// Schedule click event with delegation
|
12026 |
-
// PICK A TEMPLATE
|
12027 |
-
.on('click', '.sek-tmpl-item .use-tmpl', function( evt ) {
|
12028 |
-
evt.preventDefault();
|
12029 |
-
evt.stopPropagation();
|
12030 |
-
var tmpl_id = $(this).closest('.sek-tmpl-item').data('sek-tmpl-item-id');
|
12031 |
-
if ( _.isEmpty(tmpl_id) ) {
|
12032 |
-
api.errare('::setupTmplGalleryDOMEvents => error => invalid template id');
|
12033 |
-
return;
|
12034 |
-
}
|
12035 |
-
|
12036 |
-
// if current page has NB sections, display an import dialog, otherwise import now
|
12037 |
-
if ( self.hasCurrentPageNBSectionsNotHeaderFooter() ) {
|
12038 |
-
self._tmplNameWhileImportDialog = tmpl_id;
|
12039 |
-
self.tmplImportDialogVisible(true);
|
12040 |
-
} else {
|
12041 |
-
//api.czr_sektions.get_gallery_tmpl_json_and_import( $(this).data('sek-tmpl-item-id') );
|
12042 |
-
//api.czr_sektions.get_gallery_tmpl_json_and_import( {template_name : 'test_one', from: 'nimble_api'});// FOR TEST PURPOSES UNTIL THE COLLECTION IS SETUP
|
12043 |
-
api.czr_sektions.get_gallery_tmpl_json_and_import( {template_name : tmpl_id, from: 'user'});
|
12044 |
-
self.templateGalleryExpanded(false);
|
12045 |
-
}
|
12046 |
-
})
|
12047 |
-
// PICK AN IMPORT MODE WHEN PAGE HAS SECTIONS ALREADY
|
12048 |
-
.on('click', '.sek-tmpl-gal-import-dialog .sek-ui-button', function( evt ) {
|
12049 |
-
evt.preventDefault();
|
12050 |
-
evt.stopPropagation();
|
12051 |
-
// 3 possible import modes : replace, before, after
|
12052 |
-
var tmpl_import_mode = $(this).data('sek-tmpl-import-mode');
|
12053 |
-
if ( !_.contains(['replace', 'before', 'after'], tmpl_import_mode ) ) {
|
12054 |
-
api.errare('::setupTmplGalleryDOMEvents => error => invalid import mode');
|
12055 |
-
return;
|
12056 |
-
}
|
12057 |
-
api.czr_sektions.get_gallery_tmpl_json_and_import({
|
12058 |
-
template_name : self._tmplNameWhileImportDialog,
|
12059 |
-
from: 'user',
|
12060 |
-
tmpl_import_mode: tmpl_import_mode
|
12061 |
-
});
|
12062 |
-
// api.czr_sektions.get_gallery_tmpl_json_and_import({
|
12063 |
-
// template_name : 'test_one',
|
12064 |
-
// from: 'nimble_api',
|
12065 |
-
// tmpl_import_mode: tmpl_import_mode
|
12066 |
-
// });
|
12067 |
-
self.templateGalleryExpanded(false);
|
12068 |
-
})
|
12069 |
-
// SEARCH ACTIONS
|
12070 |
-
.on('propertychange change click keyup input paste', '.sek-filter-tmpl', _.debounce( function(evt) {
|
12071 |
-
evt.preventDefault();
|
12072 |
-
var _s = $(this).val();
|
12073 |
-
//console.log('searched string ??', _s );
|
12074 |
-
var _reset = function() {
|
12075 |
-
$galWrapper.removeClass('search-active');
|
12076 |
-
$galWrapper.find('.sek-tmpl-item').each( function() {
|
12077 |
-
$(this).removeClass('search-match');
|
12078 |
-
});
|
12079 |
-
};
|
12080 |
-
if ( !_.isString(_s) ) {
|
12081 |
-
_reset();
|
12082 |
-
return;
|
12083 |
-
}
|
12084 |
-
_s = _s.trim().toLowerCase();
|
12085 |
-
if ( _.isEmpty( _s.replace(/\s/g, '') ) ) {
|
12086 |
-
_reset();
|
12087 |
-
} else {
|
12088 |
-
$galWrapper.addClass('search-active');
|
12089 |
-
var title,desc,date,titleMatch, descMatch,dateMatch;
|
12090 |
-
$galWrapper.find('.sek-tmpl-item').each( function() {
|
12091 |
-
title = ( $(this).find('.tmpl-title').html() + '' ).toLowerCase();
|
12092 |
-
desc = ( $(this).find('.tmpl-desc').html() + '' ).toLowerCase();
|
12093 |
-
date = ( $(this).find('.tmpl-date').html() + '' ).toLowerCase();
|
12094 |
-
titleMatch = -1 != title.indexOf(_s);
|
12095 |
-
descMatch = -1 != desc.indexOf(_s);
|
12096 |
-
dateMatch = -1 != date.indexOf(_s);
|
12097 |
-
$(this).toggleClass( 'search-match', titleMatch || descMatch || dateMatch );
|
12098 |
-
});
|
12099 |
-
}
|
12100 |
-
|
12101 |
-
}, 100 ) )
|
12102 |
-
// REMOVE
|
12103 |
-
.on( 'click', '.sek-tmpl-info .remove-tmpl', function(evt) {
|
12104 |
-
evt.preventDefault();
|
12105 |
-
var _focusOnRemoveCandidate = function( mode ) {
|
12106 |
-
self.tmplDialogMode( 'remove' );
|
12107 |
-
// self unbind
|
12108 |
-
self.tmplDialogMode.unbind( _focusOnRemoveCandidate );
|
12109 |
-
};
|
12110 |
-
self.tmplDialogMode.bind( _focusOnRemoveCandidate );
|
12111 |
-
self.tmplDialogVisible(true);
|
12112 |
-
})
|
12113 |
-
.on( 'click', '.sek-close-dialog', function(evt) {
|
12114 |
-
evt.preventDefault();
|
12115 |
-
self.templateGalleryExpanded( false );
|
12116 |
-
});
|
12117 |
-
},
|
12118 |
-
|
12119 |
// @return html
|
12120 |
-
getTemplateGalleryHtml : function() {
|
12121 |
var self = this,
|
12122 |
_html = '';
|
12123 |
// var _templates = {
|
@@ -12128,39 +12045,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
12128 |
// temp_two : {
|
12129 |
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12130 |
// preview_url : ''
|
12131 |
-
// },
|
12132 |
-
// temp_three : {
|
12133 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12134 |
-
// preview_url : ''
|
12135 |
-
// },
|
12136 |
-
// temp_four : {
|
12137 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12138 |
-
// preview_url : ''
|
12139 |
-
// },
|
12140 |
-
// temp_fsour : {
|
12141 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12142 |
-
// preview_url : ''
|
12143 |
-
// },
|
12144 |
-
// temp_fosur : {
|
12145 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12146 |
-
// preview_url : ''
|
12147 |
-
// },
|
12148 |
-
// temp_five : {
|
12149 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12150 |
-
// preview_url : ''
|
12151 |
-
// },
|
12152 |
-
// temp_six : {
|
12153 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12154 |
-
// preview_url : ''
|
12155 |
-
// },
|
12156 |
-
// temp_seven : {
|
12157 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12158 |
-
// preview_url : ''
|
12159 |
-
// },
|
12160 |
-
// temp_height : {
|
12161 |
-
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12162 |
-
// preview_url : ''
|
12163 |
-
// }
|
12164 |
// };
|
12165 |
|
12166 |
// _.each( _templates, function( _data, _temp_id ) {
|
@@ -12169,46 +12053,204 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
12169 |
// _html += '<div class="sek-tmpl-thumb"><img src="'+ _data.thumb_url +'"/></div>';
|
12170 |
// _html += '</div>';
|
12171 |
// });
|
12172 |
-
var
|
12173 |
_dfd_ = $.Deferred(),
|
12174 |
-
_titleAttr
|
|
|
|
|
12175 |
|
12176 |
-
|
12177 |
-
_.each( tmpl_collection, function( _data, _temp_id ) {
|
12178 |
-
if( !_.isEmpty( _data.description ) ) {
|
12179 |
-
_titleAttr = [ _data.title, _data.last_modified_date, _data.description ].join(' | ');
|
12180 |
-
} else {
|
12181 |
-
_titleAttr = [ _data.title, _data.last_modified_date ].join(' | ');
|
12182 |
-
}
|
12183 |
|
12184 |
-
|
12185 |
-
|
12186 |
-
|
12187 |
-
|
12188 |
-
_html += '<p class="tmpl-date"><i>' + [ sektionsLocalizedData.i18n['Last modified'], ' : ', _data.last_modified_date ].join(' ') + '</i></p>';
|
12189 |
-
_html += '<p class="tmpl-desc">' + _data.description + '</p>';
|
12190 |
-
_html += '<i class="material-icons use-tmpl" title="'+ sektionsLocalizedData.i18n['Use this template'] +'">add_circle_outline</i>';
|
12191 |
-
_html += '<i class="material-icons remove-tmpl" title="'+ sektionsLocalizedData.i18n['Remove this template'] +'">delete_forever</i>';
|
12192 |
-
_html += '</div>';
|
12193 |
-
_html += '</div>';
|
12194 |
-
});
|
12195 |
|
12196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12197 |
if ( $cssLoader.length > 0 ) {
|
12198 |
$cssLoader.hide({
|
12199 |
-
duration :
|
12200 |
complete : function() {
|
12201 |
-
|
12202 |
_dfd_.resolve( _html );
|
12203 |
}
|
12204 |
});
|
12205 |
} else {
|
12206 |
_dfd_.resolve( _html );
|
12207 |
}
|
12208 |
-
}
|
12209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12210 |
return _dfd_.promise();
|
12211 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12212 |
});//$.extend()
|
12213 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
12214 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
@@ -12280,7 +12322,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
12280 |
input.container.find('[data-sek-content-type]').attr( 'aria-pressed', false );
|
12281 |
|
12282 |
// close other dialog
|
12283 |
-
nbApiInstance.templateGalleryExpanded(false);
|
12284 |
nbApiInstance.levelTreeExpanded(false);
|
12285 |
if ( nbApiInstance.tmplDialogVisible ) {
|
12286 |
nbApiInstance.tmplDialogVisible(false);
|
@@ -12306,6 +12348,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
12306 |
}
|
12307 |
});
|
12308 |
|
|
|
|
|
|
|
|
|
|
|
12309 |
// initialize with module or section picker depending on the scenario :
|
12310 |
// 1) new section created => section picker
|
12311 |
// 2) all other cases => module picker
|
@@ -15663,10 +15710,10 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
15663 |
var _refreshUserSectionView = function( sec_collection ) {
|
15664 |
// clean
|
15665 |
$wrapper.find('.sek-user-section-wrapper').remove();
|
15666 |
-
|
15667 |
// Write
|
15668 |
if ( _.isEmpty( sec_collection ) ) {
|
15669 |
-
var _placeholdImgUrl = [ sektionsLocalizedData.baseUrl , '/assets/admin/img/save_section_notice.png', '?ver=' , sektionsLocalizedData.nimbleVersion ].join('')
|
15670 |
doc_url = 'https://docs.presscustomizr.com/article/417-how-to-save-and-reuse-sections-with-nimble-builder';
|
15671 |
html = [
|
15672 |
'<div class="sek-user-section-wrapper">',
|
@@ -15675,7 +15722,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
15675 |
'</div>'
|
15676 |
].join('');
|
15677 |
$wrapper.append( html );
|
15678 |
-
input.module.container.find('.czr-item-content .customize-control-title').html('You did not save any section yet.');
|
15679 |
} else {
|
15680 |
var _thumbUrl = [ sektionsLocalizedData.baseUrl , '/assets/admin/img/nb_sec_pholder.png', '?ver=' , sektionsLocalizedData.nimbleVersion ].join(''),
|
15681 |
styleAttr = 'background: url(' + _thumbUrl + ') 50% 50% / cover no-repeat;';
|
@@ -15697,10 +15744,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
15697 |
'<h3 class="sec-title">' + secData.title + '</h3>',
|
15698 |
'<p class="sec-date"><i>' + [ sektionsLocalizedData.i18n['Last modified'], ' : ', secData.last_modified_date ].join(' ') + '</i></p>',
|
15699 |
'<p class="sec-desc">' + secData.description + '</p>',
|
|
|
15700 |
'<i class="material-icons remove-user-sec" title="'+ sektionsLocalizedData.i18n['Remove this template'] +'">delete_forever</i>',
|
15701 |
//'<div class="sek-overlay"></div>',
|
15702 |
//'<div class="sek-saved-section-description">' + secData.description + '</div>',
|
15703 |
-
//! _.isEmpty( creation_date ) ? ( '<div class="sek-saved-section-date"><i class="far fa-calendar-alt"></i>
|
15704 |
'</div>',
|
15705 |
'</div>',
|
15706 |
'</div>'
|
@@ -15708,12 +15756,16 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
15708 |
$wrapper.append( html );
|
15709 |
});//_.each
|
15710 |
}
|
|
|
|
|
15711 |
|
15712 |
// Make section draggable now
|
15713 |
api.czr_sektions.trigger( 'sek-refresh-dragzones', { type : 'preset_section', input_container : input.container } );
|
15714 |
};//_refreshUserSectionView
|
15715 |
|
15716 |
// on input instantiation, render the collection
|
|
|
|
|
15717 |
input.getUserSavedSections().done( function( sec_collection ) {
|
15718 |
_refreshUserSectionView( sec_collection );
|
15719 |
});
|
@@ -15727,17 +15779,36 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
15727 |
// with delegation
|
15728 |
attachDomEvents : function() {
|
15729 |
// Attach events
|
15730 |
-
this.container
|
15731 |
-
|
15732 |
-
|
15733 |
-
|
15734 |
-
self.
|
15735 |
-
//
|
15736 |
-
self.saveSectionDialogMode
|
15737 |
-
|
15738 |
-
|
15739 |
-
|
15740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15741 |
}
|
15742 |
});//module.inputConstructor
|
15743 |
|
@@ -20066,7 +20137,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
20066 |
return _itm.id === item.id;
|
20067 |
});
|
20068 |
_index = _.isUndefined( _index ) ? index : _index + 1;
|
20069 |
-
//_title = [ '@missi18n Slide', _index ].join( ' ' );
|
20070 |
}
|
20071 |
|
20072 |
//if the slide title is set, use it
|
@@ -20614,7 +20684,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
20614 |
return _itm.id === item.id;
|
20615 |
});
|
20616 |
_index = _.isUndefined( _index ) ? index : _index + 1;
|
20617 |
-
//_title = [ '@missi18n Slide', _index ].join( ' ' );
|
20618 |
}
|
20619 |
|
20620 |
//if the slide title is set, use it
|
1777 |
|
1778 |
self.saveSectionDialogMode = new api.Value('hidden');// 'save' default mode is set when dialog html is rendered
|
1779 |
self.saveSectionDialogMode.bind( function(mode){
|
1780 |
+
if ( !_.contains(['hidden', 'save', 'update', 'remove', 'edit' ], mode ) ) {
|
1781 |
api.errare('error setupSaveSectionUI => unknown section dialog mode', mode );
|
1782 |
mode = 'save';
|
1783 |
}
|
1795 |
|
1796 |
// make sure the remove dialog is hidden
|
1797 |
$secSaveDialogWrap.removeClass('sek-removal-confirmation-opened');
|
1798 |
+
var $selectEl;
|
1799 |
// execute actions depending on the selected mode
|
1800 |
switch( mode ) {
|
1801 |
case 'save' :
|
1804 |
$descInput.val('');
|
1805 |
break;
|
1806 |
case 'update' :
|
1807 |
+
case 'edit' :
|
1808 |
+
$selectEl = $secSaveDialogWrap.find('.sek-saved-section-picker');
|
1809 |
+
// Make sure the select value is always reset when switching mode
|
1810 |
+
$selectEl.val('none').trigger('change');
|
1811 |
+
|
1812 |
+
self.setSavedSectionCollection().done( function( sec_collection ) {
|
1813 |
+
// refresh section picker in case the user updated without changing anything
|
1814 |
+
self.refreshSectionPickerHtml();
|
1815 |
+
$selectEl.val( self.userSectionToEdit || 'none' ).trigger('change');
|
1816 |
+
self.userSectionToEdit = null;
|
1817 |
+
});
|
1818 |
+
break;
|
1819 |
case 'remove' :
|
1820 |
+
console.log('sOOO ?', self.userSectionToRemove );
|
1821 |
+
$selectEl = $secSaveDialogWrap.find('.sek-saved-section-picker');
|
1822 |
+
// Make sure the select value is always reset when switching mode
|
1823 |
+
$selectEl.val('none').trigger('change');
|
1824 |
|
1825 |
self.setSavedSectionCollection().done( function( sec_collection ) {
|
1826 |
// refresh section picker in case the user updated without changing anything
|
1827 |
self.refreshSectionPickerHtml();
|
1828 |
+
$selectEl.val( self.userSectionToRemove || 'none' ).trigger('change');
|
1829 |
+
self.userSectionToRemove = null;
|
1830 |
});
|
1831 |
break;
|
1832 |
}//switch
|
1919 |
|
1920 |
// ATTACH DOM EVENTS
|
1921 |
// Dialog Mode Switcher
|
1922 |
+
$secSaveDialogWrap
|
1923 |
+
.on( 'click', '[data-section-mode-switcher]', function(evt) {
|
1924 |
+
evt.preventDefault();
|
1925 |
+
self.saveSectionDialogMode($(this).data('section-mode-switcher'));
|
1926 |
+
})
|
1927 |
|
1928 |
+
// React to section select
|
1929 |
+
// update title and description fields on section selection
|
1930 |
+
.on( 'change', '.sek-saved-section-picker', function(evt){ self.reactOnSectionSelection(evt, $(this) ); })
|
1931 |
+
|
1932 |
+
// SAVE
|
1933 |
+
.on( 'click', '.sek-do-save-section', function(evt){
|
1934 |
+
$secSaveDialogWrap.addClass('nimble-section-processing-ajax');
|
1935 |
+
self.saveOrUpdateSavedSection(evt).done( function( response ) {
|
1936 |
+
$secSaveDialogWrap.removeClass('nimble-section-processing-ajax');
|
1937 |
+
if ( response.success ) {
|
1938 |
+
self.saveSectionDialogVisible( false );
|
1939 |
+
self.setSavedSectionCollection( { refresh : true } );// <= true for refresh
|
1940 |
+
}
|
1941 |
+
});
|
1942 |
+
})
|
1943 |
|
1944 |
+
// UPDATE
|
1945 |
+
.on( 'click', '.sek-do-update-section', function(evt){
|
1946 |
+
var $selectEl = $secSaveDialogWrap.find('.sek-saved-section-picker'),
|
1947 |
+
sectionPostNameCandidateForUpdate = $selectEl.val();
|
1948 |
+
// make sure we don't try to remove the default option
|
1949 |
+
if ( 'none' === sectionPostNameCandidateForUpdate || _.isEmpty(sectionPostNameCandidateForUpdate) )
|
1950 |
+
return;
|
|
|
|
|
|
|
|
|
1951 |
|
1952 |
+
$secSaveDialogWrap.addClass('nimble-section-processing-ajax');
|
1953 |
+
self.saveOrUpdateSavedSection(evt, sectionPostNameCandidateForUpdate).done( function(response) {
|
1954 |
+
$secSaveDialogWrap.removeClass('nimble-section-processing-ajax');
|
1955 |
+
if ( response.success ) {
|
1956 |
+
self.saveSectionDialogVisible( false );
|
1957 |
+
self.setSavedSectionCollection( { refresh : true } )// <= true for refresh
|
1958 |
+
.done( function( sec_collection ) {
|
1959 |
+
// refresh section picker in case the user updated without changing anything
|
1960 |
+
self.refreshSectionPickerHtml();
|
1961 |
+
});
|
1962 |
+
}
|
1963 |
+
});
|
1964 |
+
})
|
1965 |
|
1966 |
+
// REMOVE
|
1967 |
+
// Reveal remove dialog
|
1968 |
+
.on( 'click', '.sek-open-remove-confirmation', function(evt){
|
1969 |
+
$secSaveDialogWrap.addClass('sek-removal-confirmation-opened');
|
1970 |
+
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1971 |
|
1972 |
+
// Do Remove
|
1973 |
+
.on( 'click', '.sek-do-remove-section', function(evt){
|
1974 |
+
var $selectEl = $secSaveDialogWrap.find('.sek-saved-section-picker'),
|
1975 |
+
sectionPostNameCandidateForRemoval = $selectEl.val();
|
1976 |
+
// make sure we don't try to remove the default option
|
1977 |
+
if ( 'none' === sectionPostNameCandidateForRemoval || _.isEmpty(sectionPostNameCandidateForRemoval) )
|
1978 |
+
return;
|
1979 |
|
1980 |
+
$secSaveDialogWrap.addClass('nimble-section-processing-ajax');
|
1981 |
+
self.removeSavedSection(evt, sectionPostNameCandidateForRemoval).done( function(response) {
|
1982 |
+
$secSaveDialogWrap.removeClass('nimble-section-processing-ajax');
|
1983 |
+
$secSaveDialogWrap.removeClass('sek-removal-confirmation-opened');
|
1984 |
+
if ( response.success ) {
|
1985 |
+
self.setSavedSectionCollection( { refresh : true } );// <= true for refresh
|
1986 |
+
}
|
1987 |
+
});
|
1988 |
+
})
|
1989 |
|
1990 |
+
// Cancel Remove
|
1991 |
+
.on( 'click', '.sek-cancel-remove-section', function(evt){
|
|
|
1992 |
$secSaveDialogWrap.removeClass('sek-removal-confirmation-opened');
|
|
|
|
|
|
|
1993 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
1994 |
|
1995 |
|
1996 |
// Switch to update mode
|
2047 |
// Fired on 'click' on .sek-do-save-section btn
|
2048 |
// @param sectionPostNameCandidateForUpdate is only provided when saving
|
2049 |
saveOrUpdateSavedSection : function(evt, sectionPostNameCandidateForUpdate ) {
|
2050 |
+
var self = this,
|
2051 |
+
_dfd_ = $.Deferred(),
|
2052 |
+
_isEditSectionMode = 'edit' === self.saveSectionDialogMode();
|
2053 |
+
|
2054 |
// idOfSectionToSave is set when reacting to click action
|
2055 |
// @see react to preview 'sek-toggle-save-section-ui'
|
2056 |
+
if ( !_isEditSectionMode ) {
|
2057 |
+
if ( !self.idOfSectionToSave || _.isEmpty( self.idOfSectionToSave ) ) {
|
2058 |
+
api.errare('saveOrUpdateSavedSection => error => missing section id');
|
2059 |
+
return _dfd_.resolve( {success:false});
|
2060 |
+
}
|
2061 |
}
|
2062 |
evt.preventDefault();
|
2063 |
var $_title = $('#sek-saved-section-title'),
|
2064 |
section_title = $_title.val(),
|
2065 |
section_description = $('#sek-saved-section-description').val(),
|
2066 |
+
sectionModel;
|
2067 |
+
|
2068 |
+
// Only get the section model when not in edit section mode
|
2069 |
+
if ( !_isEditSectionMode ) {
|
2070 |
+
sectionModel = $.extend( true, {}, self.getLevelModel( self.idOfSectionToSave ) );
|
2071 |
+
if ( 'no_match' == sectionModel ) {
|
2072 |
+
api.errare('saveOrUpdateSavedSection => error => no section model with id ' + self.idOfSectionToSave );
|
2073 |
+
return _dfd_.resolve( {success:false});
|
2074 |
+
}
|
2075 |
+
// Do some pre-processing before ajaxing
|
2076 |
+
// Note : ids will be replaced server side
|
2077 |
+
sectionModel = self.preProcessSection( sectionModel );
|
2078 |
+
if ( !_.isObject( sectionModel ) ) {
|
2079 |
+
api.errare('::saveOrUpdateSavedSection => error => invalid sectionModel');
|
2080 |
+
return _dfd_.resolve( {success:false});
|
2081 |
+
}
|
2082 |
}
|
2083 |
|
2084 |
if ( _.isEmpty( section_title ) ) {
|
2098 |
|
2099 |
$('#sek-saved-section-title').removeClass('error');
|
2100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2101 |
wp.ajax.post( 'sek_save_user_section', {
|
2102 |
nonce: api.settings.nonce.save,
|
2103 |
+
section_data: _isEditSectionMode ? '' : JSON.stringify( sectionModel ),
|
2104 |
// the following will be saved in 'metas'
|
2105 |
section_title: section_title,
|
2106 |
section_description: section_description,
|
2107 |
section_post_name: sectionPostNameCandidateForUpdate || '',// <= provided when updating a section
|
2108 |
skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
|
2109 |
+
edit_metas_only: _isEditSectionMode ? 'yes' : 'no'//<= in this case we only update title and description. Not the template content
|
2110 |
//active_locations : api.czr_sektions.activeLocations()
|
2111 |
})
|
2112 |
.done( function( response ) {
|
2324 |
self.sectionCollectionPromise.resolve( sec_collection );
|
2325 |
} else {
|
2326 |
self.sectionCollectionPromise.resolve( {} );
|
2327 |
+
if ( !_.isEmpty( sec_collection ) ) {
|
2328 |
+
api.errorLog('control::getSavedSectionCollection => collection is empty or invalid');
|
2329 |
+
}
|
2330 |
}
|
2331 |
|
2332 |
// response is {section_post_id: 436}
|
2336 |
// duration : 10000,
|
2337 |
// message : [
|
2338 |
// '<span style="font-size:0.95em">',
|
2339 |
+
// '<strong>Your section has been saved.</strong>',
|
2340 |
// '</span>'
|
2341 |
// ].join('')
|
2342 |
// });
|
2402 |
self.refreshTmplPickerHtml( tmpl_collection );
|
2403 |
});
|
2404 |
|
2405 |
+
// Will store the collection of saved templates
|
2406 |
+
self.allApiTemplates = new api.Value('_not_populated_');
|
2407 |
+
|
2408 |
self.tmplDialogMode = new api.Value('hidden');// 'save' default mode is set when dialog html is rendered
|
2409 |
self.tmplDialogMode.bind( function(mode){
|
2410 |
+
if ( !_.contains(['hidden', 'save', 'update', 'remove', 'edit' ], mode ) ) {
|
2411 |
api.errare('::setupSaveTmplUI => unknown tmpl dialog mode', mode );
|
2412 |
mode = 'save';
|
2413 |
}
|
2425 |
|
2426 |
// make sure the remove dialog is hidden
|
2427 |
$tmplDialogWrapper.removeClass('sek-removal-confirmation-opened');
|
2428 |
+
var $selectEl;
|
2429 |
// execute actions depending on the selected mode
|
2430 |
switch( mode ) {
|
2431 |
case 'save' :
|
2435 |
break;
|
2436 |
case 'update' :
|
2437 |
case 'remove' :
|
2438 |
+
$selectEl = $tmplDialogWrapper.find('.sek-saved-tmpl-picker');
|
2439 |
+
// Make sure the select value is always reset when switching mode
|
2440 |
+
$selectEl.val('none').trigger('change');
|
2441 |
+
|
2442 |
+
self.setSavedTmplCollection().done( function( tmpl_collection ) {
|
2443 |
+
// refresh tmpl picker in case the user updated without changing anything
|
2444 |
+
self.refreshTmplPickerHtml();
|
2445 |
+
$selectEl.val( self.tmplToRemove || 'none' ).trigger('change');
|
2446 |
+
self.tmplToRemove = null;
|
2447 |
+
});
|
2448 |
+
break;
|
2449 |
+
case 'edit' :
|
2450 |
+
$selectEl = $tmplDialogWrapper.find('.sek-saved-tmpl-picker');
|
2451 |
+
// Make sure the select value is always reset when switching mode
|
2452 |
+
$selectEl.val('none').trigger('change');
|
2453 |
|
2454 |
self.setSavedTmplCollection().done( function( tmpl_collection ) {
|
2455 |
// refresh tmpl picker in case the user updated without changing anything
|
2456 |
self.refreshTmplPickerHtml();
|
2457 |
+
$selectEl.val( self.tmplToEdit || 'none' ).trigger('change');
|
2458 |
+
self.tmplToEdit = null;
|
2459 |
});
|
2460 |
break;
|
2461 |
}//switch
|
2694 |
|
2695 |
wp.ajax.post( 'sek_save_user_template', {
|
2696 |
nonce: api.settings.nonce.save,
|
2697 |
+
tmpl_data: 'edit' === self.tmplDialogMode() ? '' : JSON.stringify( currentLocalSettingValue ),
|
2698 |
// the following will be saved in 'metas'
|
2699 |
tmpl_title: tmpl_title,
|
2700 |
tmpl_description: tmpl_description,
|
2701 |
tmpl_post_name: tmplPostNameCandidateForUpdate || '',// <= provided when updating a template
|
2702 |
+
edit_metas_only: 'edit' === self.tmplDialogMode() ? 'yes' : 'no',//<= in this case we only update title and description. Not the template content
|
2703 |
skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
|
2704 |
tmpl_locations : self.getActiveLocationsForTmpl( currentLocalSettingValue ),
|
2705 |
tmpl_header_location : self.getHeaderOrFooterLocationIdForTmpl( 'header', currentLocalSettingValue ),
|
2938 |
.done( function( tmpl_collection ) {
|
2939 |
if ( _.isObject(tmpl_collection) && !_.isArray( tmpl_collection ) ) {
|
2940 |
self.templateCollectionPromise.resolve( tmpl_collection );
|
2941 |
+
//console.log('GET SAVED TMPL COLLECTION', tmpl_collection );
|
2942 |
} else {
|
2943 |
self.templateCollectionPromise.resolve( {} );
|
2944 |
+
if ( !_.isEmpty( tmpl_collection ) ) {
|
2945 |
+
api.errare('control::getSavedTmplCollection => error => tmpl collection is invalid', tmpl_collection);
|
2946 |
+
}
|
2947 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2948 |
})
|
2949 |
.fail( function( er ) {
|
2950 |
api.errorLog( 'ajax sek_get_all_saved_tmpl => error', er );
|
2961 |
});
|
2962 |
|
2963 |
return self.templateCollectionPromise;
|
2964 |
+
},
|
2965 |
+
|
2966 |
+
|
2967 |
+
|
2968 |
+
// API TMPL COLLECTION
|
2969 |
+
// @return a promise
|
2970 |
+
getApiTmplCollection : function() {
|
2971 |
+
var self = this,
|
2972 |
+
dfd = $.Deferred(),
|
2973 |
+
_collection = {};
|
2974 |
+
if ( '_not_populated_' !== self.allApiTemplates() ) {
|
2975 |
+
dfd.resolve( self.allApiTemplates() );
|
2976 |
+
} else {
|
2977 |
+
wp.ajax.post( 'sek_get_all_api_tmpl', {
|
2978 |
+
nonce: api.settings.nonce.save
|
2979 |
+
//skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' )
|
2980 |
+
})
|
2981 |
+
.done( function( tmpl_collection ) {
|
2982 |
+
if ( _.isObject(tmpl_collection) && !_.isArray( tmpl_collection ) ) {
|
2983 |
+
_collection = tmpl_collection;
|
2984 |
+
//console.log('AJAX GET API TMPL COLLECTION DONE', tmpl_collection );
|
2985 |
+
} else {
|
2986 |
+
api.errare('control::getApiTmplCollection => error => tmpl collection is invalid', tmpl_collection);
|
2987 |
+
}
|
2988 |
+
self.allApiTemplates( _collection );
|
2989 |
+
dfd.resolve( _collection );
|
2990 |
+
})
|
2991 |
+
.fail( function( er ) {
|
2992 |
+
api.errorLog( 'ajax sek_get_all_api_tmpl => error', er );
|
2993 |
+
api.previewer.trigger('sek-notify', {
|
2994 |
+
type : 'error',
|
2995 |
+
duration : 10000,
|
2996 |
+
message : [
|
2997 |
+
'<span style="font-size:0.95em">',
|
2998 |
+
'<strong>' + sektionsLocalizedData.i18n['Error when processing templates'] + '</strong>',
|
2999 |
+
'</span>'
|
3000 |
+
].join('')
|
3001 |
+
});
|
3002 |
+
dfd.resolve({});
|
3003 |
+
});
|
3004 |
+
}
|
3005 |
+
return dfd;
|
3006 |
+
},
|
3007 |
});//$.extend()
|
3008 |
})( wp.customize, jQuery );
|
3009 |
//global sektionsLocalizedData
|
3012 |
(function ( api, $ ) {
|
3013 |
$.extend( CZRSeksPrototype, {
|
3014 |
////////////////////////////////////////////////////////
|
3015 |
+
// INJECT TEMPLATE FROM GALLERY => FROM USER SAVED COLLECTION OR REMOTE API
|
3016 |
////////////////////////////////////////////////////////
|
3017 |
// @return promise
|
3018 |
+
getTmplJsonFromUserTmpl : function( tmpl_name ) {
|
3019 |
var self = this, _dfd_ = $.Deferred();
|
3020 |
wp.ajax.post( 'sek_get_user_tmpl_json', {
|
3021 |
nonce: api.settings.nonce.save,
|
3022 |
+
tmpl_post_name: tmpl_name
|
3023 |
//skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' )
|
3024 |
})
|
3025 |
.done( function( response ) {
|
3033 |
duration : 10000,
|
3034 |
message : [
|
3035 |
'<span style="font-size:0.95em">',
|
3036 |
+
'<strong>error when fetching the template</strong>',
|
3037 |
'</span>'
|
3038 |
].join('')
|
3039 |
});
|
3042 |
return _dfd_;
|
3043 |
},
|
3044 |
|
3045 |
+
getTmplJsonFromApi : function( tmpl_name ) {
|
3046 |
+
var self = this, _dfd_ = $.Deferred();
|
3047 |
+
wp.ajax.post( 'sek_get_api_tmpl_json', {
|
3048 |
+
nonce: api.settings.nonce.save,
|
3049 |
+
api_tmpl_name: tmpl_name
|
3050 |
+
//skope_id: api.czr_skopeBase.getSkopeProperty( 'skope_id' )
|
3051 |
+
})
|
3052 |
+
.done( function( response ) {
|
3053 |
+
_dfd_.resolve( {success:true, tmpl_json:response });
|
3054 |
+
})
|
3055 |
+
.fail( function( er ) {
|
3056 |
+
_dfd_.resolve( {success:false});
|
3057 |
+
api.errorLog( 'ajax getTmplJsonFromApiTmpl => error', er );
|
3058 |
+
api.previewer.trigger('sek-notify', {
|
3059 |
+
type : 'error',
|
3060 |
+
duration : 10000,
|
3061 |
+
message : [
|
3062 |
+
'<span style="font-size:0.95em">',
|
3063 |
+
'<strong>error when fetching the template</strong>',
|
3064 |
+
'</span>'
|
3065 |
+
].join('')
|
3066 |
+
});
|
3067 |
+
});
|
3068 |
+
return _dfd_;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3069 |
},
|
3070 |
|
3071 |
+
|
3072 |
+
|
3073 |
|
3074 |
// April 2020 : added for https://github.com/presscustomizr/nimble-builder/issues/651
|
3075 |
// @param params {
|
3076 |
+
// tmpl_name : string,
|
3077 |
+
// tmpl_source : api_tmpl or user_tmpl,
|
3078 |
+
// tmpl_inject_mode : 3 possible import modes : replace, before, after
|
3079 |
// }
|
3080 |
+
get_gallery_tmpl_json_and_inject : function( params ) {
|
3081 |
var self = this;
|
3082 |
params = $.extend( {
|
3083 |
+
tmpl_name : '',
|
3084 |
+
tmpl_source : 'user',
|
3085 |
+
tmpl_inject_mode : 'replace'
|
3086 |
}, params || {});
|
3087 |
+
var tmpl_name = params.tmpl_name;
|
3088 |
if ( _.isEmpty( tmpl_name ) || ! _.isString( tmpl_name ) ) {
|
3089 |
+
api.errare('::tmpl inject => error => invalid template name');
|
3090 |
}
|
3091 |
+
//console.log('get_gallery_tmpl_json_and_inject params ?', params );
|
3092 |
var _promise;
|
3093 |
+
if ( 'api_tmpl' === params.tmpl_source ) {
|
3094 |
// doc : https://api.jquery.com/jQuery.getJSON/
|
3095 |
_promise = self.getTmplJsonFromApi(tmpl_name);
|
3096 |
} else {
|
3109 |
// }
|
3110 |
// }
|
3111 |
_promise.done( function( response ) {
|
3112 |
+
//console.log('get_gallery_tmpl_json_and_inject ??', params, response );
|
3113 |
if ( response.success ) {
|
3114 |
+
//console.log('INJECT NIMBLE TEMPLATE', response.lib.templates[tmpl_name] );
|
3115 |
+
self.inject_tmpl_from_gallery({
|
3116 |
+
tmpl_name : tmpl_name,
|
|
|
3117 |
template_data : response.tmpl_json,
|
3118 |
+
tmpl_inject_mode : params.tmpl_inject_mode
|
3119 |
});
|
3120 |
}
|
3121 |
});
|
3122 |
+
|
3123 |
+
// After 30 s display a failure notification
|
3124 |
+
// april 2020 : introduced for https://github.com/presscustomizr/nimble-builder/issues/663
|
3125 |
+
_.delay( function() {
|
3126 |
+
if ( 'pending' !== _promise.state() )
|
3127 |
+
return;
|
3128 |
+
api.previewer.trigger('sek-notify', {
|
3129 |
+
notif_id : 'import-too-long',
|
3130 |
+
type : 'error',
|
3131 |
+
duration : 20000,
|
3132 |
+
message : [
|
3133 |
+
'<span>',
|
3134 |
+
'<strong>',
|
3135 |
+
'Template import failed',
|
3136 |
+
'</strong>',
|
3137 |
+
'</span>'
|
3138 |
+
].join('')
|
3139 |
+
});
|
3140 |
+
}, 30000 );
|
3141 |
},
|
3142 |
|
3143 |
+
// INJECT TEMPLATE FROM GALLERY
|
3144 |
// => REMOTE API COLLECTION + USER COLLECTION
|
3145 |
// @param params
|
3146 |
// {
|
3147 |
+
// tmpl_name : tmpl_name,
|
|
|
3148 |
// template_data : response.tmpl_json,
|
3149 |
+
// tmpl_inject_mode : 3 possible import modes : replace, before, after
|
3150 |
// }
|
3151 |
+
inject_tmpl_from_gallery : function( params ) {
|
3152 |
+
//console.log('inject_tmpl_from_gallery', params );
|
3153 |
var self = this;
|
3154 |
params = params || {};
|
3155 |
// normalize params
|
3156 |
params = $.extend({
|
3157 |
+
tmpl_inject_mode : 'replace'
|
|
|
|
|
3158 |
}, params );
|
3159 |
|
3160 |
+
var _scope = 'local';//<= when injecting a template not manually, scope is always local
|
3161 |
+
|
3162 |
+
// remote template inject case
|
|
|
|
|
|
|
3163 |
if ( !params.template_data ) {
|
3164 |
+
throw new Error( '::inject_tmpl => missing remote template data' );
|
3165 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3166 |
|
3167 |
/////////////////////////////////////////////
|
|
|
3168 |
/// 1) CHECK IF CONTENT IS WELL FORMED AND ELIGIBLE FOR API
|
3169 |
/// 2) LET'S PROCESS THE SETTING ID'S
|
3170 |
+
/// 3) ATTEMPT TO UPDATE THE SETTING API, LOCAL OR GLOBAL. ( always local for template inject )
|
|
|
3171 |
// fire a previewer loader removed on .always()
|
3172 |
api.previewer.send( 'sek-maybe-print-loader', { fullPageLoader : true, duration : 30000 });
|
3173 |
+
//console.log('inject_tmpl_from_gallery ?', params );
|
3174 |
+
if ( !api.czr_sektions.isImportedContentEligibleForAPI( {success:true, data:params.template_data}, params ) ) {
|
3175 |
+
api.infoLog('::inject_tmpl problem => !api.czr_sektions.isImportedContentEligibleForAPI', params );
|
3176 |
+
return;
|
3177 |
+
}
|
3178 |
|
3179 |
+
params.template_data.data.collection = self.setIdsForImportedTmpl( params.template_data.data.collection );
|
3180 |
+
// and try to update the api setting
|
3181 |
+
api.czr_sektions.doUpdateApiSettingAfter_TmplGalleryImport( {success:true, data:params.template_data}, params );
|
3182 |
+
},//inject_tmpl_from_gallery
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3183 |
|
3184 |
|
3185 |
// fired on ajaxrequest done
|
3187 |
// We can try to the update the api setting
|
3188 |
// @param params
|
3189 |
// {
|
3190 |
+
// tmpl_name : tmpl_name,
|
|
|
3191 |
// template_data : response.tmpl_json,
|
3192 |
+
// tmpl_inject_mode : 3 possible import modes : replace, before, after,
|
|
|
3193 |
// }
|
3194 |
doUpdateApiSettingAfter_TmplGalleryImport : function( server_resp, params ){
|
3195 |
//console.log('doUpdateApiSettingAfter_TmplGalleryImport ???', params, server_resp );
|
3196 |
params = params || {};
|
3197 |
+
if ( !api.czr_sektions.isImportedContentEligibleForAPI( server_resp, params ) ) {
|
3198 |
api.previewer.send( 'sek-clean-loader', { cleanFullPageLoader : true });
|
3199 |
return;
|
3200 |
}
|
3201 |
|
3202 |
+
var _scope = 'local';// <= always local when template gallery inject
|
3203 |
|
3204 |
//api.infoLog('TODO => verify metas => version, active locations, etc ... ');
|
3205 |
|
3206 |
// Update the setting api via the normalized method
|
3207 |
// the scope will determine the setting id, local or global
|
3208 |
api.czr_sektions.updateAPISetting({
|
3209 |
+
action : 'sek-inject-tmpl-from-gallery',
|
3210 |
scope : _scope,//'global' or 'local'<= will determine which setting will be updated,
|
3211 |
// => self.getGlobalSectionsSettingId() or self.localSectionsSettingId()
|
3212 |
+
injected_content : server_resp.data,
|
3213 |
+
tmpl_inject_mode : params.tmpl_inject_mode
|
3214 |
}).done( function() {
|
3215 |
// Clean an regenerate the local option setting
|
3216 |
// Settings are normally registered once and never cleaned, unlike controls.
|
3217 |
+
// After the inject, updating the setting value will refresh the sections
|
3218 |
// but the local options, persisted in separate settings, won't be updated if the settings are not cleaned
|
3219 |
if ( 'local' === _scope ) {
|
3220 |
api.czr_sektions.generateUI({
|
6690 |
//-------------------------------------------------------------------------------------------------
|
6691 |
//-- INJECT TEMPLATE FROM GALLERY
|
6692 |
//-------------------------------------------------------------------------------------------------
|
6693 |
+
case 'sek-inject-tmpl-from-gallery' :
|
6694 |
+
self._updAPISet_sek_inject_tmpl_from_gallery();
|
6695 |
break;
|
6696 |
|
6697 |
//-------------------------------------------------------------------------------------------------
|
8483 |
}// if true === params.merge
|
8484 |
|
8485 |
self.updAPISetParams.newSetValue = params.imported_content.data;
|
8486 |
+
}
|
8487 |
+
});//$.extend()
|
8488 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData, serverControlParams
|
8489 |
+
//self.updAPISetParams = {
|
8490 |
+
// params : params,
|
8491 |
+
// promise : $.Deferred(),
|
8492 |
+
// newSetValue : _.isObject( _currentSetValue ) ? $.extend( true, {}, _currentSetValue ) : self.getDefaultSektionSettingValue( params.is_global_location ? 'global' : 'local' ),
|
8493 |
+
// cloneId : '',
|
8494 |
+
// sectionInjectPromise
|
8495 |
+
// };
|
8496 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
8497 |
+
(function ( api, $ ) {
|
8498 |
+
$.extend( CZRSeksPrototype, {
|
8499 |
//-------------------------------------------------------------------------------------------------
|
8500 |
+
//-- INJECT FROM TMPL GALLERY
|
8501 |
//-------------------------------------------------------------------------------------------------
|
8502 |
// self.updAPISetParams.params : {
|
8503 |
+
// action: "sek-inject-tmpl-from-gallery"
|
8504 |
// assign_missing_locations: undefined
|
8505 |
// cloneId: ""
|
8506 |
+
// injected_content: {data: {…}, metas: {…}, img_errors: Array(0)}
|
8507 |
// is_global_location: false
|
8508 |
// scope: "local"
|
8509 |
+
// tmpl_inject_mode: "replace"
|
8510 |
// }
|
8511 |
+
_updAPISet_sek_inject_tmpl_from_gallery : function() {
|
8512 |
var self = this,
|
8513 |
params;
|
8514 |
|
8515 |
params = self.updAPISetParams.params;
|
8516 |
|
8517 |
+
api.infoLog( 'api update params for sek-inject-tmpl-from-gallery', params );
|
8518 |
|
8519 |
+
// DO WE HAVE PROPER CONTENT DO INJECT ?
|
8520 |
+
if ( _.isUndefined( params.injected_content.data ) || _.isUndefined( params.injected_content.metas ) ) {
|
8521 |
+
api.errare( 'updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported content', injected_content );
|
8522 |
return;
|
8523 |
}
|
8524 |
|
8537 |
|
8538 |
// @return bool
|
8539 |
var _isTmplHeaderLocId = function( loc_id ) {
|
8540 |
+
return params.injected_content && params.injected_content.metas && loc_id === params.injected_content.metas.tmpl_header_location;
|
8541 |
};
|
8542 |
|
8543 |
// @return bool
|
8544 |
var _isTmplFooterLocId = function( loc_id ) {
|
8545 |
+
return params.injected_content && params.injected_content.metas && loc_id === params.injected_content.metas.tmpl_footer_location;
|
8546 |
};
|
8547 |
|
8548 |
// The template has a header/footer if we find the header or the footer location
|
8566 |
return tmplLocalOptions && tmplLocalOptions.template && 'nimble_template' === tmplLocalOptions.template.local_template;
|
8567 |
};
|
8568 |
|
8569 |
+
var tmplCollection = _.isArray( params.injected_content.data.collection ) ? $.extend( true, [], params.injected_content.data.collection ) : [],
|
8570 |
+
tmplLocations = params.injected_content.metas.tmpl_locations,
|
8571 |
localLocations = [],
|
8572 |
currentSettingCollection = self.updAPISetParams.newSetValue.collection;
|
8573 |
|
8581 |
|
8582 |
// Imported Active Locations has to be an array not empty
|
8583 |
if ( !_.isArray(tmplLocations) || _.isEmpty(tmplLocations) ) {
|
8584 |
+
api.errare( 'updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported template locations', params );
|
8585 |
return;
|
8586 |
}
|
8587 |
|
8589 |
// Important :
|
8590 |
// - Local options is structured as an object : { local_header_footer: {…}, widths: {…}} }. But when not populated, it can be an array []. So make sure the type if set as object before merging it with current page local options
|
8591 |
// - Fonts is a collection described with an array
|
8592 |
+
var tmplLocalOptions = params.injected_content.data.local_options;
|
8593 |
tmplLocalOptions = $.extend( true, {}, _.isObject( tmplLocalOptions ) ? tmplLocalOptions : {} );
|
8594 |
+
var tmplFonts = params.injected_content.data.fonts;
|
8595 |
tmplFonts = _.isArray( tmplFonts ) ? $.extend( true, [], tmplFonts ) : [];
|
8596 |
|
8597 |
// Define variables uses for all cases
|
8624 |
// console.log('NEW SET VALUE COLLECTION? ', $.extend( true, [], newSetValueCollection ) );
|
8625 |
// If the current page already has NB sections, the user can chose 3 options : REPLACE, BEFORE, AFTER.
|
8626 |
// when the page has no NB sections, the default option is REPLACE
|
8627 |
+
switch( params.tmpl_inject_mode ) {
|
8628 |
//-------------------------------------------------------------------------------------------------
|
8629 |
//-- REPLACE CASE ( default case )
|
8630 |
//-------------------------------------------------------------------------------------------------
|
8676 |
}
|
8677 |
// At this point, we need a target location id
|
8678 |
if ( '__not_set__' === targetLocationId ) {
|
8679 |
+
api.errare( 'updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty' );
|
8680 |
break;
|
8681 |
}
|
8682 |
|
8683 |
// Get the current target location model
|
8684 |
targetLocationModel = self.getLevelModel( targetLocationId, newSetValueCollection );
|
8685 |
if ( 'no_match' === targetLocationModel ) {
|
8686 |
+
api.errare('::_updAPISet_sek_inject_tmpl_from_gallery => error => target location id ' + targetLocationId );
|
8687 |
break;
|
8688 |
}
|
8689 |
targetLocationModel = $.extend( true, {}, targetLocationModel );// <= create a deep copy
|
8701 |
if ( _isTmplHeaderLocId( loc_id ) || _isTmplFooterLocId( loc_id ) ) {
|
8702 |
tmplLocCandidate = self.getLevelModel( loc_id, tmplCollection );
|
8703 |
if ( 'no_match' === tmplLocCandidate ) {
|
8704 |
+
api.errare('::_updAPISet_sek_inject_tmpl_from_gallery => error => location id ' + loc_id +' not found in template collection');
|
8705 |
return;
|
8706 |
} else {
|
8707 |
newSetValueCollection.push( tmplLocCandidate );
|
8720 |
}
|
8721 |
localLocModel = self.getLevelModel( loc_id, currentSettingCollection );
|
8722 |
if ( 'no_match' === localLocModel ) {
|
8723 |
+
api.errare('::_updAPISet_sek_inject_tmpl_from_gallery => error => location id ' + loc_id +' not found in current setting collection');
|
8724 |
return;
|
8725 |
}
|
8726 |
// re-add header and footer if _hasTmplHeaderFooter()
|
8748 |
|
8749 |
locModel = self.getLevelModel( loc_id, newSetValueCollection );
|
8750 |
if ( 'no_match' === locModel ) {
|
8751 |
+
api.errare('::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found' + loc_id );
|
8752 |
return;
|
8753 |
}
|
8754 |
if ( !self.isHeaderLocation( loc_id ) && !self.isFooterLocation( loc_id ) ) {
|
8761 |
|
8762 |
// At this point, we need a target location id
|
8763 |
if ( '__not_set__' === targetLocationId ) {
|
8764 |
+
api.errare( 'updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty' );
|
8765 |
break;
|
8766 |
}
|
8767 |
|
8780 |
newSetValueCollection.push( targetLocationModel );
|
8781 |
} else {
|
8782 |
if ( 'no_match' === locModel ) {
|
8783 |
+
api.errare('::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found' + loc_id );
|
8784 |
return;
|
8785 |
}
|
8786 |
newSetValueCollection.push( self.getLevelModel( loc_id, currentSettingCollection ) );
|
8802 |
|
8803 |
locModel = self.getLevelModel( loc_id, newSetValueCollection );
|
8804 |
if ( 'no_match' === locModel ) {
|
8805 |
+
api.errare('::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found' + loc_id );
|
8806 |
return;
|
8807 |
}
|
8808 |
if ( !self.isHeaderLocation( loc_id ) && !self.isFooterLocation( loc_id ) ) {
|
8815 |
|
8816 |
// At this point, we need a target location id
|
8817 |
if ( '__not_set__' === targetLocationId ) {
|
8818 |
+
api.errare( 'updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty' );
|
8819 |
break;
|
8820 |
}
|
8821 |
|
8835 |
} else {
|
8836 |
locModel = self.getLevelModel( loc_id, currentSettingCollection );
|
8837 |
if ( 'no_match' === locModel ) {
|
8838 |
+
api.errare('::_updAPISet_sek_inject_tmpl_from_gallery => error => loc id not found' + loc_id );
|
8839 |
return;
|
8840 |
}
|
8841 |
newSetValueCollection.push( locModel );
|
8856 |
// insert 'before' or 'after' => existing local options are preserved
|
8857 |
//
|
8858 |
// Scenario :
|
8859 |
+
// 1) user has created NB sections on a single post and wants to insert a NB template before the existing sections ( 'before' inject_mode )
|
8860 |
// => in this case, we need to keep the default theme template, local options must be the existing ones => no extension of local options.
|
8861 |
//
|
8862 |
// 2) the current page has no NB sections yet, import mode is 'replace' by default
|
8863 |
// => it means that if the imported template uses NB template as canvas, it must be set in local options => extension of local options
|
8864 |
+
if ( !_.isEmpty( tmplLocalOptions ) && 'replace' === params.tmpl_inject_mode ) {
|
8865 |
var currentLocalOptions = self.updAPISetParams.newSetValue.local_options;
|
8866 |
currentLocalOptions = $.extend( true, {}, _.isObject( currentLocalOptions ) ? currentLocalOptions : {} );
|
8867 |
self.updAPISetParams.newSetValue.local_options = _.extend( currentLocalOptions, tmplLocalOptions );
|
8870 |
// FONTS
|
8871 |
// If there are imported fonts, we need to merge when import mode is not 'replace', otherwise we need to copy the imported font collection in .fonts property of the API setting.
|
8872 |
if ( _.isArray( tmplFonts ) && !_.isEmpty( tmplFonts ) ) {
|
8873 |
+
if ( 'replace' != params.tmpl_inject_mode ) {
|
8874 |
var currentFonts = self.updAPISetParams.newSetValue.fonts;
|
8875 |
currentFonts = $.extend( true, [], _.isArray( currentFonts ) ? currentFonts : [] );
|
8876 |
// merge two collection of fonts without duplicates
|
8881 |
}
|
8882 |
|
8883 |
//api.infoLog('SETTING VALUE AFTER ?', self.updAPISetParams.newSetValue );
|
8884 |
+
}//_updAPISet_sek_inject_tmpl_from_gallery
|
8885 |
|
8886 |
});//$.extend()
|
8887 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
11954 |
self.levelTreeExpanded(false);
|
11955 |
self.tmplImportDialogVisible(false);
|
11956 |
$('#customize-preview iframe').css('z-index', 1);
|
11957 |
+
self.renderOrRefreshTempGallery( { tmpl_source:'api_tmpl' });
|
11958 |
} else {
|
11959 |
$('#customize-preview iframe').css('z-index', '');
|
11960 |
+
api.trigger('nb-template-gallery-closed');
|
11961 |
}
|
11962 |
});
|
11963 |
|
11995 |
},
|
11996 |
|
11997 |
// print and schedule dom events
|
11998 |
+
renderOrRefreshTempGallery : function( params ) {
|
11999 |
+
params = $.extend( {tmpl_source:'api_tmpl'}, params || {} );
|
12000 |
var self = this,
|
12001 |
+
_tmpl,
|
12002 |
+
$tmplGalWrapper;
|
12003 |
if( $('#nimble-tmpl-gallery').length < 1 ) {
|
12004 |
$.when( self.renderTmplGalleryUI({}) ).done( function() {
|
12005 |
self.setupTmplGalleryDOMEvents();
|
12007 |
}
|
12008 |
|
12009 |
// Clean previous html
|
12010 |
+
$('#nimble-tmpl-gallery').find('.sek-tmpl-gallery-inner').html('');
|
12011 |
+
|
12012 |
+
var _doPrintTmplGalleryHtml = function(params) {
|
12013 |
+
self.getTemplateGalleryHtml( params ).done( function( html ) {
|
12014 |
+
$tmplGalWrapper = $('#nimble-tmpl-gallery');
|
12015 |
+
$tmplGalWrapper.find('.sek-tmpl-gallery-inner').html( html );
|
12016 |
+
});
|
12017 |
+
return self.getTemplateGalleryHtml( params );
|
12018 |
+
};
|
12019 |
// Wait for the gallery to be fetched and rendered
|
12020 |
+
_doPrintTmplGalleryHtml( params ).done( function( html ) {
|
12021 |
+
if ( _.isEmpty( html ) && 'api_tmpl' === params.tmpl_source ) {
|
12022 |
+
if ( typeof window.console.log == 'function' ) {
|
12023 |
+
console.log('Nimble Builder API problem => could not fetch templates');
|
12024 |
+
}
|
12025 |
+
_doPrintTmplGalleryHtml( {tmpl_source:'user_tmpl'} );
|
12026 |
+
} else {
|
12027 |
+
$tmplGalWrapper = $('#nimble-tmpl-gallery');
|
12028 |
+
$tmplGalWrapper.find('#sek-tmpl-source-switcher').show();
|
12029 |
+
// Reset template source switcher buttons
|
12030 |
+
$tmplGalWrapper.find('#sek-tmpl-source-switcher button').attr('aria-pressed', "false").removeClass('is-selected');
|
12031 |
+
$tmplGalWrapper.find('[data-sek-tmpl-source="'+ params.tmpl_source +'"]').attr('aria-pressed', "true").addClass('is-selected');
|
12032 |
+
}
|
12033 |
});
|
12034 |
},
|
12035 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12036 |
// @return html
|
12037 |
+
getTemplateGalleryHtml : function( params ) {
|
12038 |
var self = this,
|
12039 |
_html = '';
|
12040 |
// var _templates = {
|
12045 |
// temp_two : {
|
12046 |
// thumb_url : 'https://nimblebuilder.com/wp-content/uploads/2020/04/2020-04-06_16-36-12.jpg',
|
12047 |
// preview_url : ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12048 |
// };
|
12049 |
|
12050 |
// _.each( _templates, function( _data, _temp_id ) {
|
12053 |
// _html += '<div class="sek-tmpl-thumb"><img src="'+ _data.thumb_url +'"/></div>';
|
12054 |
// _html += '</div>';
|
12055 |
// });
|
12056 |
+
var _defaultThumbUrl = [ sektionsLocalizedData.baseUrl , '/assets/admin/img/wire_frame.png', '?ver=' , sektionsLocalizedData.nimbleVersion ].join(''),
|
12057 |
_dfd_ = $.Deferred(),
|
12058 |
+
_titleAttr,
|
12059 |
+
_thumbUrl,
|
12060 |
+
$cssLoader = $('#nimble-tmpl-gallery').find('.czr-css-loader');
|
12061 |
|
12062 |
+
$cssLoader.show();
|
|
|
|
|
|
|
|
|
|
|
|
|
12063 |
|
12064 |
+
var _doRender = function( tmpl_collection ) {
|
12065 |
+
if ( _.isEmpty( tmpl_collection ) && 'user_tmpl' === params.tmpl_source ) {
|
12066 |
+
var _placeholdImgUrl = [ sektionsLocalizedData.baseUrl , '/assets/admin/img/empty_tmpl_collection_notice.jpg', '?ver=' , sektionsLocalizedData.nimbleVersion ].join(''),
|
12067 |
+
doc_url = 'https://docs.presscustomizr.com/article/417-how-to-save-and-reuse-sections-with-nimble-builder';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12068 |
|
12069 |
+
_html += '<div class="sek-tmpl-empty-collection">';
|
12070 |
+
_html += '<p>' + sektionsLocalizedData.i18n['You did not save any template yet.'] + '</p>';
|
12071 |
+
_html += '<img src="'+ _placeholdImgUrl +'" />';
|
12072 |
+
//_html += '<br/><a href="'+ doc_url +'" target="_blank" rel="noreferrer nofollow">'+ doc_url +'</a>';
|
12073 |
+
_html += '</div>';
|
12074 |
+
} else {
|
12075 |
+
_.each( tmpl_collection, function( _data, _temp_id ) {
|
12076 |
+
if( !_.isEmpty( _data.description ) ) {
|
12077 |
+
_titleAttr = [ _data.title, _data.last_modified_date, _data.description ].join(' | ');
|
12078 |
+
} else {
|
12079 |
+
_titleAttr = [ _data.title, _data.last_modified_date ].join(' | ');
|
12080 |
+
}
|
12081 |
+
|
12082 |
+
_thumbUrl = !_.isEmpty( _data.thumb_url ) ? _data.thumb_url : _defaultThumbUrl;
|
12083 |
+
|
12084 |
+
_html += '<div class="sek-tmpl-item" data-sek-tmpl-item-id="' + _temp_id + '" data-sek-tmpl-item-source="'+ params.tmpl_source +'">';
|
12085 |
+
//_html += '<div class="sek-tmpl-thumb"><img src="'+ _thumbUrl +'"/></div>';
|
12086 |
+
_html += '<div class="sek-tmpl-thumb" style="background-image:url('+ _thumbUrl +')"></div>';
|
12087 |
+
_html += '<div class="sek-tmpl-info" title="'+ _titleAttr +'">';
|
12088 |
+
_html += '<h3 class="tmpl-title">' + _data.title + '</h3>';
|
12089 |
+
_html += '<p class="tmpl-date"><i>' + [ sektionsLocalizedData.i18n['Last modified'], ' : ', _data.last_modified_date ].join(' ') + '</i></p>';
|
12090 |
+
_html += '<p class="tmpl-desc">' + _data.description + '</p>';
|
12091 |
+
_html += '<i class="material-icons use-tmpl" title="'+ sektionsLocalizedData.i18n['Use this template'] +'">add_circle_outline</i>';
|
12092 |
+
if ( 'user_tmpl' === params.tmpl_source ) {
|
12093 |
+
_html += '<i class="material-icons edit-tmpl" title="'+ sektionsLocalizedData.i18n['Edit this template'] +'">edit</i>';
|
12094 |
+
_html += '<i class="material-icons remove-tmpl" title="'+ sektionsLocalizedData.i18n['Remove this template'] +'">delete_forever</i>';
|
12095 |
+
}
|
12096 |
+
if ( "true" == _data.is_pro_tmpl ) {
|
12097 |
+
_html += '<div class="sek-is-pro"><img src="' + sektionsLocalizedData.czrAssetsPath + 'sek/img/pro_orange.svg" alt="Pro feature"/></div>';
|
12098 |
+
}
|
12099 |
+
_html += '</div>';
|
12100 |
+
_html += '</div>';
|
12101 |
+
});
|
12102 |
+
}
|
12103 |
+
|
12104 |
+
|
12105 |
if ( $cssLoader.length > 0 ) {
|
12106 |
$cssLoader.hide({
|
12107 |
+
duration : 100,
|
12108 |
complete : function() {
|
12109 |
+
//$(this).remove();
|
12110 |
_dfd_.resolve( _html );
|
12111 |
}
|
12112 |
});
|
12113 |
} else {
|
12114 |
_dfd_.resolve( _html );
|
12115 |
}
|
12116 |
+
};//_doRender
|
12117 |
+
|
12118 |
+
var _tmpl_collection_promise = 'user_tmpl' === params.tmpl_source ? self.setSavedTmplCollection : self.getApiTmplCollection;
|
12119 |
+
_tmpl_collection_promise.call(self)
|
12120 |
+
.done( function(tmpl_collection) {
|
12121 |
+
setTimeout( function() {
|
12122 |
+
_doRender(tmpl_collection);
|
12123 |
+
}, 0 );
|
12124 |
+
})
|
12125 |
+
.fail( function() {
|
12126 |
+
console.log('tmpl collection promise failed', params );
|
12127 |
+
_dfd_.resolve('');
|
12128 |
+
});
|
12129 |
return _dfd_.promise();
|
12130 |
+
},
|
12131 |
+
|
12132 |
+
|
12133 |
+
|
12134 |
+
// @return void()
|
12135 |
+
setupTmplGalleryDOMEvents : function() {
|
12136 |
+
var $galWrapper = $('#nimble-tmpl-gallery');
|
12137 |
+
var self = this;
|
12138 |
+
$galWrapper
|
12139 |
+
// Schedule click event with delegation
|
12140 |
+
// PICK A TEMPLATE
|
12141 |
+
.on('click', '.sek-tmpl-item .use-tmpl', function( evt ) {
|
12142 |
+
evt.preventDefault();
|
12143 |
+
evt.stopPropagation();
|
12144 |
+
var _tmpl_id = $(this).closest('.sek-tmpl-item').data('sek-tmpl-item-id'),
|
12145 |
+
_tmpl_source = $(this).closest('.sek-tmpl-item').data('sek-tmpl-item-source');
|
12146 |
+
if ( _.isEmpty(_tmpl_id) ) {
|
12147 |
+
api.errare('::setupTmplGalleryDOMEvents => error => invalid template id');
|
12148 |
+
return;
|
12149 |
+
}
|
12150 |
+
|
12151 |
+
// if current page has NB sections, display an import dialog, otherwise import now
|
12152 |
+
if ( self.hasCurrentPageNBSectionsNotHeaderFooter() ) {
|
12153 |
+
self._tmplNameWhileImportDialog = _tmpl_id;
|
12154 |
+
self._tmplSourceWhileImportDialog = _tmpl_source;
|
12155 |
+
self.tmplImportDialogVisible(true);
|
12156 |
+
} else {
|
12157 |
+
//api.czr_sektions.get_gallery_tmpl_json_and_inject( $(this).data('sek-tmpl-item-id') );
|
12158 |
+
//api.czr_sektions.get_gallery_tmpl_json_and_inject( {tmpl_name : 'test_one', tmpl_source: 'api_tmpl'});// FOR TEST PURPOSES UNTIL THE COLLECTION IS SETUP
|
12159 |
+
api.czr_sektions.get_gallery_tmpl_json_and_inject( { tmpl_name : _tmpl_id, tmpl_source: _tmpl_source });
|
12160 |
+
self.templateGalleryExpanded(false);
|
12161 |
+
}
|
12162 |
+
})
|
12163 |
+
// PICK AN IMPORT MODE WHEN PAGE HAS SECTIONS ALREADY
|
12164 |
+
.on('click', '.sek-tmpl-gal-import-dialog .sek-ui-button', function( evt ) {
|
12165 |
+
evt.preventDefault();
|
12166 |
+
evt.stopPropagation();
|
12167 |
+
// 3 possible import modes : replace, before, after
|
12168 |
+
var tmpl_inject_mode = $(this).data('sek-tmpl-inject-mode');
|
12169 |
+
|
12170 |
+
if ( !_.contains(['replace', 'before', 'after'], tmpl_inject_mode ) ) {
|
12171 |
+
api.errare('::setupTmplGalleryDOMEvents => error => invalid import mode');
|
12172 |
+
return;
|
12173 |
+
}
|
12174 |
+
api.czr_sektions.get_gallery_tmpl_json_and_inject({
|
12175 |
+
tmpl_name : self._tmplNameWhileImportDialog,
|
12176 |
+
tmpl_source: self._tmplSourceWhileImportDialog,
|
12177 |
+
tmpl_inject_mode: tmpl_inject_mode
|
12178 |
+
});
|
12179 |
+
// api.czr_sektions.get_gallery_tmpl_json_and_inject({
|
12180 |
+
// tmpl_name : 'test_one',
|
12181 |
+
// tmpl_source: 'nimble_api',
|
12182 |
+
// tmpl_inject_mode: tmpl_inject_mode
|
12183 |
+
// });
|
12184 |
+
self.templateGalleryExpanded(false);
|
12185 |
+
})
|
12186 |
+
// SEARCH ACTIONS
|
12187 |
+
.on('propertychange change click keyup input paste', '.sek-filter-tmpl', _.debounce( function(evt) {
|
12188 |
+
evt.preventDefault();
|
12189 |
+
var _s = $(this).val();
|
12190 |
+
//console.log('searched string ??', _s );
|
12191 |
+
var _reset = function() {
|
12192 |
+
$galWrapper.removeClass('search-active');
|
12193 |
+
$galWrapper.find('.sek-tmpl-item').each( function() {
|
12194 |
+
$(this).removeClass('search-match');
|
12195 |
+
});
|
12196 |
+
};
|
12197 |
+
if ( !_.isString(_s) ) {
|
12198 |
+
_reset();
|
12199 |
+
return;
|
12200 |
+
}
|
12201 |
+
_s = _s.trim().toLowerCase();
|
12202 |
+
if ( _.isEmpty( _s.replace(/\s/g, '') ) ) {
|
12203 |
+
_reset();
|
12204 |
+
} else {
|
12205 |
+
$galWrapper.addClass('search-active');
|
12206 |
+
var title,desc,date,titleMatch, descMatch,dateMatch;
|
12207 |
+
$galWrapper.find('.sek-tmpl-item').each( function() {
|
12208 |
+
title = ( $(this).find('.tmpl-title').html() + '' ).toLowerCase();
|
12209 |
+
desc = ( $(this).find('.tmpl-desc').html() + '' ).toLowerCase();
|
12210 |
+
date = ( $(this).find('.tmpl-date').html() + '' ).toLowerCase();
|
12211 |
+
titleMatch = -1 != title.indexOf(_s);
|
12212 |
+
descMatch = -1 != desc.indexOf(_s);
|
12213 |
+
dateMatch = -1 != date.indexOf(_s);
|
12214 |
+
$(this).toggleClass( 'search-match', titleMatch || descMatch || dateMatch );
|
12215 |
+
});
|
12216 |
+
}
|
12217 |
+
|
12218 |
+
}, 100 ) )
|
12219 |
+
// EDIT
|
12220 |
+
.on( 'click', '.sek-tmpl-info .edit-tmpl', function(evt) {
|
12221 |
+
evt.preventDefault();
|
12222 |
+
var _focusOnEditCandidate = function( mode ) {
|
12223 |
+
self.tmplDialogMode( 'edit' );
|
12224 |
+
// self unbind
|
12225 |
+
self.tmplDialogMode.unbind( _focusOnEditCandidate );
|
12226 |
+
};
|
12227 |
+
self.tmplToEdit = $(this).closest("[data-sek-tmpl-item-id]").data('sek-tmpl-item-id');
|
12228 |
+
self.tmplDialogMode.bind( _focusOnEditCandidate );
|
12229 |
+
self.tmplDialogVisible(true);
|
12230 |
+
})
|
12231 |
+
// REMOVE
|
12232 |
+
.on( 'click', '.sek-tmpl-info .remove-tmpl', function(evt) {
|
12233 |
+
evt.preventDefault();
|
12234 |
+
var _focusOnRemoveCandidate = function( mode ) {
|
12235 |
+
self.tmplDialogMode( 'remove' );
|
12236 |
+
// self unbind
|
12237 |
+
self.tmplDialogMode.unbind( _focusOnRemoveCandidate );
|
12238 |
+
};
|
12239 |
+
self.tmplToRemove = $(this).closest("[data-sek-tmpl-item-id]").data('sek-tmpl-item-id');
|
12240 |
+
self.tmplDialogMode.bind( _focusOnRemoveCandidate );
|
12241 |
+
self.tmplDialogVisible(true);
|
12242 |
+
})
|
12243 |
+
.on( 'click', '.sek-close-dialog', function(evt) {
|
12244 |
+
evt.preventDefault();
|
12245 |
+
self.templateGalleryExpanded( false );
|
12246 |
+
})
|
12247 |
+
.on( 'click', '#sek-tmpl-source-switcher button', function( evt ) {
|
12248 |
+
evt.preventDefault();
|
12249 |
+
$('#sek-tmpl-source-switcher button').removeClass('is-selected').attr('aria-pressed', "false");
|
12250 |
+
$(this).addClass('is-selected').attr('aria-pressed', "true");
|
12251 |
+
self.renderOrRefreshTempGallery( { tmpl_source: $(this).data('sek-tmpl-source') } );
|
12252 |
+
});
|
12253 |
+
},
|
12254 |
});//$.extend()
|
12255 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
12256 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
12322 |
input.container.find('[data-sek-content-type]').attr( 'aria-pressed', false );
|
12323 |
|
12324 |
// close other dialog
|
12325 |
+
//nbApiInstance.templateGalleryExpanded(false);
|
12326 |
nbApiInstance.levelTreeExpanded(false);
|
12327 |
if ( nbApiInstance.tmplDialogVisible ) {
|
12328 |
nbApiInstance.tmplDialogVisible(false);
|
12348 |
}
|
12349 |
});
|
12350 |
|
12351 |
+
// Specific for templates
|
12352 |
+
api.bind('nb-template-gallery-closed', function() {
|
12353 |
+
input.container.find('[data-sek-content-type="template"]').attr( 'aria-pressed', false );
|
12354 |
+
});
|
12355 |
+
|
12356 |
// initialize with module or section picker depending on the scenario :
|
12357 |
// 1) new section created => section picker
|
12358 |
// 2) all other cases => module picker
|
15710 |
var _refreshUserSectionView = function( sec_collection ) {
|
15711 |
// clean
|
15712 |
$wrapper.find('.sek-user-section-wrapper').remove();
|
15713 |
+
|
15714 |
// Write
|
15715 |
if ( _.isEmpty( sec_collection ) ) {
|
15716 |
+
var _placeholdImgUrl = [ sektionsLocalizedData.baseUrl , '/assets/admin/img/save_section_notice.png', '?ver=' , sektionsLocalizedData.nimbleVersion ].join(''),
|
15717 |
doc_url = 'https://docs.presscustomizr.com/article/417-how-to-save-and-reuse-sections-with-nimble-builder';
|
15718 |
html = [
|
15719 |
'<div class="sek-user-section-wrapper">',
|
15722 |
'</div>'
|
15723 |
].join('');
|
15724 |
$wrapper.append( html );
|
15725 |
+
input.module.container.find('.czr-item-content .customize-control-title').html(sektionsLocalizedData.i18n['You did not save any section yet.']);
|
15726 |
} else {
|
15727 |
var _thumbUrl = [ sektionsLocalizedData.baseUrl , '/assets/admin/img/nb_sec_pholder.png', '?ver=' , sektionsLocalizedData.nimbleVersion ].join(''),
|
15728 |
styleAttr = 'background: url(' + _thumbUrl + ') 50% 50% / cover no-repeat;';
|
15744 |
'<h3 class="sec-title">' + secData.title + '</h3>',
|
15745 |
'<p class="sec-date"><i>' + [ sektionsLocalizedData.i18n['Last modified'], ' : ', secData.last_modified_date ].join(' ') + '</i></p>',
|
15746 |
'<p class="sec-desc">' + secData.description + '</p>',
|
15747 |
+
'<i class="material-icons edit-user-sec" title="'+ sektionsLocalizedData.i18n['Edit this template'] +'">edit</i>',
|
15748 |
'<i class="material-icons remove-user-sec" title="'+ sektionsLocalizedData.i18n['Remove this template'] +'">delete_forever</i>',
|
15749 |
//'<div class="sek-overlay"></div>',
|
15750 |
//'<div class="sek-saved-section-description">' + secData.description + '</div>',
|
15751 |
+
//! _.isEmpty( creation_date ) ? ( '<div class="sek-saved-section-date"><i class="far fa-calendar-alt"></i> Created : ' + creation_date + '</div>' ) : '',
|
15752 |
'</div>',
|
15753 |
'</div>',
|
15754 |
'</div>'
|
15756 |
$wrapper.append( html );
|
15757 |
});//_.each
|
15758 |
}
|
15759 |
+
// Remove the loader previously added
|
15760 |
+
$wrapper.find('.czr-css-loader').remove();
|
15761 |
|
15762 |
// Make section draggable now
|
15763 |
api.czr_sektions.trigger( 'sek-refresh-dragzones', { type : 'preset_section', input_container : input.container } );
|
15764 |
};//_refreshUserSectionView
|
15765 |
|
15766 |
// on input instantiation, render the collection
|
15767 |
+
// print a loader
|
15768 |
+
$wrapper.append('<div class="czr-css-loader czr-mr-loader" style="display:block"><div></div><div></div><div></div></div>');
|
15769 |
input.getUserSavedSections().done( function( sec_collection ) {
|
15770 |
_refreshUserSectionView( sec_collection );
|
15771 |
});
|
15779 |
// with delegation
|
15780 |
attachDomEvents : function() {
|
15781 |
// Attach events
|
15782 |
+
this.container
|
15783 |
+
.on('click', '.sek-sec-info .remove-user-sec', function(evt) {
|
15784 |
+
evt.preventDefault();
|
15785 |
+
var self = api.czr_sektions;
|
15786 |
+
self.saveSectionDialogVisible(false);
|
15787 |
+
// Close section dialog if it was open
|
15788 |
+
//self.saveSectionDialogMode( 'hidden' );
|
15789 |
+
var _focusOnRemoveCandidate = function( mode ) {
|
15790 |
+
self.saveSectionDialogMode( 'remove' );
|
15791 |
+
// self unbind
|
15792 |
+
self.saveSectionDialogMode.unbind( _focusOnRemoveCandidate );
|
15793 |
+
};
|
15794 |
+
self.userSectionToRemove = $(this).closest("[data-sek-content-id]").data('sek-content-id');
|
15795 |
+
self.saveSectionDialogMode.bind( _focusOnRemoveCandidate );
|
15796 |
+
self.saveSectionDialogVisible(true);
|
15797 |
+
})
|
15798 |
+
.on('click', '.sek-sec-info .edit-user-sec', function(evt) {
|
15799 |
+
evt.preventDefault();
|
15800 |
+
var self = api.czr_sektions;
|
15801 |
+
self.saveSectionDialogVisible(false);
|
15802 |
+
//self.saveSectionDialogMode( 'hidden' );
|
15803 |
+
var _focusOnEditCandidate = function( mode ) {
|
15804 |
+
self.saveSectionDialogMode( 'edit' );
|
15805 |
+
// self unbind
|
15806 |
+
self.saveSectionDialogMode.unbind( _focusOnEditCandidate );
|
15807 |
+
};
|
15808 |
+
self.userSectionToEdit = $(this).closest("[data-sek-content-id]").data('sek-content-id');
|
15809 |
+
self.saveSectionDialogMode.bind( _focusOnEditCandidate );
|
15810 |
+
self.saveSectionDialogVisible(true);
|
15811 |
+
});
|
15812 |
}
|
15813 |
});//module.inputConstructor
|
15814 |
|
20137 |
return _itm.id === item.id;
|
20138 |
});
|
20139 |
_index = _.isUndefined( _index ) ? index : _index + 1;
|
|
|
20140 |
}
|
20141 |
|
20142 |
//if the slide title is set, use it
|
20684 |
return _itm.id === item.id;
|
20685 |
});
|
20686 |
_index = _.isUndefined( _index ) ? index : _index + 1;
|
|
|
20687 |
}
|
20688 |
|
20689 |
//if the slide title is set, use it
|
assets/czr/sek/js/ccat-sek-control.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(p,m){p.CZR_Helpers.getInputSubTemplate=function(e){return 0<m("#tmpl-nimble-subtemplate___"+e).length?wp.template("nimble-subtemplate___"+e):(p.errare("problem in api.czr_sektions.getInputSubTemplate(), missing js template in the DOM for template_name : "+e),null)};var f=p.CZR_Helpers.getModuleTmpl;p.CZR_Helpers.getModuleTmpl=function(o){if(-1===(o=_.extend({tmpl:"",module_type:"",module_id:"",cache:!0,nonce:p.settings.nonce.save},o)).module_id.indexOf("__nimble__"))return f(o);var n=m.Deferred();if((_.isEmpty(o.tmpl)||_.isEmpty(o.module_type))&&n.reject("api.CZR_Helpers.getModuleTmpl => missing tmpl or module_type param"),!p.czr_sektions.isModuleRegistered(o.module_type))return n.reject("api.CZR_Helpers.getModuleTmpl => module type not registered"),n.resolve(),f(o);if(_.contains([],o.module_type))return n.resolve(),f(o);var e=p.czr_sektions.getRegisteredModuleProperty(o.module_type,"tmpl"),t=_.isObject(e)&&e[o.tmpl]?e[o.tmpl]:{};!_.isEmpty(t)&&_.isObject(t)||(p.errare("getModuleTmpl => Error empty or invalid input map for module : ",o.module_type),n.reject("getModuleTmpl => Error empty or invalid input map for module : ",o.module_type));var r=o.item_model,i=m.extend(!0,{},p.czr_sektions.getDefaultItemModelFromRegisteredModuleData(o.module_type)),s=m.extend(!0,{},i);r=m.extend(s,r),_.isEmpty(r)&&(p.errare("getModuleTmpl => Error invalid item model for module : ",o.module_type),n.reject("getModuleTmpl => Error invalid item model for module : ",o.module_type));var a,c="",l=function(e){var i="";return _.each(e,function(e,t){a=e.input_type;try{i+=wp.template("nimble-input-wrapper")({input_type:a,input_data:e,input_id:t,item_model:r,input_tmpl:function(e){var t=e;switch(e){case"czr_layouts":case"select":case"simpleselect":case"fa_icon_picker":case"font_picker":case"animation_picker":t="simpleselect";break;case"simpleselectWithDeviceSwitcher":t="simpleselect_deviceswitcher";break;case"multiselect":case"category_picker":t="multiselect";break;case"h_alignment":case"horizAlignmentWithDeviceSwitcher":t="h_alignment";break;case"h_text_alignment":case"horizTextAlignmentWithDeviceSwitcher":t="h_text_alignment";break;case"range_simple":case"range_simple_device_switcher":t="range_simple";break;case"number_simple":t="number_simple";break;case"font_size":case"line_height":case"range_with_unit_picker":case"range_with_unit_picker_device_switcher":t="range_with_unit_picker";break;case"spacing":case"spacingWithDeviceSwitcher":t="spacing";break;case"upload":case"upload_url":t="upload";break;case"bg_position":case"bgPositionWithDeviceSwitcher":t="bg_position";break;case"verticalAlignWithDeviceSwitcher":t="v_alignment"}return 0<m("#tmpl-nimble-input___"+t).length?wp.template("nimble-input___"+t):(p.errare("problem in getInputTemplate(), missing js template in the DOM for input_type : "+e),null)}(a),control_id:o.control_id})}catch(e){return p.errare("getModuleTmpl => Error when parsing the nimble-input-wrapper template",e),n.reject("getModuleTmpl => Error when parsing the nimble-input-wrapper template"),!1}}),i};if(t.tabs){var d="",u="";_.each(t.tabs,function(e,t){var i=m.extend(!0,{},e);i=m.extend({inputs:{},title:""},i);var o=_.isEmpty(i.attributes)?"":i.attributes;d+='<li data-tab-id="section-topline-'+(+t+1)+'" '+o+'><a href="#" title="'+i.title+'"><span>'+i.title+"</span></a></li>";var n=l(i.inputs);u+='<section id="section-topline-'+(+t+1)+'">'+n+"</section>"}),c+=['<div class="tabs tabs-style-topline">',"<nav>","<ul>",d,"</ul>","</nav>",'<div class="content-wrap">',u,"</div>","</div>"].join("")}else c=l(t);return n.resolve(c).promise()}}(wp.customize,jQuery);var CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{cachedElements:{$body:s("body"),$window:s(window)},initialize:function(){var e=this;if(_.isUndefined(window.sektionsLocalizedData))throw new Error("CZRSeksPrototype => missing localized server params sektionsLocalizedData");if(!_.isFunction(r.czr_activeSkopes))throw new Error("CZRSeksPrototype => api.czr_activeSkopes");e.SECTION_ID_FOR_GLOBAL_OPTIONS="__globalOptionsSectionId",e.SECTION_ID_FOR_LOCAL_OPTIONS="__localOptionsSection",e.SECTION_ID_FOR_CONTENT_PICKER="__content_picker__",e.MAX_NUMBER_OF_COLUMNS=12,e.SETTING_UPDATE_BUFFER=100,e.TINYMCE_EDITOR_HEIGHT=100,e.defaultLocalSektionSettingValue=e.getDefaultSektionSettingValue("local"),e.localSectionsSettingId=new r.Value({}),e.registered=new r.Value([]),wp.customize.apiIsReady?e.doSektionThinksOnApiReady():r.bind("ready",function(){e.doSektionThinksOnApiReady()}),r.bind("save-request-params",function(e){s.extend(e,{local_skope_id:r.czr_skopeBase.getSkopeProperty("skope_id"),active_locations:r.czr_sektions.activeLocations()})});var t=function(){_.isArray(r.czrActiveWPEditors)&&(_.each(r.czrActiveWPEditors,function(e){wp.editor.remove(e)}),r.czrActiveWPEditors=[])};r.bind("sek-before-clean-registered",t),r.bind("czr-all-items-closed",t)},doSektionThinksOnApiReady:function(){var n=this;n.registerAndSetupDefaultPanelSectionOptions(),n.localSectionsSettingId.callbacks.add(function(e,t){try{n.setupSettingsToBeSaved()}catch(e){r.errare("Error in self.localSectionsSettingId.callbacks => self.setupSettingsToBeSaved()",e)}n.initializeHistoryLogWhenSettingsRegistered(),r.previewer.send("sek-request-active-locations")});var i=function(e,t){n.setContextualCollectionSettingIdWhenSkopeSet(e,t),r.section(n.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){e.deferred.embedded.done(function(){!0!==e.boundForLocalOptionGeneration&&(e.boundForLocalOptionGeneration=!0,e.expanded.bind(function(e){!0===e&&n.generateUI({action:"sek-generate-local-skope-options-ui"})}))})}),r.section(n.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){!0!==e.nimbleGlobalOptionGenerated&&(n.generateUI({action:"sek-generate-global-options-ui"}),e.nimbleGlobalOptionGenerated=!0)}),n.nb_is_ready=!0,r.trigger("nimble-ready-for-current-skope")};_.isEmpty(r.czr_activeSkopes().local)||i(),r.czr_activeSkopes.callbacks.add(function(e,t){i(e,t)}),n.reactToPreviewMsg(),n.setupDnd(),n.setupTinyMceEditor(),n.schedulePrintSectionJson(),r.previewedDevice.bind(function(t){var e=_.filter(n.registered(),function(e){return"control"==e.what});_.each(e||[],function(e){r.control(e.id,function(e){e.container.find('[data-sek-device="'+t+'"]').each(function(){s(this).trigger("click")})})})}),s("#customize-notifications-area").on("click",'[data-sek-reset="true"]',function(){r.previewer.trigger("sek-reset-collection",{scope:"local"})}),n.bind("sek-ui-pre-removal",function(e){"control"==e.what&&-1<e.id.indexOf("draggable")&&r.control(e.id,function(e){e.container.find("[draggable]").each(function(){s(this).off("dragstart dragend")})}),"control"==e.what&&r.control(e.id,function(e){e.container.find("select").each(function(){_.isUndefined(s(this).data("czrSelect2"))||s(this).czrSelect2("destroy")})})}),r.bind("czr-new-registered",function(e){if(_.isUndefined(e.origin))throw new Error("czr-new-registered event => missing params.origin");if("nimble"===e.origin&&!1!==e.track){var t=n.registered(),i=s.extend(!0,[],t),o=_.findWhere(i,{id:e.id});if(!_.isEmpty(o)&&_.isEqual(o,e))throw new Error("register => duplicated element in self.registered() collection "+e.id);i.push(e),n.registered(i)}}),n.activeLocations=new r.Value([]),n.activeLocationsInfo=new r.Value([]),r.previewer.bind("sek-active-locations-in-preview",function(e){n.activeLocations(_.isObject(e)&&_.isArray(e.active_locations)?e.active_locations:[]),n.activeLocationsInfo(_.isObject(e)&&_.isArray(e.active_locs_info)?e.active_locs_info:[])}),n.setupTopBar(),n.setupSaveSectionUI(),n.setupSaveTmplUI(),n.lastClickedTargetInPreview=new r.Value,n.lastClickedTargetInPreview.bind(function(e,t){_.isObject(e)&&e.id?r.previewer.send("sek-set-double-click-target",e):r.previewer.send("sek-reset-double-click-target"),clearTimeout(n.cachedElements.$window.data("_preview_target_timer_")),n.cachedElements.$window.data("_preview_target_timer_",setTimeout(function(){n.lastClickedTargetInPreview({}),r.previewer.send("sek-reset-double-click-target")},2e4))}),r.previewer.bind("sek-clean-target-drop-zone",function(){n.lastClickedTargetInPreview({})}),s(document).keydown(function(e){e&&27===e.keyCode&&n.lastClickedTargetInPreview({})}),sektionsLocalizedData.hasActiveCachePlugin&&_.delay(function(){r.previewer.trigger("sek-notify",{notif_id:"has-active-cache-plugin",type:"info",duration:2e4,message:['<span style="color:#0075a2">',sektionsLocalizedData.i18n["You seem to be using a cache plugin."],!_.isString(sektionsLocalizedData.hasActiveCachePlugin)||sektionsLocalizedData.hasActiveCachePlugin.length<2?"":"<strong> ("+sektionsLocalizedData.hasActiveCachePlugin+")</strong><br/>"," <strong>",sektionsLocalizedData.i18n["It is recommended to disable your cache plugin when customizing your website."],"</strong>","</span>"].join("")})},2e3),r.previewer.bind("multi-items-module-refreshed",function(t){_.isUndefined(t.apiParams.control_id)||r.control(t.apiParams.control_id,function(e){_.isUndefined(e.params.sek_registration_params)||r.control(e.id).params.sek_registration_params.module_id===t.apiParams.id&&e.czr_Module.each(function(e){e.czr_Item.each(function(e){"expanded"===e.viewState()&&e.trigger("sek-request-item-focus-in-preview")})})})}),n.setupTemplateGallery()},registerAndSetupDefaultPanelSectionOptions:function(){var o=this,e=r.Panel.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}});r.panel(sektionsLocalizedData.sektionsPanelId,function(o){o.deferred.embedded.done(function(){var e=o.container.first().find("h3.accordion-section-title"),t=(o.container.first().find(".panel-meta .accordion-section-title"),['<img class="sek-nimble-logo" alt="'+o.params.title+'" src="',sektionsLocalizedData.baseUrl,"/assets/img/nimble/nimble_horizontal.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join(""));if(sektionsLocalizedData.isPro&&(t+=['<img class="sek-nimble-logo sek-pro-pastil" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_white.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),0<e.length){var i=e.find("span");e.addClass("sek-side-nimble-logo-wrapper").html(t).append(i)}})}),r.CZR_Helpers.register({origin:"nimble",what:"panel",id:sektionsLocalizedData.sektionsPanelId,title:sektionsLocalizedData.i18n["Nimble Builder"],priority:-1e3,constructWith:e,track:!1}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_GLOBAL_OPTIONS,title:sektionsLocalizedData.i18n["Site wide options"],panel:sektionsLocalizedData.sektionsPanelId,priority:20,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-globe sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-globe sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_LOCAL_OPTIONS,title:sektionsLocalizedData.i18n["Current page options"],panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"setting",id:sektionsLocalizedData.optNameForGlobalOptions,dirty:!1,value:sektionsLocalizedData.globalOptionDBValues,transport:"postMessage",type:"option"}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_CONTENT_PICKER,title:sektionsLocalizedData.i18n["Content Picker"],panel:sektionsLocalizedData.sektionsPanelId,priority:30,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_CONTENT_PICKER,function(e){"resolved"!=r.czr_initialSkopeCollectionPopulated.state()?r.czr_initialSkopeCollectionPopulated.done(function(){r.previewer.trigger("sek-pick-content",{focus:!1})}):r.previewer.trigger("sek-pick-content",{focus:!1})})})},setContextualCollectionSettingIdWhenSkopeSet:function(e,t){t=t||{},!_.isEmpty(t.local)&&r.panel(sektionsLocalizedData.sektionsPanelId).expanded()&&r.previewer.trigger("sek-pick-content"),sektionsData=r.czr_skopeBase.getSkopeProperty("sektions","local"),sektionsLocalizedData.isDevMode&&r.infoLog("::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ",sektionsData),_.isEmpty(sektionsData)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => no sektionsData"),_.isEmpty(sektionsData.setting_id)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => missing setting_id"),this.localSectionsSettingId(sektionsData.setting_id)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{setupTopBar:function(){var t=this;t.topBarId="#nimble-top-bar",t.topBarVisible=new r.Value(!1),t.topBarVisible.bind(function(e){t.levelTreeExpanded()||t.toggleTopBar(e)}),t.mouseMovedRecently=new r.Value({}),t.mouseMovedRecently.bind(function(e){t.topBarVisible(!_.isEmpty(e))});var e=function(e){t.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(t.cachedElements.$window.data("_scroll_move_timer_")),t.cachedElements.$window.data("_scroll_move_timer_",setTimeout(function(){t.mouseMovedRecently.set({})},4e3))};t.cachedElements.$window.on("mousemove scroll,",_.throttle(e,50)),r.previewer.bind("ready",function(){s(r.previewer.targetWindow().document).on("mousemove scroll,",_.throttle(e,50))}),t.setupLevelTree()},toggleTopBar:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?s.when(i.renderAndSetupTopBarTmpl({})).done(function(e){i.topBarContainer=e,_.delay(function(){i.cachedElements.$body.addClass("nimble-top-bar-visible")},200)}):(t=s.Deferred(),i.cachedElements.$body.removeClass("nimble-top-bar-visible"),i.topBarContainer&&i.topBarContainer.length?_.delay(function(){t.resolve()},300):t.resolve(),t.promise()).done(function(){i.topBarVisible(!1)})},renderAndSetupTopBarTmpl:function(e){var t,i=this;if(0<s(i.topBarId).length)return s(i.topBarId);try{t=wp.template("nimble-top-bar")({})}catch(e){return r.errare("Error when parsing the the top note template",e),!1}s("#customize-preview").after(s(t)),s(document).keydown(function(e){if(e.ctrlKey&&_.contains([89,90],e.keyCode))try{i.navigateHistory(90===e.keyCode?"undo":"redo")}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-add-content",i.topBarId).on("click",function(e){e.preventDefault(),r.previewer.trigger("sek-pick-content",{content_type:"module"})}),s(".sek-level-tree",i.topBarId).on("click",function(e){e.preventDefault(),i.levelTreeExpanded(!i.levelTreeExpanded())}),s("[data-nimble-history]",i.topBarId).on("click",function(e){try{i.navigateHistory(s(this).data("nimble-history"))}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-settings",i.topBarId).on("click",function(e){r.panel(sektionsLocalizedData.sektionsPanelId,function(e){i.rootPanelFocus(),e.focus()})}),s(".sek-nimble-doc",i.topBarId).on("click",function(e){e.preventDefault(),window.open(s(this).data("doc-href"),"_blank")}),s(".sek-tmpl-saving",i.topBarId).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!i.tmplDialogVisible())});var o=function(e){s(i.topBarId).length<1||sektionsLocalizedData.isDebugMode||(_.isObject(e)&&e.local_template&&"default"!==e.local_template?s(i.topBarId).find(".sek-notifications").html(['<span class="fas fa-info-circle"></span>',sektionsLocalizedData.i18n["This page uses a custom template."]].join(" ")):s(i.topBarId).find(".sek-notifications").html(""))},n=function(){r(i.localSectionsSettingId(),function(e){var t=e(),i=_.isObject(t)&&t.local_options&&t.local_options.template?t.local_options.template:null;o(i)}),r(i.getLocalSkopeOptionId()+"__template",function(e){e.bind(function(e,t){o(e)})})};return n(),r.bind("nimble-ready-for-current-skope",function(){n()}),s(i.topBarId)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{initializeHistoryLogWhenSettingsRegistered:function(){this.historyLog=new l.Value([{status:"current",value:{local:l(this.localSectionsSettingId())(),global:l(this.getGlobalSectionsSettingId())()},action:"initial"}]),this.historyLog.bind(function(e){if(!_.isEmpty(e)){var t=_.findKey(e,{status:"current"});t=Number(t),d("#nimble-top-bar").find("[data-nimble-history]").each(function(){"undo"===d(this).data("nimble-history")?d(this).attr("data-nimble-state",t<=0?"disabled":"enabled"):d(this).attr("data-nimble-state",e.length<=t+1?"disabled":"enabled")})}})},trackHistoryLog:function(e,t){var i=this,o=e.id===i.getGlobalSectionsSettingId();if(!_.isObject(t)||!_.isFunction(i.historyLog)||!_.isArray(i.historyLog()))throw l.errare("params, self.historyLog() ",t,i.historyLog()),new Error("trackHistoryLog => invalid params or historyLog value");var n,r=[],s=d.extend(!0,[],i.historyLog());_.isEmpty(t.in_sektion)?_.isEmpty(t.to_sektion)||(n=t.to_sektion):n=t.in_sektion,_.each(s,function(e){"future"!=e.status&&(d.extend(e,{status:"previous"}),r.push(e))}),r.push({status:"current",value:o?{global:e()}:{local:e()},action:_.isObject(t)&&t.action||"",sektionToRefresh:n}),i.historyLog(r)},navigateHistory:function(i){var t,o,n,r,e=this,s=d.extend(!0,[],e.historyLog()),a=[];if(_.each(s,function(e){if(_.isEmpty(r)){switch(e.status){case"previous":t=e;break;case"current":o=e;break;case"future":n=e}switch(i){case"undo":_.isEmpty(o)||_.isEmpty(t)||(r=t.value,o.sektionToRefresh,t.sektionToRefresh);break;case"redo":_.isEmpty(n)||(r=n.value,o.sektionToRefresh,n.sektionToRefresh)}}}),!_.isUndefined(r)){_.isEmpty(r.local)||(l(e.localSectionsSettingId())(e.validateSettingValue(r.local,"local"),{navigatingHistoryLogs:!0}),l.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0})),_.isEmpty(r.global)||l(e.getGlobalSectionsSettingId())(e.validateSettingValue(r.global,"global"),{navigatingHistoryLogs:!0});l.previewer.refresh(),l.previewer.trigger("sek-pick-content",{}),e.cleanRegistered(),e.cleanRegisteredLevelSettingsAfterHistoryNavigation()}var c=_.findKey(s,{status:"current"});c=Number(c),_.isNumber(c)?(_.each(s,function(e,t){switch(newLog=d.extend(!0,{},e),t=Number(t),i){case"undo":0<c&&(t===c-1?newLog.status="current":t===c&&(newLog.status="future"));break;case"redo":s.length>c+1&&(t===c?newLog.status="previous":t===c+1&&(newLog.status="current"))}a.push(newLog)}),e.historyLog(a)):l.errare("Error when navigating the history log, the current key should be a number")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(b,I){I.extend(CZRSeksPrototype,{setupLevelTree:function(){var i=this;i.levelTree=new b.Value([]),i.levelTree.bind(function(){i.levelTreeExpanded()&&i.renderOrRefreshTree()}),i.levelTreeExpanded=new b.Value(!1),i.levelTreeExpanded.bind(function(e){if(i.cachedElements.$body.toggleClass("sek-level-tree-expanded",e),e){if(i.templateGalleryExpanded(!1),i.tmplDialogVisible(!1),i.saveSectionDialogVisible&&i.saveSectionDialogVisible(!1),i.setLevelTreeValue(),_.isEmpty(i.levelTree()))return b.previewer.trigger("sek-notify",{type:"info",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["No sections to navigate"]+"</strong>","</span>"].join("")}),void i.levelTreeExpanded(!1);I("#customize-preview iframe").css("z-index",1),i.renderOrRefreshTree()}else 0<I("#nimble-level-tree").length&&_.delay(function(){I("#nimble-level-tree").remove(),I("#customize-preview iframe").css("z-index","")},300)}),i.activeLocations.bind(function(){_.isEmpty(i.levelTree())||i.renderOrRefreshTree()}),b.previewer.bind("ready",function(){i.localSectionsSettingId.callbacks.add(function(){i.levelTreeExpanded(!1),_.each([i.getGlobalSectionsSettingId(),i.localSectionsSettingId(),sektionsLocalizedData.optNameForGlobalOptions],function(e){b(e)._isBoundForNimbleLevelTree||(b(e).bind(function(e){i.setLevelTreeValue()}),b(e)._isBoundForNimbleLevelTree=!0)})})}),i.cachedElements.$body.on("click","#nimble-level-tree [data-nimb-level]",function(e){e.preventDefault(),e.stopPropagation();var i=I(e.target).closest("[data-nimb-level]");b.previewer.send("sek-animate-to-level",{id:i.data("nimb-id")}),b.previewer.send("sek-clean-level-uis"),_.delay(function(){b.previewer.send("sek-display-level-ui",{id:i.data("nimb-id")});var e=i.data("nimb-id"),t=i.data("nimb-level");"column"===t||"section"===t?b.previewer.trigger("sek-edit-options",{id:e,level:t}):"module"===t&&b.previewer.trigger("sek-edit-module",{id:e,level:t})},100)}),i.cachedElements.$body.on("click","#nimble-level-tree .sek-remove-level",function(e){e.preventDefault(),e.stopPropagation();var t=I(e.target).closest("[data-nimb-level]");b.previewer.trigger("sek-remove",{level:t.data("nimb-level"),id:t.data("nimb-id"),location:t.closest('[data-nimb-level="location"]').data("nimb-id"),in_sektion:t.closest('[data-nimb-level="section"]').data("nimb-id"),in_column:t.closest('[data-nimb-level="column"]').data("nimb-id")}),t.fadeOut("slow"),i.renderOrRefreshTree()}),i.cachedElements.$body.on("click",".sek-close-level-tree",function(e){e.preventDefault(),i.levelTreeExpanded(!1)})},setLevelTreeValue:function(){var e,t,i,o,n,r=this.getGlobalSectionsSettingId(),s=this.localSectionsSettingId(),a=sektionsLocalizedData.optNameForGlobalOptions,c=!1;if(_.each([r,s,a],function(e){b.has(e)||(c=e)}),!1===c){e=b(r)(),i=_.isObject(e)?I.extend(!0,{},e):{},i=_.isEmpty(i.collection)?[]:i.collection,i=_.isArray(i)?i:[],t=b(s)(),t=_.isObject(t)?t:{},o=I.extend(!0,{},t),o=_.isEmpty(o.collection)?[]:o.collection,o=_.isArray(o)?o:[];var l,d=_.union(i,o),u=!1,p=!1;n=b(a)(),n=_.isObject(n)?n:{},t.local_options&&t.local_options.local_header_footer&&(u="nimble_local"===(l=t.local_options.local_header_footer["header-footer"])),n.global_header_footer&&!u&&"theme"!==l&&(p="nimble_global"===n.global_header_footer["header-footer"]||"nimble_global"===l);var m,f,g=I.extend(!0,[],d);g=_.filter(g,function(e,t){return!_.contains(["nimble_global_header","nimble_global_footer","nimble_local_header","nimble_local_footer"],e.id)});var h=function(e){m=_.findWhere(d,{id:"nimble_"+e+"_header"}),f=_.findWhere(d,{id:"nimble_"+e+"_footer"}),g.unshift(m),g.push(f)};u?h("local"):p&&h("global");var v,k=this.activeLocations(),y=[];_.isEmpty(k)?y=g:_.each(k,function(e){v=_.findWhere(g,{id:e}),_.isUndefined(v)||y.push(v)}),this.levelTree(y)}else b.errare("::setLevelTreeValue => a setting id is not registered ")},renderOrRefreshTree:function(){var e;if(I("#nimble-level-tree").length<1){try{e=wp.template("nimble-level-tree")({})}catch(e){return b.errare("Error when parsing the nimble-level-tree template",e),!1}I("#customize-preview").after(I(e))}I("#nimble-level-tree").find(".sek-tree-wrap").html(this.getLevelTreeHtml())},getLevelTreeHtml:function(e,t){var i=this;e=e||i.levelTree();var o,n,r,s=!1;if(!_.isArray(e)||_.isEmpty(e))return b.errare("::buildLevelTree => invalid collection param",e),r;var a='<i class="material-icons sek-remove-level" title="'+sektionsLocalizedData.i18n["Remove this element"]+'">delete_forever</i>';return r="<ul>",_.each(e,function(e){_.isUndefined(e.level)?b.errare("::buildLevelTree => missing level property",e):_.isUndefined(e.id)?b.errare("::buildLevelTree => missing id property",e):(o=e.level,"location"===(n=o)&&(s=!_.contains(i.activeLocations(),e.id)),s||(sektionsLocalizedData.i18n[o]&&(n=sektionsLocalizedData.i18n[o]),!0===e.is_nested&&(n=sektionsLocalizedData.i18n["nested section"]),a="location"!==o?a:"",r+='<li data-nimb-level="'+o+'" data-nimb-id="'+e.id+'">',r+='<div class="sek-level-infos"><div class="sek-inner-level-infos">',"module"===o&&(r+=[i.getTreeModuleIcon(e.module_type),i.getTreeModuleTitle(e.module_type)].join(" ")),r+=[" ",n,"( id :",e.id,")",a].join(" "),r+="</div></div>",_.isArray(e.collection)&&!_.isEmpty(e.collection)&&(r+=i.getLevelTreeHtml(e.collection,t)),r+="</li>"))}),r+="</ul>"},getTreeModuleIcon:function(t){var i,o={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(o)&&t===e["content-id"]&&(_.isEmpty(e.icon)||(i="http"===e.icon.substring(0,4)?e.icon:sektionsLocalizedData.moduleIconPath+e.icon,o={svg:e.icon?i:"",font:e.font_icon?e.font_icon:""}))}),_.isEmpty(o.svg)?_.isEmpty(o.font)?void 0:o.font:'<img class="sek-svg-mod-icon" src="'+o.svg+'"/>'},getTreeModuleTitle:function(t){var i={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(i)&&t===e["content-id"]&&(i=e.title)}),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{setupSaveSectionUI:function(){var n=this;n.saveSectionDialogVisible=new c.Value(!1),n.saveSectionDialogVisible.bind(function(e){e&&(n.templateGalleryExpanded(!1),n.levelTreeExpanded(!1),n.tmplDialogVisible&&n.tmplDialogVisible(!1)),n.toggleSaveSectionUI(e)}),n.allSavedSections=new c.Value("_not_populated_"),n.allSavedSections.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,n.refreshSectionPickerHtml(e)):c.errare("error setupSaveSectionUI => section collection should be an object")}),n.saveSectionDialogMode=new c.Value("hidden"),n.saveSectionDialogMode.bind(function(e){_.contains(["hidden","save","update","remove"],e)||(c.errare("error setupSaveSectionUI => unknown section dialog mode",e),e="save");var t=l("#nimble-top-section-save-ui"),i=t.find("#sek-saved-section-title"),o=t.find("#sek-saved-section-description");switch(t.find("[data-section-mode-switcher]").attr("aria-pressed",!1),t.find('[data-section-mode-switcher="'+e+'"]').attr("aria-pressed",!0),l("#nimble-top-section-save-ui").attr("data-sek-section-dialog-mode",e),t.removeClass("sek-removal-confirmation-opened"),e){case"save":i.val(""),o.val("");break;case"update":case"remove":t.find(".sek-saved-section-picker").val("none").trigger("change"),n.setSavedSectionCollection().done(function(e){n.refreshSectionPickerHtml()})}"remove"===e&&_.isEmpty(n.idOfSectionToSave)?t.addClass("sek-is-removal-only"):t.removeClass("sek-is-removal-only")})},refreshSectionPickerHtml:function(e){e=e||this.allSavedSections();var t=l("#nimble-top-section-save-ui"),i=t.find(".sek-saved-section-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==l(this).attr("value")&&l(this).remove()});var o,n,r="";_.each(e,function(e,t){_.isObject(e)&&(n=e.last_modified_date?e.last_modified_date:"",o=e.title?e.title:"section title not set",r+='<option value="'+t+'">'+[o,sektionsLocalizedData.i18n["Last modified"]+" : "+n].join(" | ")+"</option>")}),i.append(r),t.addClass("section-collection-populated")},renderSectionSaveUI:function(e){if(0<l("#nimble-top-section-save-ui").length)return l("#nimble-top-section-save-ui");try{_tmpl=wp.template("nimble-top-section-save-ui")({})}catch(e){return c.errare("Error when parsing nimble-top-section-save-ui template",e),!1}return l("#customize-preview").after(l(_tmpl)),l("#nimble-top-section-save-ui")},maybeScheduleSectionSaveDOMEvents:function(){var i=this,o=l("#nimble-top-section-save-ui");o.data("nimble-sec-save-dom-events-scheduled")||(o.on("click","[data-section-mode-switcher]",function(e){e.preventDefault(),i.saveSectionDialogMode(l(this).data("section-mode-switcher"))}),o.on("change",".sek-saved-section-picker",function(e){i.reactOnSectionSelection(e,l(this))}),o.on("click",".sek-do-save-section",function(e){o.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e).done(function(e){o.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}))})}),o.on("click",".sek-do-update-section",function(e){var t=o.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e,t).done(function(e){o.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}).done(function(e){i.refreshSectionPickerHtml()}))}))}),o.on("click",".sek-open-remove-confirmation",function(e){o.addClass("sek-removal-confirmation-opened")}),o.on("click",".sek-do-remove-section",function(e){var t=o.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-section-processing-ajax"),i.removeSavedSection(e,t).done(function(e){o.removeClass("nimble-section-processing-ajax"),o.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedSectionCollection({refresh:!0})}))}),o.on("click",".sek-cancel-remove-section",function(e){o.removeClass("sek-removal-confirmation-opened")}),l(".sek-close-dialog",o).on("click",function(e){e.preventDefault(),i.saveSectionDialogVisible(!1)}),o.data("nimble-sec-save-dom-events-scheduled",!0))},reactOnSectionSelection:function(e,t){var i=l("#nimble-top-section-save-ui"),o=t.val(),n=i.find("#sek-saved-section-title"),r=i.find("#sek-saved-section-description"),s="update"===this.saveSectionDialogMode()?"sek-section-update-selected":"sek-section-remove-selected";if("none"===o)n.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedSections();(a=_.isObject(a)&&!_.isArray(a)?a:{})[o]=l.extend({title:"",description:"",last_modified_date:""},a[o]||{}),n.val(a[o].title),r.val(a[o].description),i.addClass(s)}},saveOrUpdateSavedSection:function(e,t){var i=this,o=l.Deferred();if(!i.idOfSectionToSave||_.isEmpty(i.idOfSectionToSave))return c.errare("saveOrUpdateSavedSection => error => missing section id"),o.resolve({success:!1});e.preventDefault();var n=l("#sek-saved-section-title"),r=n.val(),s=l("#sek-saved-section-description").val(),a=l.extend(!0,{},i.getLevelModel(i.idOfSectionToSave));return"no_match"==a?(c.errare("saveOrUpdateSavedSection => error => no section model with id "+i.idOfSectionToSave),o.resolve({success:!1})):_.isEmpty(r)?(n.addClass("error"),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),o.resolve({success:!1})):(l("#sek-saved-section-title").removeClass("error"),a=i.preProcessSection(a),_.isObject(a)||(c.errare("::saveOrUpdateSavedSection => error => invalid sectionModel"),o.resolve({success:!1})),wp.ajax.post("sek_save_user_section",{nonce:c.settings.nonce.save,section_data:JSON.stringify(a),section_title:r,section_description:s,section_post_name:t||"",skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")}).done(function(e){o.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){o.resolve({success:!1}),c.errorLog("ajax sek_save_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),o)},preProcessSection:function(e){if(!_.isObject(e))return null;var t=l.extend({},!0,e);return _.has(t,"is_nested")&&(t=_.omit(t,"is_nested")),t},removeSavedSection:function(e,t){var i=this,o=l.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_section",{nonce:c.settings.nonce.save,section_post_name:t}).done(function(e){o.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){o.resolve({success:!1}),c.errorLog("ajax sek_remove_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),o},toggleSaveSectionUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?l.when(i.renderSectionSaveUI({})).done(function(e){i.maybeScheduleSectionSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.saveSectionDialogMode("save"),i.cachedElements.$body.addClass("sek-save-section-ui-visible")},200)}):(t=l.Deferred(),i.cachedElements.$body.removeClass("sek-save-section-ui-visible"),0<l("#nimble-top-section-save-ui").length?_.delay(function(){i.saveSectionDialogMode=i.saveSectionDialogMode?i.saveSectionDialogMode:new c.Value,i.saveSectionDialogMode("hidden"),i.saveUIContainer.remove(),i.idOfSectionToSave=null,t.resolve()},250):t.resolve(),t.promise()).done(function(){i.saveSectionDialogVisible(!1)})},setSavedSectionCollection:function(e){var t=this,i=l.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedSections()?((t.sectionCollectionPromise&&"pending"===t.sectionCollectionPromise.state()?t.sectionCollectionPromise:t.getSavedSectionCollection(e)).done(function(e){t.allSavedSections(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedSections())},getSavedSectionCollection:function(e){var t=this;return e=e||{refresh:!1},t.sectionCollectionPromise=l.Deferred(),e.refresh||"_not_populated_"===t.allSavedSections()?wp.ajax.post("sek_get_all_saved_sections",{nonce:c.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?t.sectionCollectionPromise.resolve(e):(t.sectionCollectionPromise.resolve({}),c.errorLog("control::getSavedSectionCollection => collection is empty or invalid"))}).fail(function(e){c.errorLog("ajax sek_get_all_saved_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.sectionCollectionPromise.resolve({})}):t.sectionCollectionPromise.resolve(t.allSavedSections()),t.sectionCollectionPromise}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{setupSaveTmplUI:function(){var n=this;n.tmplDialogVisible=new l.Value(!1),sektionsLocalizedData.isTemplateSaveEnabled&&(n.tmplDialogVisible.bind(function(e){e&&(n.templateGalleryExpanded(!1),n.levelTreeExpanded(!1),n.saveSectionDialogVisible&&n.saveSectionDialogVisible(!1)),n.toggleSaveTmplUI(e)}),n.allSavedTemplates=new l.Value("_not_populated_"),n.allSavedTemplates.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,n.refreshTmplPickerHtml(e)):l.errare("error setupSaveTmplUI => tmpl collection should be an object")}),n.tmplDialogMode=new l.Value("hidden"),n.tmplDialogMode.bind(function(e){_.contains(["hidden","save","update","remove"],e)||(l.errare("::setupSaveTmplUI => unknown tmpl dialog mode",e),e="save");var t=d("#nimble-top-tmpl-save-ui"),i=t.find("#sek-saved-tmpl-title"),o=t.find("#sek-saved-tmpl-description");switch(t.find("[data-tmpl-mode-switcher]").attr("aria-pressed",!1),t.find('[data-tmpl-mode-switcher="'+e+'"]').attr("aria-pressed",!0),d("#nimble-top-tmpl-save-ui").attr("data-sek-tmpl-dialog-mode",e),t.removeClass("sek-removal-confirmation-opened"),e){case"save":i.val(""),o.val("");break;case"update":case"remove":t.find(".sek-saved-tmpl-picker").val("none").trigger("change"),n.setSavedTmplCollection().done(function(e){n.refreshTmplPickerHtml()})}}))},refreshTmplPickerHtml:function(e){e=e||this.allSavedTemplates();var t=d("#nimble-top-tmpl-save-ui"),i=t.find(".sek-saved-tmpl-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==d(this).attr("value")&&d(this).remove()});var o,n,r="";_.each(e,function(e,t){_.isObject(e)&&(n=e.last_modified_date?e.last_modified_date:"",o=e.title?e.title:"template title not set",r+='<option value="'+t+'">'+[o,sektionsLocalizedData.i18n["Last modified"]+" : "+n].join(" | ")+"</option>")}),i.append(r),t.addClass("tmpl-collection-populated")},renderTmplUI:function(e){if(0<d("#nimble-top-tmpl-save-ui").length)return d("#nimble-top-tmpl-save-ui");try{_tmpl=wp.template("nimble-top-tmpl-save-ui")({})}catch(e){return l.errare("Error when parsing nimble-top-tmpl-save-ui template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-top-tmpl-save-ui")},scheduleTmplSaveDOMEvents:function(){var i=this,o=d("#nimble-top-tmpl-save-ui");o.data("nimble-tmpl-dom-events-scheduled")||(o.on("click","[data-tmpl-mode-switcher]",function(e){e.preventDefault(),i.tmplDialogMode(d(this).data("tmpl-mode-switcher"))}),o.on("change",".sek-saved-tmpl-picker",function(e){i.reactOnTemplateSelection(e,d(this))}),o.on("click",".sek-do-save-tmpl",function(e){o.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e).done(function(e){o.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}))})}),o.on("click",".sek-do-update-tmpl",function(e){var t=o.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e,t).done(function(e){o.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}).done(function(e){i.refreshTmplPickerHtml()}))}))}),o.on("click",".sek-open-remove-confirmation",function(e){o.addClass("sek-removal-confirmation-opened")}),o.on("click",".sek-do-remove-tmpl",function(e){var t=o.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-tmpl-processing-ajax"),i.removeTemplate(e,t).done(function(e){o.removeClass("nimble-tmpl-processing-ajax"),o.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedTmplCollection({refresh:!0})}))}),o.on("click",".sek-cancel-remove-tmpl",function(e){o.removeClass("sek-removal-confirmation-opened")}),d(".sek-close-dialog",o).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!1)}),o.data("nimble-tmpl-dom-events-scheduled",!0))},reactOnTemplateSelection:function(e,t){var i=d("#nimble-top-tmpl-save-ui"),o=t.val(),n=i.find("#sek-saved-tmpl-title"),r=i.find("#sek-saved-tmpl-description"),s="update"===this.tmplDialogMode()?"sek-tmpl-update-selected":"sek-tmpl-remove-selected";if("none"===o)n.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedTemplates();(a=_.isObject(a)&&!_.isArray(a)?a:{})[o]=d.extend({title:"",description:"",last_modified_date:""},a[o]||{}),n.val(a[o].title),r.val(a[o].description),i.addClass(s)}},saveOrUpdateTemplate:function(e,t){var i=this,o=d.Deferred();e.preventDefault();var n,r=d("#sek-saved-tmpl-title"),s=r.val(),a=d("#sek-saved-tmpl-description").val(),c=i.localSectionsSettingId();try{n=i.preProcessTmpl(l(c)())}catch(e){l.errorLog("error in ::saveOrUpdateTemplate",e),o.resolve({success:!1})}return _.isEmpty(s)?(r.addClass("error"),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),o.resolve({success:!1})):(d("#sek-saved-tmpl-title").removeClass("error"),wp.ajax.post("sek_save_user_template",{nonce:l.settings.nonce.save,tmpl_data:JSON.stringify(n),tmpl_title:s,tmpl_description:a,tmpl_post_name:t||"",skope_id:l.czr_skopeBase.getSkopeProperty("skope_id"),tmpl_locations:i.getActiveLocationsForTmpl(n),tmpl_header_location:i.getHeaderOrFooterLocationIdForTmpl("header",n),tmpl_footer_location:i.getHeaderOrFooterLocationIdForTmpl("footer",n)}).done(function(e){o.resolve({success:!0}),l.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){o.resolve({success:!1}),l.errorLog("ajax sek_save_template => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}),o)},getActiveLocationsForTmpl:function(e){if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var t=[];return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&"location"===e.level&&t.push(e.id)}),t},getHeaderOrFooterLocationIdForTmpl:function(t,e){var i=this;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var o="";return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&("header"===t&&i.isHeaderLocation(e.id)||"footer"===t&&i.isFooterLocation(e.id))&&(o=e.id)}),o},preProcessTmpl:function(e){var t,i;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");return(t=d.extend(!0,{},e)).collection=[],i=this.activeLocations(),_.each(e.collection,function(e){_.isObject(e)&&e.id&&e.collection&&_.contains(i,e.id)&&!_.isEmpty(e.collection)&&t.collection.push(e)}),t},removeTemplate:function(e,t){var i=d.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_template",{nonce:l.settings.nonce.save,tmpl_post_name:t}).done(function(e){i.resolve({success:!0}),l.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){i.resolve({success:!1}),l.errorLog("ajax sek_remove_template => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}),i},toggleSaveTmplUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderTmplUI({})).done(function(e){i.scheduleTmplSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.tmplDialogMode("save"),i.cachedElements.$body.addClass("sek-save-tmpl-ui-visible")},200)}):(t=d.Deferred(),i.cachedElements.$body.removeClass("sek-save-tmpl-ui-visible"),0<d("#nimble-top-tmpl-save-ui").length?_.delay(function(){i.tmplDialogMode=i.tmplDialogMode?i.tmplDialogMode:new l.Value,i.tmplDialogMode("hidden"),i.saveUIContainer.remove(),t.resolve()},250):t.resolve(),t.promise()).done(function(){i.tmplDialogVisible(!1)})},setSavedTmplCollection:function(e){var t=this,i=d.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedTemplates()?((t.templateCollectionPromise&&"pending"===t.templateCollectionPromise.state()?t.templateCollectionPromise:t.getSavedTmplCollection()).done(function(e){t.allSavedTemplates(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedTemplates())},getSavedTmplCollection:function(){var t=this;return t.templateCollectionPromise=d.Deferred(),wp.ajax.post("sek_get_all_saved_tmpl",{nonce:l.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?(t.templateCollectionPromise.resolve(e),console.log("GET SAVED TMPL COLLECTION",e)):(t.templateCollectionPromise.resolve({}),l.errare("control::getSavedTmplCollection => error => tmpl collection is invalid",e))}).fail(function(e){l.errorLog("ajax sek_get_all_saved_tmpl => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.templateCollectionPromise.resolve({})}),t.templateCollectionPromise}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{getTmplJsonFromUserTmpl:function(e){var t=s.Deferred();return wp.ajax.post("sek_get_user_tmpl_json",{nonce:r.settings.nonce.save,tmpl_post_name:e}).done(function(e){t.resolve({success:!0,tmpl_json:e})}).fail(function(e){t.resolve({success:!1}),r.errorLog("ajax getTmplJsonFromUserTmpl => error",e),r.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>@missi18n error when fetching the template</strong>","</span>"].join("")})}),t},getTmplJsonFromApi:function(i){var o,n=s.Deferred();return o.apiTmplGalleryJson?(r.infoLog("cached api tmpl gallery json",o.apiTmplGalleryJson),n.resolve({success:!0,tmpl_json:o.apiTmplGalleryJson})):s.getJSON(sektionsLocalizedData.templateAPIUrl).done(function(e){if(!_.isObject(e)||!e.lib||!e.lib.templates)return r.errare("::get_gallery_tmpl_json_and_import success but invalid response => ",e),void n.resolve({success:!1});var t=e.lib.templates[i];if(!t)return r.errare("::get_gallery_tmpl_json_and_import => the requested template is not available",e.lib.templates),r.previewer.trigger("sek-notify",{notif_id:"missing-tmpl",type:"info",duration:1e4,message:['<span style="color:#0075a2">',"<strong>","@missi18n the requested template is not available","</strong>","</span>"].join("")}),void n.resolve({success:!1});o.apiTmplGalleryJson=t,n.resolve({success:!0,tmpl_json:o.apiTmplGalleryJson})}).fail(function(e){r.errare("::get_gallery_tmpl_json_and_import failed => ",e),n.resolve({success:!1})}),n.promise()},get_gallery_tmpl_json_and_import:function(t){var i=this,o=(t=s.extend({template_name:"",from:"user",tmpl_import_mode:"replace"},t||{})).template_name;!_.isEmpty(o)&&_.isString(o)||r.errare("::import => error => invalid template name"),("nimble_api"===t.from?i.getTmplJsonFromApi(o):i.getTmplJsonFromUserTmpl(o)).done(function(e){e.success&&i.import_tmpl_from_gallery({pre_import_check:!1,template_name:o,template_data:e.tmpl_json,tmpl_import_mode:t.tmpl_import_mode})})},import_tmpl_from_gallery:function(t){var i=this;t=t||{};var e;if(!(t=s.extend({is_file_import:!1,pre_import_check:!1,tmpl_import_mode:"replace"},t)).template_data)throw new Error("::import_template => missing remote template data");e=wp.ajax.post("sek_process_template_json",{nonce:r.settings.nonce.save,template_data:JSON.stringify(t.template_data),pre_import_check:!1}).done(function(e){}).fail(function(e){r.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Export failed"],encodeURIComponent(e)].join(" "),"</strong>","</span>"].join("")})}),r.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),_.delay(function(){"pending"===e.state()&&r.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>",sektionsLocalizedData.i18n['Import exceeds server response time, try to uncheck "import images" option.'],"</strong>","</span>"].join("")})},3e4),e.done(function(e){_.isObject(e)&&(e={success:!0,data:e}),r.czr_sektions.isImportedContentEligibleForAPI(e,t)?(e.data.data.collection=i.setIdsForImportedTmpl(e.data.data.collection),r.czr_sektions.doUpdateApiSettingAfter_TmplGalleryImport(e,t)):r.infoLog("::import_template problem => !api.czr_sektions.isImportedContentEligibleForAPI",e,t)}).fail(function(e){r.errare("::import_template => ajax error",e),r.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Import failed, file problem"],"</strong>","</span>"].join("")})})},doUpdateApiSettingAfter_TmplGalleryImport:function(e,t){if(t=t||{},r.czr_sektions.isImportedContentEligibleForAPI(e,t)||!t.is_file_import){r.czr_sektions.updateAPISetting({action:"sek-import-tmpl-from-gallery",scope:"local",imported_content:e.data,tmpl_import_mode:t.tmpl_import_mode}).done(function(){r.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),r.previewer.refresh(),r.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Template successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){r.errare("::doUpdateApiSettingAfter_TmplGalleryImport => error when firing ::updateAPISetting",e),r.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),r.previewer.refresh()}else r.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,e){jQuery.extend(CZRSeksPrototype,{getRevisionHistory:function(e){return wp.ajax.post("sek_get_revision_history",{nonce:r.settings.nonce.save,skope_id:e.is_local?r.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId})},setSingleRevision:function(i){var o=this,n=function(e,t){r.previewer.trigger("sek-notify",{notif_id:"restore-revision-error",type:t||"info",duration:1e4,message:['<span style="">',"<strong>",e||"","</strong>","</span>"].join("")})};wp.ajax.post("sek_get_single_revision",{nonce:r.settings.nonce.save,revision_post_id:i.revision_post_id}).done(function(e){var t=i.is_local?o.localSectionsSettingId():o.getGlobalSectionsSettingId();_.isEqual(r(t)(),e)?n(sektionsLocalizedData.i18n["This is the current version."],"info"):o.updateAPISetting({action:"sek-restore-revision",is_global_location:!i.is_local,revision_value:e}).done(function(){r.previewer.refresh()}).fail(function(e){r.errare("::setSingleRevision error when firing ::updateAPISetting",e),n(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}).fail(function(e){r.errare("::setSingleRevision ajax error",e),n(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}})}(wp.customize);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{setupSettingsToBeSaved:function(){var i,n=this,e={local:{collectionSettingId:n.localSectionsSettingId()},global:{collectionSettingId:n.getGlobalSectionsSettingId()}};_.each(e,function(e,t){if(i=c.czr_skopeBase.getSkopeProperty("sektions",t).db_values,_.isEmpty(e.collectionSettingId))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");if(!c.has(e.collectionSettingId)){c.CZR_Helpers.register({what:"setting",id:e.collectionSettingId,value:n.validateSettingValue(_.isObject(i)?i:n.getDefaultSektionSettingValue(t),t),transport:"postMessage",type:"option",track:!1,origin:"nimble"});c(e.collectionSettingId,function(o){o.bind(_.debounce(function(e,t,i){if(!_.isObject(i)||!0!==i.navigatingHistoryLogs)try{n.trackHistoryLog(o,i)}catch(e){c.errare("setupSettingsToBeSaved => trackHistoryLog",e)}},1e3))})}})},validateSettingValue:function(i,o){if(!_.isObject(i))return c.errare("::validateSettingValue => validation error => the setting should be an object",i),null;if(!_.isEmpty(o)&&_.contains(["local","global"],o)){var n={},r=!1,e=[],s=function(e){c.errare(e,i),sektionsLocalizedData.isDevMode&&c.previewer.trigger("sek-notify",{type:"error",duration:6e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")}),r=!0},a=function(t){if(!r)if(_.isUndefined(t)&&_.isEmpty(n)){if(t=l.extend(!0,{},i),_.isUndefined(t.id)||_.isUndefined(t.level)){if(_.isUndefined(t.collection))return void s("validation error => the root level is missing the collection of locations");if(!_.isEmpty(t.level)||!_.isEmpty(t.id))return void s('validation error => the root level should not have a "level" or an "id" property');_.each(t,function(e,t){switch(o){case"local":if(!_.contains(["collection","local_options","fonts"],t))return void s("validation error => unauthorized option group for local setting value => "+t);break;case"global":if(!_.contains(["collection","fonts"],t))return void s("validation error => unauthorized option group for global setting value => "+t)}}),_.each(i.collection,function(e){n=t,a(e)})}}else{if(_.isUndefined(t)||!_.isObject(t))return void s("validation error => a level is invalid");if(_.isEmpty(t.id)||!_.isString(t.id))return void s("validation error => a "+t.level+" level must have a valid id");if(_.contains(e,t.id))return void s("validation error => duplicated level id : "+t.id);if(e.push(t.id),_.isEmpty(t.level)||!_.isString(t.level))return void s("validation error => a "+t.level+" level must have a level property");if(!_.contains(["location","section","column","module"],t.level))return void s('validation error => the level "'+t.level+'" is not authorized');if("module"==t.level){if(!_.isUndefined(t.collection))return void s("validation error => a module can not have a collection property")}else if(_.isUndefined(t.collection))return void s("validation error => missing collection property for level => "+t.level+" "+t.id);switch(_.isUndefined(t.ver_ini)&&c.errare("validateSettingValue() => validation error => a "+t.level+' should have a version property : "ver_ini"'),t.level){case"location":if(!_.isEmpty(n.level))return void s("validation error => the parent of location "+t.id+" should have no level set");break;case"section":if(t.is_nested&&"column"!=n.level)return void s("validation error => the nested section "+t.id+" must be child of a column");if(!t.is_nested&&"location"!=n.level)return void s("validation error => the section "+t.id+" must be child of a location");break;case"column":if("section"!=n.level)return void s("validation error => the column "+t.id+" must be child of a section");break;case"module":if("column"!=n.level)return void s("validation error => the module "+t.id+" must be child of a column")}"module"!=t.level&&_.each(t.collection,function(e){n=l.extend(!0,{},t),_.isUndefined(e)?s("validation error => undefined level "):a(e)})}};return a(),r?null:i}c.errare("::validateSettingValue => invalid scope provided.",o)},resetCollectionSetting:function(e){if(_.isEmpty(e)||!_.contains(["local","global"],e))throw new Error("resetCollectionSetting => invalid scope provided.",e);return l.extend(!0,{},this.getDefaultSektionSettingValue(e))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,o){o.extend(CZRSeksPrototype,{reactToPreviewMsg:function(){var n=this,r={},s={},a=!0,e={"sek-add-section":{callback:function(e){return c.previewedDevice("desktop"),a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},r={action:"sek-add-section",id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),before_section:e.before_section,after_section:e.after_section,is_first_section:e.is_first_section},n.updateAPISetting(r)},complete:function(e){e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),c.previewer.trigger("sek-pick-content",{id:e.apiParams?e.apiParams.id:"",content_type:"section"}),c.previewer.send("sek-animate-to-level",{id:e.apiParams.id})}},"sek-add-column":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),action:"sek-add-column",in_sektion:e.in_sektion,autofocus:e.autofocus},n.updateAPISetting(r)},complete:function(e){!1!==e.apiParams.autofocus&&c.previewer.trigger("sek-pick-content",{})}},"sek-add-module":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),action:"sek-add-module",in_sektion:e.in_sektion,in_column:e.in_column,module_type:e.content_id,before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section},n.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)}),c.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_column,location_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-remove":{callback:function(e){switch(a=!0,s={},e.level){case"section":var t=n.getLevelModel(e.id);if("no_match"===t){c.errare("reactToPreviewMsg => sek-remove-section => no sektionToRemove matched");break}r={action:"sek-remove-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:t.is_nested};break;case"column":r={action:"sek-remove-column",id:e.id,in_sektion:e.in_sektion};break;case"module":r={action:"sek-remove-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;default:c.errare("::reactToPreviewMsg => sek-remove => missing level ",e)}return n.updateAPISetting(r)},complete:function(e){if(c.previewer.trigger("sek-pick-content",{}),n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)}),"sek-remove-section"===e.apiParams.action){var t=n.getLevelModel(e.apiParams.location);_.isEmpty(t.collection)&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location})}}},"sek-move":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-move-section",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),newOrder:e.newOrder,from_location:e.from_location,to_location:e.to_location};break;case"column":r={action:"sek-move-column",id:e.id,newOrder:e.newOrder,from_sektion:e.from_sektion,to_sektion:e.to_sektion};break;case"module":r={action:"sek-move-module",id:e.id,newOrder:e.newOrder,from_column:e.from_column,to_column:e.to_column,from_sektion:e.from_sektion,to_sektion:e.to_sektion}}return n.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-move-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),e.apiParams.from_location!=e.apiParams.to_location&&(c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.to_location}),c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.from_location}));break;case"sek-move-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-refresh-modules-in-column":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}}},"sek-move-section-up":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"up",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},n.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-up",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-move-section-down":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"down",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},n.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-duplicate":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-duplicate-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column)};break;case"column":r={action:"sek-duplicate-column",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;case"module":r={action:"sek-duplicate-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column}}return n.updateAPISetting(r)},complete:function(e){var t;switch(e.apiParams.action){case"sek-duplicate-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),t=e.apiParams.location,e.apiParams.is_nested&&c.previewer.refresh(),c.previewer.send("sek-animate-to-level",{id:e.apiParams.id});break;case"sek-duplicate-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_sektion;break;case"sek-duplicate-module":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_column}c.previewer.trigger("sek-refresh-stylesheet",{id:t,location_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-resize-columns":function(e){return a=!0,s={},r=e,n.updateAPISetting(r)},"sek-add-content-in-new-sektion":{callback:function(e){switch(a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},(r=e).action="sek-add-content-in-new-sektion",r.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),e.content_type){case"module":r.droppedModuleId=sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid();break;case"preset_section":c.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),c.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0})}return n.updateAPISetting(r)},complete:function(e){switch(e.apiParams.content_type){case"module":c.previewer.trigger("sek-edit-module",{level:"module",id:e.apiParams.droppedModuleId});break;case"preset_section":c.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)});var t=e.location_skope_id;_.isUndefined(t)&&(t=!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:c.czr_skopeBase.getSkopeProperty("skope_id")),c.previewer.trigger("sek-refresh-stylesheet",{location_skope_id:t,is_global_location:n.isGlobalLocation(e.apiParams)}),e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),e.apiParams.sektion_to_replace&&c.previewer.trigger("sek-remove",{id:e.apiParams.sektion_to_replace,location:e.apiParams.location,in_column:e.apiParams.in_column,level:"section"})}},"sek-add-preset-section-in-new-nested-sektion":{callback:function(e){return a=!1,s={},(r=e).action="sek-add-preset-section-in-new-nested-sektion",c.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),n.updateAPISetting(r)},complete:function(e){n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)}),c.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_sektion,location_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")}),c.previewer.trigger("sek-refresh-level",{level:"section",id:e.apiParams.in_sektion})}},"sek-pick-content":function(e){return e=_.isObject(e)?e:{},c.czr_sektions.currentContentPickerType=c.czr_sektions.currentContentPickerType||new c.Value,_.isObject(e)&&e.id&&n.lastClickedTargetInPreview({id:e.id}),a=!0,r={},s={action:"sek-generate-draggable-candidates-picker-ui",content_type:(e=e||{}).content_type||"module",was_triggered:!_.has(e,"was_triggered")||e.was_triggered,focus:!_.has(e,"focus")||e.focus},n.generateUI(s)},"sek-edit-options":function(e){return a=!0,r={},_.isEmpty(e.id)?o.Deferred(function(){this.reject("missing id")}):(s={action:"sek-generate-level-options-ui",location:e.location,level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},n.generateUI(s))},"sek-edit-module":function(e){return a=!0,r={},s={action:"sek-generate-module-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},n.generateUI(s)},"sek-notify":function(t){a=!1;var i=t.notif_id||"sek-notify";return n.lastNimbleNotificationId&&c.notifications.remove(n.lastNimbleNotificationId),o.Deferred(function(){c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification(i,{type:t.type||"info",message:t.message,dismissible:!0})),n.lastNimbleNotificationId=i,_.delay(function(){c.notifications.remove(i)},t.duration||5e3)}),this.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-refresh-level":function(t){return a=!0,o.Deferred(function(e){r={action:"sek-refresh-level",level:t.level,id:t.id,original_action:t.original_action,moved_level_id:t.moved_level_id},s={},e.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-refresh-stylesheet":function(t){return a=!0,t=t||{},o.Deferred(function(e){r={id:t.id},s={},e.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-toggle-save-section-ui":function(t){return a=!1,n.idOfSectionToSave=t.id,n.saveSectionDialogVisible(!0),o.Deferred(function(e){r={},s={},e.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-reset-collection":{callback:function(e){return a=!1,s={},(r=e).action="sek-reset-collection",r.scope=e.scope,n.updateAPISetting(r)},complete:function(e){c.previewer.refresh(),c.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}}};_.each(e,function(i,o){c.previewer.bind(o,function(t){var e;if(_.isFunction(i))e=i;else{if(!_.isFunction(i.callback))return void c.errare("::reactToPreviewMsg => invalid callback for action "+o);e=i.callback}"sek-notify"!==o&&(n.templateGalleryExpanded(!1),n.tmplDialogVisible(!1));try{e(t).done(function(e){e=e||{},a?c.previewer.send(o,{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:c.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:r,uiParams:s,cloneId:!_.isEmpty(e.cloneId)&&e.cloneId,all_params:t}):c.previewer.trigger([o,"done"].join("_"),{apiParams:r,uiParams:s}),n.trigger([o,"done"].join("_"),t)}).fail(function(e){c.errare("reactToPreviewMsg => problem or error when running action "+o,e),!_.isEmpty(e)&&sektionsLocalizedData.isDevMode&&c.previewer.trigger("sek-notify",{type:"error",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")})})}catch(e){c.errare("reactToPreviewMsg => error when receiving "+o,e)}})}),_.each(e,function(t,i){c.previewer.bind([i,"done"].join("_"),function(e){if(_.isFunction(t.complete))try{t.complete(e)}catch(e){c.errare("reactToPreviewMsg done => error when receiving "+[i,"done"].join("_"),e)}})})},schedulePrintSectionJson:function(){var i=this;c.previewer.bind("sek-to-json",function(e){var t=o.extend(!0,{},i.getLevelModel(e.id));console.log(JSON.stringify(i.cleanIds(t)))})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(k,y){y.extend(CZRSeksPrototype,{generateUI:function(e){var t=this,i=y.Deferred();switch(_.isEmpty(e.action)&&i.reject("generateUI => missing action"),e.action){case"sek-generate-module-ui":try{i=t.generateUIforFrontModules(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-level-options-ui":try{i=t.generateUIforLevelOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-draggable-candidates-picker-ui":t.cleanRegistered();try{i=t.generateUIforDraggableContent(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}k.czr_sektions.currentContentPickerType(e.content_type||"module");break;case"sek-generate-local-skope-options-ui":t.cleanRegistered();try{i=t.generateUIforLocalSkopeOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-global-options-ui":t.cleanRegistered();try{i=t.generateUIforGlobalOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}}return"pending"==i.state()?i.resolve().promise():i.promise()},updateAPISettingAndExecutePreviewActions:function(n){if(!_.isEmpty(n.settingParams)&&_.has(n.settingParams,"to")){var r,s=this,e=n.settingParams.to,t=null,a=!1;if(!_.isEmpty(n.settingParams.args)&&_.has(n.settingParams.args,"moduleRegistrationParams")){var c=n.settingParams.args.moduleRegistrationParams.control,i=n.settingParams.args.moduleRegistrationParams.id,o=c.czr_Module(i);if(_.isEmpty(o)?k.errare("updateAPISettingAndExecutePreviewActions => missing parentModuleInstance",n):(t=o.module_type,a=o.isMultiItem()),!a&&_.isObject(e)?r=s.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!1}):(r=[],_.each(e,function(e){r.push(s.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!0}))})),_.isEmpty(n.defaultPreviewAction))k.errare("updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.",n);else{var l,d="refresh_stylesheet"===n.defaultPreviewAction,u="refresh_markup"===n.defaultPreviewAction,p="refresh_fonts"===n.defaultPreviewAction,m="refresh_preview"===n.defaultPreviewAction,f=n.settingParams.args.input_changed,g=function(){return l&&_.isString(l.refresh_markup)&&"true"!==l.refresh_markup&&"false"!==l.refresh_markup};_.isUndefined(f)||(l=s.getInputRegistrationParams(f,t),_.isUndefined(l.refresh_stylesheet)||(d=Boolean(l.refresh_stylesheet)),_.isUndefined(l.refresh_markup)||(u=g()?l.refresh_markup:Boolean(l.refresh_markup)),_.isUndefined(l.refresh_fonts)||(p=Boolean(l.refresh_fonts)),_.isUndefined(l.refresh_preview)||(m=Boolean(l.refresh_preview)));var h=function(){if(!0!==n.isGlobalOptions)return s.updateAPISetting({action:n.uiParams.action,id:n.uiParams.id,value:r,in_column:n.uiParams.in_column,in_sektion:n.uiParams.in_sektion,options_type:n.options_type,settingParams:n.settingParams}).done(function(e){var t;!0===d&&k.previewer.send("sek-refresh-stylesheet",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-stylesheet",id:n.uiParams.id,level:n.uiParams.level}}),a&&n.settingParams.args.inputRegistrationParams&&_.isFunction(n.settingParams.args.inputRegistrationParams.input_parent)&&(t=n.settingParams.args.inputRegistrationParams.input_parent.id);var i=function(){k.previewer.send("sek-refresh-level",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-level",id:n.uiParams.id,level:n.uiParams.level,changed_item_id:t,control_id:c.id,is_multi_items:a},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})};if(!0===u&&i(),g()){var o=n.settingParams.args.input_value;if(!_.isString(o))throw new Error("::updateAPISettingAndExecutePreviewActions => _doUpdateWithRequestedAction => refreshMarkupWhenNeededForInput => html content is not a string.");s.htmlIncludesElementsThatNeedAnAjaxRefresh(o)?i():k.previewer.send("sek-update-html-in-selector",{selector:l.refresh_markup,changed_item_id:t,is_multi_items:a,html:o,id:n.uiParams.id,location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-update-html-in-selector",id:n.uiParams.id,level:n.uiParams.level},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})}!0===m&&k.previewer.refresh()}).fail(function(e){k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated",e),k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated => params ",n)});if(_.isEmpty(n.options_type))k.errare("updateAPISettingAndExecutePreviewActions => error when updating the global options => missing options_type");else{var e=k(sektionsLocalizedData.optNameForGlobalOptions)(),t=y.extend(!0,{},_.isObject(e)?e:{}),i={};if(_.each(r||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(i[t]=e)}),t[n.options_type]=i,k(sektionsLocalizedData.optNameForGlobalOptions)(t),!1!==m&&k.previewer.refresh(),!0===p){var o=n.settingParams.args.input_value;if(!_.isString(o))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",o);s.updateGlobalGFonts(o)}!0===d&&k.previewer.send("sek-refresh-stylesheet",{local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),location_skope_id:sektionsLocalizedData.globalSkopeId})}};if(!0===p){var v=n.settingParams.args.input_value;if(!_.isString(v))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",v);!0===n.isGlobalOptions?h():s.updateAPISetting({action:"sek-update-fonts",font_family:v,is_global_location:s.isGlobalLocation(n.uiParams)}).always(function(){h().then(function(){s.updateAPISetting({action:"sek-update-fonts",is_global_location:s.isGlobalLocation(n.uiParams)})})})}else h()}}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated",n)}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated",n)},updateGlobalGFonts:function(e){var t=k(sektionsLocalizedData.optNameForGlobalOptions)(),i=y.extend(!0,{},_.isObject(t)?t:{}),o=this.sniffGlobalGFonts(i);!_.isEmpty(e)&&_.isString(e)&&-1<e.indexOf("gfont")&&!_.contains(o,e)&&o.push(e),i.fonts=o,k(sektionsLocalizedData.optNameForGlobalOptions)(i)},sniffGlobalGFonts:function(e){var i=[],o=function(e){_.each(e,function(e,t){"fonts"!==t&&(_.isString(t)&&-1<t.indexOf("font_family")&&-1<e.indexOf("gfont")&&!_.contains(i,e)&&i.push(e),(_.isArray(e)||_.isObject(e))&&o(e))})};return(_.isArray(e)||_.isObject(e))&&o(e),i},normalizeAndSanitizeSingleItemInputValues:function(n){var i,r={},o={},s=null,a=this;return _.each(n.item_value,function(e,t){var i,o;"title"!==t&&((n.is_multi_items||"id"!==t)&&(null!==n.parent_module_type&&"id"!==t&&"no_default_value_specified"===(s=a.getInputDefaultValue(t,n.parent_module_type))&&k.infoLog("::normalizeAndSanitizeSingleItemInputValues => missing default value for input "+t+" in module "+n.parent_module_type),i=e,o=s,(_.isBoolean(i)||_.isBoolean(o)?Boolean(i)===Boolean(o):_.isNumber(i)||_.isNumber(o)?Number(i)===Number(o):_.isString(i)||_.isString(o)?i+""==o+"":_.isObject(i)&&_.isObject(o)?_.isEqual(i,o):_.isArray(i)&&_.isArray(o)?JSON.stringify(i.sort())===JSON.stringify(o.sort()):i===o)||(_.isString(e)||_.isObject(e))&&_.isEmpty(e)||(r[t]=e)))}),_.each(r,function(e,t){switch(a.getInputType(t,n.parent_module_type)){case"text":case"textarea":case"check":case"gutencheck":case"select":case"radio":case"number":case"upload":case"upload_url":case"color":case"wp_color_alpha":case"wp_color":case"content_picker":case"detached_tinymce_editor":case"nimble_tinymce_editor":case"password":case"range":case"range_slider":case"hidden":case"h_alignment":case"h_text_alignment":case"spacing":case"bg_position":case"v_alignment":case"font_size":case"line_height":case"font_picker":default:i=e}o[t]=i}),o},isUIControlAlreadyRegistered:function(t){var e=_.filter(this.registered(),function(e){return e.id==t&&"control"===e.what}),i=!1;return _.isEmpty(e)?i=k.control.has(t):(i=!0,1<e.length&&k.errare("isUIControlAlreadyRegistered => why is this control registered more than once ? => "+t)),i},htmlIncludesElementsThatNeedAnAjaxRefresh:function(e){var t=e.match(/\[+([\w_-])+/g),i=e.match(/\{\{+([\w_-])+/g),o=e.match(/<script[\s\S]*?>[\s\S]*?<\/script>/gi),n=[],r=[];if(t)for(var s=0;s<t.length;s++){var a=t[s].replace(/^\[+/g,"");-1===n.indexOf(a)&&n.push(a)}if(i)for(var c=0;c<i.length;c++){var l=i[c].replace(/^\[+/g,"");-1===r.indexOf(l)&&r.push(l)}return!_.isEmpty(n)||!_.isEmpty(r)||!_.isEmpty(o)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(s,a){a.extend(CZRSeksPrototype,{generateUIforDraggableContent:function(r,e){var o=this,i={};a.extend(i,{sek_content_type_switcher_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+"_sek_content_type_switcher_ui",module_type:"sek_content_type_switcher_module",controlLabel:o.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),priority:10,settingValue:{content_type:r.content_type}},sek_module_picker_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+"_sek_draggable_modules_ui",module_type:"sek_module_picker_module",controlLabel:o.getRegisteredModuleProperty("sek_module_picker_module","name"),content_type:"module",priority:20,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'},sek_my_sections_sec_picker_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()+"_sek_draggable_sections_ui",module_type:"sek_my_sections_sec_picker_module",controlLabel:o.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),content_type:"section",expandAndFocusOnInit:!1,priority:10,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>',is_new:!0}}),_.each(["sek_intro_sec_picker_module","sek_features_sec_picker_module","sek_about_sec_picker_module","sek_contact_sec_picker_module","sek_team_sec_picker_module","sek_column_layouts_sec_picker_module","sek_header_sec_picker_module","sek_footer_sec_picker_module"],function(e,t){i[e]={settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()+"_sek_draggable_sections_ui",module_type:e,controlLabel:o.getRegisteredModuleProperty(e,"name"),content_type:"section",expandAndFocusOnInit:0===t,priority:30,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'}});var t=_.keys(i)[0],n=i[t].settingControlId;return o.isUIControlAlreadyRegistered(n)?s.control(n,function(t){t.focus({completeCallback:function(){var e=t.container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}})}):(_do_register_=function(){_.each(i,function(n,e){s.has(n.settingControlId)||(s(n.settingControlId,function(e){e.bind(function(e,t){s.errare("generateUIforDraggableContent => the setting() should not changed")})}),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:n.settingControlId,dirty:!1,value:n.settingValue||{},transport:"postMessage",type:"_nimble_ui_"})),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:o.SECTION_ID_FOR_CONTENT_PICKER,priority:n.priority||10,settings:{default:n.settingControlId},track:!1}).done(function(){s.control(n.settingControlId,function(e){e.content_type=n.content_type,!0===r.focus&&e.focus({completeCallback:function(){}});var t=e.container.find("label > .customize-control-title"),i=t.html();if(t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),n.is_new){var o=t.html();t.html(o+' <span class="sek-new-label">New!</span>')}_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),"section"===e.content_type?(e.container.attr("data-sek-expanded","false"),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&e.container.addClass("sek-expand-on-init")):e.container.attr("data-sek-accordion","no")})})}),s.trigger("nimble-modules-and-sections-controls-registered")},s.section(o.SECTION_ID_FOR_CONTENT_PICKER,function(e){_do_register_();var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.prepend('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),0<i.length&&i.find(".sek-level-option-icon").length<1&&i.find(".customize-action").after('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e,{expand_first_control:!1}),e.container.find(".customize-control.sek-expand-on-init").find("label > .customize-control-title").trigger("click")})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,u){u.extend(CZRSeksPrototype,{generateUIforFrontModules:function(r,e){var s=this;_.isEmpty(r.id)&&e.reject("generateUI => missing id");var i=s.getLevelProperty({property:"value",id:r.id}),t=s.getLevelProperty({property:"module_type",id:r.id}),o=s.getRegisteredModuleProperty(t,"name");_.isEmpty(t)&&e.reject("generateUI => module => invalid module_type");var n={};if(!0===s.getRegisteredModuleProperty(t,"is_father")){var a=s.getRegisteredModuleProperty(t,"children");if(_.isEmpty(a))throw new Error("::generateUIforFrontModules => a father module "+t+" is missing children modules ");_.each(a,function(e,t){n[t]={settingControlId:r.id+"__"+t,module_type:e,controlLabel:s.getRegisteredModuleProperty(e,"name")}})}else n.__no_option_group_to_be_updated_by_children_modules__={settingControlId:r.id,module_type:t,controlLabel:o};var c=_.keys(n)[0],l=n[c].settingControlId;return s.isUIControlAlreadyRegistered(l)?d.control(l).focus({completeCallback:function(){var e=d.control(l).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(s.cleanRegistered(),_do_register_=function(){_.each(n,function(o,n){if(!d.has(o.settingControlId)){var t=function(e,t,i){try{s.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_markup",uiParams:_.extend(r,{action:"sek-set-module-value"}),options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){d.errare("::generateUIforFrontModules => Error in updateAPISettingAndExecutePreviewActions",e)}};d(o.settingControlId,function(e){e.bind(_.debounce(t,s.SETTING_UPDATE_BUFFER))});var e=u.extend(!0,{},i);"__no_option_group_to_be_updated_by_children_modules__"!==n&&(e=!_.isEmpty(e)&&_.isObject(e)&&_.isObject(e[n])?e[n]:{}),d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:o.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",module_id:r.id,id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:r.id,priority:20,settings:{default:o.settingControlId}}).done(function(){}),d.control(o.settingControlId,function(e){d.control(o.settingControlId).focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=u("<div/>").html(t.html()).text();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false")})})},d.section(r.id,function(e){d.section(r.id).focus(),s.generateModuleOptionSwitcherUI(r.id,r.action),_do_register_(),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".customize-action").after('<i class="fas fa-pencil-alt sek-level-option-icon"></i>'),s.scheduleModuleAccordion.call(e,{expand_first_control:!0})}),d.CZR_Helpers.register({origin:"nimble",what:"section",id:r.id,title:sektionsLocalizedData.i18n["Content for"]+" "+o,panel:sektionsLocalizedData.sektionsPanelId,priority:1e3}).done(function(){})),e},generateModuleOptionSwitcherUI:function(e,t){var i=e+"__option_switcher";d.has(i)||(d(i,function(e){e.bind(function(e,t){d.errare("generateUIforDraggableContent => the setting() should not changed")})}),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"setting",id:i,dirty:!1,value:"",transport:"postMessage",type:"_nimble_ui_"})),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"control",module_id:e,id:i,label:"",type:"czr_module",module_type:"sek_mod_option_switcher_module",section:e,priority:10,settings:{default:i},has_accordion:!1,ui_action:t}).done(function(){d.control(i,function(e){e.deferred.embedded.done(function(){e.container.find(".customize-control-title").hide(),e.container.attr("data-sek-accordion","no")})})})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{generateUIforLevelOptions:function(s,e){var a=this,c=a.getLevelProperty({property:"options",id:s.id});c=_.isObject(c)?c:{};var t={};l.trigger("nb_setup_level_ui_registration_params",{params:s,modulesRegistrationParams:t}),d.extend(t,{bg:{settingControlId:s.id+"__bg_options",module_type:"sek_level_bg_module",controlLabel:sektionsLocalizedData.i18n["Background settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">gradient</i>'}}),"section"===s.level&&d.extend(t,{level_text:{settingControlId:s.id+"__text_options",module_type:"sek_level_text_module",controlLabel:sektionsLocalizedData.i18n["Text settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">text_format</i>'}}),d.extend(t,{border:{settingControlId:s.id+"__border_options",module_type:"sek_level_border_module",controlLabel:sektionsLocalizedData.i18n["Borders settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">rounded_corner</i>'},spacing:{settingControlId:s.id+"__spacing_options",module_type:"sek_level_spacing_module",controlLabel:sektionsLocalizedData.i18n["Padding and margin settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">center_focus_weak</i>'},anchor:{settingControlId:s.id+"__anchor_options",module_type:"sek_level_anchor_module",controlLabel:sektionsLocalizedData.i18n["Custom anchor ( CSS ID ) and CSS classes for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-anchor sek-level-option-icon"></i>'},visibility:{settingControlId:s.id+"__visibility_options",module_type:"sek_level_visibility_module",controlLabel:sektionsLocalizedData.i18n["Device visibility settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="far fa-eye sek-level-option-icon"></i>'},height:{settingControlId:s.id+"__height_options",module_type:"sek_level_height_module",controlLabel:sektionsLocalizedData.i18n["Height, vertical alignment, z-index for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-vertical sek-level-option-icon"></i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{animation:{settingControlId:s.id+"__animate_options",module_type:"sek_level_animation_module",controlLabel:sektionsLocalizedData.i18n["Animation settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">movie_filter</i>',isPro:!0}}),"section"===s.level&&(d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_section",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),d.extend(t,{breakpoint:{settingControlId:s.id+"__breakpoint_options",module_type:"sek_level_breakpoint_module",controlLabel:sektionsLocalizedData.i18n["Responsive settings : breakpoint, column direction"],icon:'<i class="material-icons sek-level-option-icon">devices</i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{sec_custom_css:{settingControlId:s.id+"__sec_custom_css",module_type:"sek_level_cust_css_section",controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>',isPro:!0}})),"column"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_column",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),"module"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_module",controlLabel:sektionsLocalizedData.i18n["Width and horizontal alignment for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}});var i=_.keys(t)[0],o=t[i].settingControlId;return a.isUIControlAlreadyRegistered(o)?l.control(o).focus({completeCallback:function(){var e=l.control(o).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(a.cleanRegistered(),_do_register_=function(){_.each(t,function(o,n){if(a.isUIControlAlreadyRegistered(o.settingControlId))l.section(l.control(o.settingControlId).section()).expanded(!0);else{if(!l.has(o.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:s,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){l.errare("::generateUIforLevelOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};l(o.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=c[n]||{},i=a.getModuleStartingValue(o.module_type);if("no_starting_value"!==i&&_.isObject(i)){var r=d.extend(!0,{},i);e=d.extend(r,e)}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:o.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}l.CZR_Helpers.register({origin:"nimble",level:s.level,level_id:s.id,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:s.id,priority:20,settings:{default:o.settingControlId}}).done(function(){}),l.control(o.settingControlId,function(e){!0===o.expandAndFocusOnInit&&e.focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),o.isPro&&!sektionsLocalizedData.isPro&&t.append(['<img class="sek-pro-icon-next-title" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_orange.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})}})},l.section(s.id,function(e){_do_register_(),"module"===s.level&&a.generateModuleOptionSwitcherUI(s.id,s.action),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.find(".customize-action").after('<i class="fas fa-sliders-h sek-level-option-icon"></i>'),a.scheduleModuleAccordion.call(e,{expand_first_control:!1})}),l.CZR_Helpers.register({origin:"nimble",what:"section",id:s.id,title:sektionsLocalizedData.i18n["Settings for the"]+" "+s.level,panel:sektionsLocalizedData.sektionsPanelId,priority:10}).done(function(){})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{getLocalSkopeOptionId:function(){var e=l.czr_skopeBase.getSkopeProperty("skope_id");return _.isEmpty(e)?(l.errare("czr_sektions::getLocalSkopeOptionId => empty skope_id "),""):sektionsLocalizedData.optPrefixForSektionsNotSaved+e+"__localSkopeOptions"},generateUIforLocalSkopeOptions:function(s,e){var a=this,i=a.getLocalSkopeOptionId();if(a.isUIControlAlreadyRegistered(i))return e;if(a.localOptionsRegistrationParams={},_.isUndefined(sektionsLocalizedData.localOptionsMap)||!_.isObject(sektionsLocalizedData.localOptionsMap))return l.errare("::generateUIforGlobalOptions => missing or invalid localOptionsMap"),e;!0===s.clean_settings&&a.cleanRegisteredLocalOptionSettings(),_.each(sektionsLocalizedData.localOptionsMap,function(e,t){switch(t){case"template":a.localOptionsRegistrationParams[t]={settingControlId:i+"__template",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page template"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">check_box_outline_blank</i>'};break;case"local_header_footer":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"widths":a.localOptionsRegistrationParams[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Inner and outer widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"custom_css":a.localOptionsRegistrationParams[t]={settingControlId:i+"__custom_css",module_type:e,controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>'};break;case"local_performances":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"local_reset":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections in this page"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"local_revisions":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of local sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"import_export":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;default:l.errare("::generateUIforLocalOptions => an option group could not be registered => "+e,t)}});var t=l(a.localSectionsSettingId())(),c=d.extend(!0,{},_.isObject(t.local_options)?t.local_options:{});return _do_register_=function(){_.each(a.localOptionsRegistrationParams,function(o,n){var e=a.getModuleStartingValue(o.module_type),t=_.isObject(c[n])?c[n]:{};if(!l.has(o.settingControlId)){var i=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_preview",uiParams:s,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){l.errare("::generateUIforLocalSkopeOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};if(l(o.settingControlId,function(e){e.bind(_.debounce(i,a.SETTING_UPDATE_BUFFER))}),"no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);t=d.extend(r,t)}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:o.settingControlId,dirty:!1,value:t,transport:"postMessage",type:"_nimble_ui_"})}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:a.SECTION_ID_FOR_LOCAL_OPTIONS,priority:10,settings:{default:o.settingControlId}}).done(function(){l.control(o.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{generateUIforGlobalOptions:function(s,e){var a=this,i=sektionsLocalizedData.optPrefixForSektionsNotSaved+sektionsLocalizedData.optNameForGlobalOptions;if(a.isUIControlAlreadyRegistered(i))return e;var o={};if(_.isUndefined(sektionsLocalizedData.globalOptionsMap)||!_.isObject(sektionsLocalizedData.globalOptionsMap))return l.errare("::generateUIforGlobalOptions => missing or invalid globalOptionsMap"),e;_.each(sektionsLocalizedData.globalOptionsMap,function(e,t){switch(t){case"global_text":o[t]={settingControlId:i+"__global_text",module_type:e,controlLabel:sektionsLocalizedData.i18n["Global text options for Nimble sections"],icon:'<i class="material-icons sek-level-option-icon">text_format</i>'};break;case"widths":o[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide inner and outer sections widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"breakpoint":o[t]={settingControlId:i+"__breakpoint",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide breakpoint for Nimble sections"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">devices</i>'};break;case"global_header_footer":o[t]={settingControlId:i+"__header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"performances":o[t]={settingControlId:i+"__performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"recaptcha":o[t]={settingControlId:i+"__recaptcha",module_type:e,controlLabel:sektionsLocalizedData.i18n["Protect your contact forms with Google reCAPTCHA"],icon:'<i class="material-icons sek-level-option-icon">security</i>'};break;case"global_revisions":o[t]={settingControlId:i+"__global_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of global sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"global_imp_exp":o[t]={settingControlId:i+"__global_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import global sections"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;case"global_reset":o[t]={settingControlId:i+"__global_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections displayed in global locations"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"beta_features":o[t]={settingControlId:i+"__beta_features",module_type:e,controlLabel:sektionsLocalizedData.i18n["Beta features"],icon:'<i class="material-icons sek-level-option-icon">widgets</i>'};break;default:l.errare("::generateUIforGlobalOptions => an option group could not be registered => "+e,t)}});var c=sektionsLocalizedData.globalOptionDBValues;return _do_register_=function(){_.each(o,function(o,n){if(!l.has(o.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({isGlobalOptions:!0,defaultPreviewAction:"refresh_preview",uiParams:s,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){l.errare("::generateUIforGlobalOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};l(o.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=a.getModuleStartingValue(o.module_type),i=_.isObject(c)&&!_.isEmpty(c[n])?c[n]:{};if("no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);i=d.extend(r,i)}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:o.settingControlId,dirty:!1,value:i,transport:"postMessage",type:"_nimble_ui_"})}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:a.SECTION_ID_FOR_GLOBAL_OPTIONS,priority:20,settings:{default:o.settingControlId},track:!1}).done(function(){l.control(o.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(m,f){f.extend(CZRSeksPrototype,{updateAPISetting:function(l){var d=this;(l=l||{}).is_global_location="global"===l.scope||d.isGlobalLocation(l);var u=l.is_global_location?d.getGlobalSectionsSettingId():d.localSectionsSettingId(),p=m(u)();d.updAPISetParams={params:l,promise:f.Deferred(),newSetValue:_.isObject(p)?f.extend(!0,{},p):d.getDefaultSektionSettingValue(l.is_global_location?"global":"local"),cloneId:"",sectionInjectPromise:"_not_injection_scenario_"};return m(u,function(e){!function(){switch(d.updAPISetParams.newSetValue.collection=_.isArray(d.updAPISetParams.newSetValue.collection)?d.updAPISetParams.newSetValue.collection:d.getDefaultSektionSettingValue(l.is_global_location?"global":"local").collection,l.action){case"sek-maybe-add-missing-locations":var t,i;d.activeLocations(),f.extend(!0,[],d.updAPISetParams.newSetValue.collection),_.each(d.activeLocations(),function(e){t=_.findWhere(d.updAPISetParams.newSetValue.collection,{id:e}),_.isUndefined(t)&&((i=f.extend(!0,{},sektionsLocalizedData.defaultLocationModel)).id=e,m.infoLog("=> adding missing location to api setting value",i),d.updAPISetParams.newSetValue.collection.push(i))});break;case"sek-add-section":d._updAPISet_sek_add_sektion();break;case"sek-duplicate-section":d._updAPISet_sek_duplicate_sektion();break;case"sek-remove-section":d._updAPISet_sek_remove_sektion();break;case"sek-move-section":d._updAPISet_sek_move_sektion();break;case"sek-move-section-up-down":d._updAPISet_sek_move_sektion_up_down();break;case"sek-add-column":d._updAPISet_sek_add_column();break;case"sek-remove-column":d._updAPISet_sek_remove_column();break;case"sek-duplicate-column":d._updAPISet_sek_duplicate_column();break;case"sek-resize-columns":d._updAPISet_sek_resize_column();break;case"sek-move-column":d._updAPISet_sek_move_column();break;case"sek-add-module":d._updAPISet_sek_add_module();break;case"sek-duplicate-module":d._updAPISet_sek_duplicate_module();break;case"sek-remove-module":d._updAPISet_sek_remove_module();break;case"sek-move-module":d._updAPISet_sek_move_module();break;case"sek-set-module-value":d._updAPISet_sek_set_module_value();break;case"sek-add-content-in-new-sektion":d._updAPISet_sek_add_content_in_new_sektion();break;case"sek-add-preset-section-in-new-nested-sektion":d._updAPISet_sek_add_preset_sektion_in_new_nested_sektion();break;case"sek-import-from-file":d._updAPISet_sek_import_from_file();break;case"sek-import-tmpl-from-gallery":d._updAPISet_sek_import_tmpl_from_gallery();break;case"sek-generate-level-options-ui":var e=d.getLevelModel(l.id,d.updAPISetParams.newSetValue.collection),o={};if("no_match"===e){m.errare("updateAPISetting => "+l.action+" => no parent sektion matched"),d.updAPISetParams.promise.reject("updateAPISetting => "+l.action+" => no parent sektion matched");break}var n=f.extend(!0,{},e.options||{});_.each(l.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(l.options_type)&&m.errare("updateAPISetting => "+l.action+" => missing options_type"),n[l.options_type]=o,e.options=n;break;case"sek-generate-local-skope-options-ui":o={};var r=f.extend(!0,{},_.isObject(d.updAPISetParams.newSetValue.local_options)?d.updAPISetParams.newSetValue.local_options:{});if(_.each(l.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(l.options_type)||!_.isString(l.options_type))m.errare("updateAPISetting => "+l.action+" => missing options_type");else{var s={};s[l.options_type]=o,d.updAPISetParams.newSetValue.local_options=f.extend(r,s)}break;case"sek-update-fonts":var a=d.sniffGFonts({is_global_location:l&&!0===l.is_global_location});!_.isEmpty(l.font_family)&&_.isString(l.font_family)&&-1<l.font_family.indexOf("gfont")&&!_.contains(a,l.font_family)&&a.push(l.font_family),d.updAPISetParams.newSetValue.fonts=a;break;case"sek-restore-revision":d.updAPISetParams.newSetValue=l.revision_value;break;case"sek-reset-collection":try{d.updAPISetParams.newSetValue=m.czr_sektions.resetCollectionSetting(l.scope)}catch(e){m.errare("sek-reset-collection => error when firing resetCollectionSetting()",e)}}if("pending"==d.updAPISetParams.promise.state()){var c=function(){var e=l.settingParams&&l.settingParams.from&&l.settingParams.to;e&&_.isEqual(l.settingParams.from,l.settingParams.to)?d.updAPISetParams.promise.reject("updateAPISetting => main sektion setting change => the new setting value is unchanged when firing action : "+l.action):!e&&_.isEqual(p,d.updAPISetParams.newSetValue)?d.updAPISetParams.promise.reject("updateAPISetting => the new setting value is unchanged when firing action : "+l.action):null!==d.validateSettingValue(d.updAPISetParams.newSetValue,l.is_global_location?"global":"local")?(m(u)(d.updAPISetParams.newSetValue,l),l.cloneId=d.updAPISetParams.cloneId,d.updAPISetParams.promise.resolve(l)):d.updAPISetParams.promise.reject("Validation problem for action "+l.action)};"_not_injection_scenario_"===d.updAPISetParams.sectionInjectPromise?(c(),"pending"===d.updAPISetParams.promise.state()&&m.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")):d.updAPISetParams.sectionInjectPromise.done(function(){c(),"pending"===d.updAPISetParams.promise.state()&&m.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")}).fail(function(e){m.errare("updateAPISetting => self.updAPISetParams.sectionInjectPromise failed",e)})}}()}),d.updAPISetParams.promise.promise()},resetColumnsWidthInSection:function(e){_.each(e.collection,function(e){e.options&&e.options.width&&e.options.width["custom-width"]&&(e.options.width=_.omit(e.options.width,"custom-width")),e.width=""})},_maybeFetchSectionsFromServer:function(){var e,t=f.Deferred();return _.isEmpty(m.sek_presetSections)?(_.isUndefined(m.sek_fetchingPresetSections)||"pending"!=m.sek_fetchingPresetSections.state()?(e=wp.ajax.post("sek_get_preset_sections",{nonce:m.settings.nonce.save}),m.sek_fetchingPresetSections=e):e=m.sek_fetchingPresetSections,e.done(function(e){m.sek_presetSections=e,t.resolve(m.sek_presetSections)}).fail(function(e){t.reject(e)})):t.resolve(m.sek_presetSections),t.promise()},getPresetSectionCollection:function(o){var n=this,r=f.Deferred();return o.is_user_section?wp.ajax.post("sek_get_user_section_json",{nonce:m.settings.nonce.save,section_post_name:o.presetSectionId}).done(function(e){if(!_.isObject(e)||_.isEmpty(e)||_.isUndefined(e.data))throw m.errare("getPresetSectionCollection => preset section type not found or empty : "+o.presetSectionId,e),new Error("getPresetSectionCollection => preset section type not found or empty");var t=f.extend({},!0,e.data);t.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),t.collection=n.setPresetOrUserSectionIds(t.collection),t.ver_ini=sektionsLocalizedData.nimbleVersion,t.collection=n.setPresetSectionVersion(t.collection),r.resolve(t)}).fail(function(e){r.reject(e)}):n._maybeFetchSectionsFromServer().fail(function(e){r.reject(e)}).done(function(e){var t=f.extend(!0,{},_.isObject(e)?e:{});if(_.isEmpty(t))throw new Error("getPresetSectionCollection => Invalid collection");if(_.isEmpty(t[o.presetSectionId]))throw new Error('getPresetSectionCollection => the preset section : "'+o.presetSectionId+'" has not been found in the collection');var i=t[o.presetSectionId];i.collection=n.setPresetOrUserSectionIds(i.collection),i.ver_ini=sektionsLocalizedData.nimbleVersion,i.collection=n.setPresetSectionVersion(i.collection),r.resolve(i)}),r.promise()},setPresetOrUserSectionIds:function(e){var t=this;return _.isArray(e)&&_.each(e,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),_.isArray(e.collection)&&t.setPresetOrUserSectionIds(e.collection)}),e},setPresetSectionVersion:function(e){var t=this;return _.each(e,function(e){e.ver_ini=sektionsLocalizedData.nimbleVersion,_.isArray(e.collection)&&t.setPresetSectionVersion(e.collection)}),e},preparePresetSectionForInjection:function(n){var i=this,o={},r=f.Deferred();i.maybeGenerateNewItemIdsForCrudModules(n);var s=function(e){return _.each(e,function(e,t){_.isObject(e)||_.isArray(e)?s(e):_.isString(e)&&-1!=e.indexOf("__img_url__")&&(_.has(o,e)||(o[e]=i.importAttachment(e.replace("__img_url__",""))))}),o},a=function(i,o){return _.each(i,function(e,t){_.isObject(e)||_.isArray(e)?a(e,o):_.isString(e)&&-1!=e.indexOf("__img_url__")&&_.has(o,e)&&_.isObject(o[e])&&(i[t]=o[e].id)}),n};return i.whenAllPromisesInParallel(s(n)).done(function(e){var t=a(n,e);r.resolve(t)}).fail(function(e){r.reject(e)}),r.promise()}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(y,b){b.extend(CZRSeksPrototype,{_updAPISet_sek_add_sektion:function(){var i,e,t,o,n=this;if(i=n.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.location))throw new Error("updateAPISetting => "+i.action+" => missing location");if(!0===i.is_nested)e=n.getLevelModel(i.in_column,n.updAPISetParams.newSetValue.collection),"no_match"==(t=n.getLevelModel(i.in_sektion,n.updAPISetParams.newSetValue.collection))?n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no grand parent sektion found"):!0===t.is_nested?(n.updAPISetParams.promise.reject(""),y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")})):"no_match"==e?(y.errare("updateAPISetting => "+i.action+" => no parent column matched"),n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched")):(e.collection=_.isArray(e.collection)?e.collection:[],e.collection.push({id:i.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion}));else if("no_match"==(o=n.getLevelModel(i.location,n.updAPISetParams.newSetValue.collection)))y.errare("updateAPISetting => "+i.action+" => no location matched"),n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no location matched");else{var r=0;o.collection=_.isArray(o.collection)?o.collection:[],_.each(o.collection,function(e,t){i.before_section===e.id&&(r=t),i.after_section===e.id&&(r=t+1)}),o.collection=_.isArray(o.collection)?o.collection:[],o.collection.splice(r,0,{id:i.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion})}},_updAPISet_sek_duplicate_sektion:function(){var t,e,i,o,n=this;if(t=n.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if(_.isEmpty(t.location))throw new Error("updateAPISetting => "+t.action+" => missing location");try{o=n.cloneLevel(t.id)}catch(e){return void y.errare("updateAPISetting => "+t.action,e)}n.maybeGenerateNewItemIdsForCrudModules(o);var r=n.getLevelPositionInCollection(t.id,n.updAPISetParams.newSetValue.collection);if(!0===t.is_nested){if("no_match"==(e=n.getLevelModel(t.in_column,n.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no parent column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[],e.collection.splice(parseInt(r+1,10),0,o)}else{if("no_match"==(i=n.getLevelModel(t.location,n.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.isArray(i.collection)?i.collection:[],i.collection.splice(parseInt(r+1,10),0,o)}n.updAPISetParams.cloneId=o.id},_updAPISet_sek_remove_sektion:function(){var t,e,i,o=this;if(!0===(t=o.updAPISetParams.params).is_nested)"no_match"!=(e=o.getLevelModel(t.in_column,o.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):y.errare("updateAPISetting => "+t.action+" => no parent column matched");else{if("no_match"==(i=o.getLevelModel(t.location,o.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.filter(i.collection,function(e){return e.id!=t.id})}},_updAPISet_sek_move_sektion:function(){var t,i,o,n=this;t=n.updAPISetParams.params;var e,r,s=n.getLevelModel(t.to_location,n.updAPISetParams.newSetValue.collection);if(_.isEmpty(s)||"no_match"==s)throw new Error("updateAPISetting => "+t.action+" => missing target location");if(t.from_location!=t.to_location){var a=n.getLevelModel(t.from_location,n.updAPISetParams.newSetValue.collection);if(_.isEmpty(a)||"no_match"==a)throw new Error("updateAPISetting => "+t.action+" => missing source location");a.collection=_.isArray(a.collection)?a.collection:[],e=n.getLevelModel(t.id,a.collection),r=b.extend(!0,{},e),a.collection=_.filter(a.collection,function(e){return e.id!=t.id})}s.collection=_.isArray(s.collection)?s.collection:[],i=b.extend(!0,[],s.collection),o=[],_.each(t.newOrder,function(e){if(t.from_location!=t.to_location&&e==r.id)o.push(r);else{if(sektionCandidate=n.getLevelModel(e,i),_.isEmpty(sektionCandidate)||"no_match"==sektionCandidate)throw new Error("updateAPISetting => "+t.action+" => missing section candidate");o.push(sektionCandidate)}}),s.collection=o},_updAPISet_sek_move_sektion_up_down:function(){var t,e,i,o,n=this;if(t=n.updAPISetParams.params,e=n.getLevelModel(t.is_nested?t.in_column:t.location,n.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target location");e.collection=_.isArray(e.collection)?e.collection:[],i=b.extend(!0,[],e.collection),o=b.extend(!0,[],e.collection);var r=_.findIndex(i,function(e){return e.id===t.id});if(-1===r)throw new Error("updateAPISetting => "+t.action+" => invalid index");var s,a,c=t.direction||"up",l=i.length===r+1,d=0===r,u=n.activeLocationsInfo(),p=_.isArray(u)?_.findWhere(u,{id:t.location}):{};s=_.isObject(p)&&p.is_global,a=_.isObject(p)&&p.is_header_footer;var m=[];_.isArray(u)&&_.each(n.activeLocationsInfo(),function(e){e.is_global||e.is_header_footer||m.push(e.id)});var f,g=_.findIndex(m,function(e){return e===t.location}),h=!t.is_nested&&!s&&!a,v=0===g,k=m.length===g+1;h&&l&&"up"!==c&&!k?(f=m[g+1],n.getLevelModel(f,n.updAPISetParams.newSetValue.collection).collection.unshift(i[r]),e.collection.pop(),t.new_location=f):h&&d&&"up"===c&&!v?(f=m[g-1],n.getLevelModel(f,n.updAPISetParams.newSetValue.collection).collection.push(i[r]),e.collection.shift(),t.new_location=f):"up"!==c&&i.length===r+1?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved lower."]+"</strong>","</span>"].join("")}):"up"===c&&0===r?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved higher."]+"</strong>","</span>"].join("")}):(o[r]=i["up"===c?r-1:r+1],o["up"===c?r-1:r+1]=i[r],e.collection=o)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,t){t.extend(CZRSeksPrototype,{_updAPISet_sek_add_content_in_new_sektion:function(){var r,s,a,c=this;r=c.updAPISetParams.params;var e,i=0;if("no_match"==(a=c.getLevelModel(r.location,c.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+r.action+" => no location matched"),void c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no location matched");switch(a.collection=_.isArray(a.collection)?a.collection:[],_.each(a.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),r.content_type){case"module":e=c.getModuleStartingValue(r.content_id),a.collection.splice(i,0,{id:r.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+c.guid(),level:"column",collection:[{id:r.droppedModuleId,level:"module",module_type:r.content_id,value:"no_starting_value"!==e?e:null,ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion});break;case"preset_section":c.updAPISetParams.sectionInjectPromise=t.Deferred();var o=function(e,i){var t=!1;if(!_.isEmpty(r.sektion_to_replace)){var o=c.getLevelModel(r.sektion_to_replace,c.updAPISetParams.newSetValue.collection);"no_match"===o&&(l.errare("updateAPISetting => "+r.action+" => no sektionToReplace matched"),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no sektionToReplace matched")),t=!0===o.is_nested}var n=sektionsLocalizedData.optPrefixForSektionsNotSaved+c.guid();r.collection_of_preset_section_id=r.collection_of_preset_section_id||[],r.collection_of_preset_section_id.push(n),t?("no_match"===(s=c.getLevelModel(r.in_column,c.updAPISetParams.newSetValue.collection))&&(l.errare("updateAPISetting => "+r.action+" => no parent column matched"),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no parent column matched")),s.collection=_.isArray(s.collection)?s.collection:[],_.each(s.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),s.collection.splice(i,0,{id:n,is_nested:!0,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})):a.collection.splice(i,0,{id:n,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})};c.getPresetSectionCollection({is_user_section:r.is_user_section,presetSectionId:r.content_id}).fail(function(e){l.errare("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()",e),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(l.errare("updateAPISetting => "+r.action+" => preset section type not found or empty : "+r.content_id,e),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => preset section type not found or empty")),t=e,c.preparePresetSectionForInjection(t).fail(function(e){c.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+r.action+" => "+e),c.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){"section"===e.collection[0].level?_.each(e.collection,function(e){o(e,i),i++}):o(e,i),c.updAPISetParams.sectionInjectPromise.resolve()})})}},_updAPISet_sek_add_preset_sektion_in_new_nested_sektion:function(){var o,n,e,r=this;if(o=r.updAPISetParams.params,"no_match"===(n=r.getLevelModel(o.in_column,r.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+o.action+" => no parent column matched"),void r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => no parent column matched");var i=0;if(n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){o.before_module_or_nested_section===e.id&&(i=t),o.after_module_or_nested_section===e.id&&(i=t+1)}),"no_match"!=(e=r.getLevelModel(o.in_sektion,r.updAPISetParams.newSetValue.collection))){if(!0===e.is_nested)return r.updAPISetParams.promise.reject(""),void l.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")});r.updAPISetParams.sectionInjectPromise=t.Deferred();r.getPresetSectionCollection({is_user_section:o.is_user_section,presetSectionId:o.content_id}).fail(function(){l.errare("updateAPISetting => "+o.action+" => Error with self.getPresetSectionCollection()",_er_),r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(l.errare("updateAPISetting => "+o.action+" => preset section type not found or empty : "+o.content_id,e),r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => preset section type not found or empty")),t=e,r.preparePresetSectionForInjection(t).fail(function(e){r.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+o.action+" => "+e),r.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){var t=function(e,t){t=t||0;var i=sektionsLocalizedData.optPrefixForSektionsNotSaved+r.guid();o.collection_of_preset_section_id=o.collection_of_preset_section_id||[],o.collection_of_preset_section_id.push(i),n.collection.splice(t,0,{id:i,level:"section",collection:e.collection,options:e.options||{},is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion})};"section"===e.collection[0].level?_.each(e.collection,function(e){t(e,i),i++}):t(e,i),r.updAPISetParams.sectionInjectPromise.resolve()})})}else r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => no grand parent sektion found")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{_updAPISet_sek_add_column:function(){var e,t,i=this;if(e=i.updAPISetParams.params,_.isEmpty(e.id))throw new Error("updateAPISetting => "+e.action+" => missing id");if("no_match"==(t=i.getLevelModel(e.in_sektion,i.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+e.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => no parent sektion matched");t.collection=_.isArray(t.collection)?t.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(t.collection)?i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]):(i.resetColumnsWidthInSection(t),t.collection.push({id:e.id,level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}))},_updAPISet_sek_remove_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,"no_match"!=(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection))){if(1===_.size(e.collection))return void i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["A section must have at least one column."]);e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(e)}else l.errare("updateAPISetting => "+t.action+" => no parent sektion matched")},_updAPISet_sek_duplicate_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+t.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent sektion matched");if(e.collection=_.isArray(e.collection)?e.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(e.collection))i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);else{var o;try{o=i.cloneLevel(t.id)}catch(e){return void l.errare("updateAPISetting => "+t.action,e)}i.maybeGenerateNewItemIdsForCrudModules(o);var n=i.getLevelPositionInCollection(t.id,i.updAPISetParams.newSetValue.collection);i.updAPISetParams.cloneId=o.id,e.collection.splice(parseInt(n+1,10),0,o),i.resetColumnsWidthInSection(e)}},_updAPISet_sek_resize_column:function(){var n,o=this;if(!((n=o.updAPISetParams.params).col_number<2)){var t=o.getLevelModel(n.resized_column,o.updAPISetParams.newSetValue.collection),i=o.getLevelModel(n.sister_column,o.updAPISetParams.newSetValue.collection);if("no_match"==t)return l.errare("updateAPISetting => "+n.action+" => no resized column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => no resized column matched");var r=function(e,t){var i=d.extend(!0,{},e.options||{});return i.width=_.isObject(i.width)&&i.width["custom-width"]?i.width:{},i.width["custom-width"]=t,e.options=i,o.cachedElements.$body.find('[data-sek-width-range-column-id="'+e.id+'"]').val(t).trigger("input",{is_resize_column_trigger:!0}),t},e=r(t,parseFloat(n.resizedColumnWidthInPercent));e=parseFloat(e);var s=o.getLevelModel(n.in_sektion,o.updAPISetParams.newSetValue.collection),a=_.filter(s.collection,function(e){return e.id!=t.id&&e.id!=i.id}),c=parseFloat(e.toFixed(3));_.isEmpty(a)||_.each(a,function(e){var t,i,o;currentColWidth=(t=e,i="_not_set_",o=_.isObject(t.options)?t.options:{},!_.isEmpty(o)&&o.width&&o.width["custom-width"]&&(i=parseFloat(1*o.width["custom-width"])),i),("_not_set_"===currentColWidth||!_.isNumber(1*currentColWidth)||_.isEmpty(currentColWidth+"")||currentColWidth<1)&&(currentColWidth=r(e,parseFloat((100/n.col_number).toFixed(3)))),c=parseFloat((c+currentColWidth).toFixed(3))}),r(i,parseFloat((100-c).toFixed(3)))}},_updAPISet_sek_move_column:function(){var t,i=this;t=i.updAPISetParams.params;var e,o,n=i.getLevelModel(t.to_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(n)||"no_match"==n)throw new Error("updateAPISetting => "+t.action+" => missing target sektion");if(t.from_sektion!=t.to_sektion){var r=i.getLevelModel(t.from_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],e=i.getLevelModel(t.id,r.collection),o=d.extend(!0,{},e),r.collection=_.filter(r.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(r)}n.collection=_.isArray(n.collection)?n.collection:[],originalCollection=d.extend(!0,[],n.collection),reorderedCollection=[],_.each(t.newOrder,function(e){if(t.from_sektion!=t.to_sektion&&e==o.id)reorderedCollection.push(o);else{if(columnCandidate=i.getLevelModel(e,originalCollection),_.isEmpty(columnCandidate)||"no_match"==columnCandidate)throw new Error("updateAPISetting => moveColumn => missing columnCandidate");reorderedCollection.push(columnCandidate)}}),n.collection=reorderedCollection,i.resetColumnsWidthInSection(n)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{_updAPISet_sek_add_module:function(){var i,e,t,o,n=this;if(i=n.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.module_type))throw new Error("updateAPISetting => "+i.action+" => missing module_type");if("no_match"===(e=n.getLevelModel(i.in_column,n.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+i.action+" => no parent column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched");o=0,e.collection=_.isArray(e.collection)?e.collection:[],_.each(e.collection,function(e,t){i.before_module_or_nested_section===e.id&&(o=t),i.after_module_or_nested_section===e.id&&(o=t+1)});var r={id:i.id,level:"module",module_type:i.module_type,ver_ini:sektionsLocalizedData.nimbleVersion};"no_starting_value"!==(t=n.getModuleStartingValue(i.module_type))&&(r.value=t),e.collection.splice(o,0,r)},_updAPISet_sek_duplicate_module:function(){var t,e,i,o=this;if(t=o.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=o.getLevelModel(t.in_column,o.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+t.action+" => no parent column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[];try{i=o.cloneLevel(t.id)}catch(e){return c.errare("updateAPISetting => "+t.action,e),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => error when cloning the level")}o.maybeGenerateNewItemIdsForCrudModules(i);var n=o.getLevelPositionInCollection(t.id,o.updAPISetParams.newSetValue.collection);o.updAPISetParams.cloneId=i.id,e.collection.splice(parseInt(n+1,10),0,i)},_updAPISet_sek_remove_module:function(){var t,e;if(t=this.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");"no_match"!=(e=this.getLevelModel(t.in_column,this.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):c.errare("updateAPISetting => "+t.action+" => no parent column matched")},_updAPISet_sek_move_module:function(){var t,e,i,o,n=this;if(t=n.updAPISetParams.params,e=n.getLevelModel(t.to_column,n.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target column");if(t.from_column!=t.to_column){var r;if(r=n.getLevelModel(t.from_column,n.updAPISetParams.newSetValue.collection),_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],i=n.getLevelModel(t.id,n.updAPISetParams.newSetValue.collection),o=l.extend(!0,{},i),r.collection=_.filter(r.collection,function(e){return e.id!=t.id})}e.collection=_.isArray(e.collection)?e.collection:[],originalCollection=l.extend(!0,[],e.collection);var s=[];if(_.each(t.newOrder,function(e){if(t.from_column!=t.to_column&&e==o.id)s.push(o);else{if(moduleCandidate=n.getLevelModel(e,n.updAPISetParams.newSetValue.collection),_.isEmpty(moduleCandidate)||"no_match"==moduleCandidate)throw new Error("updateAPISetting => "+t.action+" => missing moduleCandidate");s.push(moduleCandidate)}}),s.length!=_.uniq(s).length)throw new Error("updateAPISetting => "+t.action+" => there are duplicated modules in column : "+e.id);e.collection=s},_updAPISet_sek_set_module_value:function(){var e,t,i=this;e=i.updAPISetParams.params,t=i.getLevelModel(e.id,i.updAPISetParams.newSetValue.collection);var o=e.settingParams.args.moduleRegistrationParams.control,n=e.settingParams.args.moduleRegistrationParams.id,r=o.czr_Module(n);_.isEmpty(r)?c.errare("updateAPISetting => missing parentModuleInstance",e):isMultiItemModule=r.isMultiItem();var s=isMultiItemModule?[]:{};if(_.each(e.value||(isMultiItemModule?[]:{}),function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(s[t]=e)}),"no_match"==t)return c.errare("updateAPISetting => "+e.action+" => no module matched",e),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => error no module matched");if(_.isEmpty(e.options_type))return c.errare("updateAPISetting => "+e.action+" => missing options_type"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => missing options_type");if("__no_option_group_to_be_updated_by_children_modules__"===e.options_type)t.value=s;else{var a=l.extend(!0,{},_.isEmpty(t.value)?{}:t.value);a[e.options_type]=s,t.value=a}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(z,w){w.extend(CZRSeksPrototype,{_updAPISet_sek_import_from_file:function(){var o,n=this;if(o=n.updAPISetParams.params,_.isUndefined(o.imported_content.data)||_.isUndefined(o.imported_content.metas))z.errare("updateAPISetting::sek-import-from-file => invalid imported content",imported_content);else{var i=_.isArray(o.imported_content.data.collection)?w.extend(!0,[],o.imported_content.data.collection):[];if(!0===o.assign_missing_locations){var t,e=o.imported_content.metas.active_locations,r=z.czr_sektions.activeLocations();_.each(r,function(e){n.isHeaderLocation(e)||n.isFooterLocation(e)||t.push(e)});var s=_.first(t);if(!_.isEmpty(s)&&!_.isEmpty(e)&&_.isArray(e)){var a=w(e).not(t).get(),c=n.getLevelModel(s,n.updAPISetParams.newSetValue.collection),l=n.getLevelModel(s,o.imported_content.data.collection),d=[];c.collection=_.isArray(c.collection)?c.collection:[],l.collection=_.isArray(l.collection)?l.collection:[],_.each(e,function(e){var t=n.getLevelModel(e,i);_.isEmpty(t.collection)||(d=_.union(d,t.collection))}),l.collection=d,o.imported_content.data.collection=_.filter(o.imported_content.data.collection,function(e){return!_.contains(a,e.id)})}}if(!0===o.keep_existing_sections){_.each(i,function(e){var t=n.getLevelModel(e.id,n.updAPISetParams.newSetValue.collection);if(!_.isEmpty(t.collection)){var i=n.getLevelModel(e.id,o.imported_content.data.collection);i.collection=_.union(t.collection,i.collection)}});var u=n.updAPISetParams.newSetValue.fonts,p=o.imported_content.data.fonts;u&&!_.isEmpty(u)&&_.isArray(u)&&(p=_.isArray(p)?p:[],o.imported_content.data.fonts=_.uniq(_.union(u,p)))}n.updAPISetParams.newSetValue=o.imported_content.data}},_updAPISet_sek_import_tmpl_from_gallery:function(){var t,i=this;if(t=i.updAPISetParams.params,z.infoLog("sek-import-tmpl-from-gallery",t),_.isUndefined(t.imported_content.data)||_.isUndefined(t.imported_content.metas))z.errare("updateAPISetting::sek-import-tmpl-from-gallery => invalid imported content",imported_content);else{var o=function(e){return t.imported_content&&t.imported_content.metas&&e===t.imported_content.metas.tmpl_header_location},n=function(e){return t.imported_content&&t.imported_content.metas&&e===t.imported_content.metas.tmpl_footer_location},r=function(){var t=!1;return _.each(e,function(e){t||(o(e)||n(e))&&(t="no_match"!=(t=i.getLevelModel(e,s)))}),t&&!_.isEmpty(l.local_header_footer)},s=_.isArray(t.imported_content.data.collection)?w.extend(!0,[],t.imported_content.data.collection):[],e=t.imported_content.metas.tmpl_locations,a=[],c=i.updAPISetParams.newSetValue.collection;if(_.each(z.czr_sektions.activeLocations(),function(e){i.isGlobalLocationId(e)||a.push(e)}),_.isArray(e)&&!_.isEmpty(e)){var l=t.imported_content.data.local_options;l=w.extend(!0,{},_.isObject(l)?l:{});var d=t.imported_content.data.fonts;d=_.isArray(d)?w.extend(!0,[],d):[];var u,p,m,f,g=w.extend(!0,[],c),h=[],v="__not_set__";switch(_.each(s,function(e){o(e.id)||n(e.id)||_.isEmpty(e.collection)||(h=_.union(h,e.collection))}),t.tmpl_import_mode){case"replace":if(f=!0,_.each(e,function(e){f&&(f=_.contains(a,e))}),f){var k,y;g=[],_.each(c,function(e){m=_.findWhere(s,{id:e.id})||{},_.isEmpty(m.collection)?i.isHeaderLocation(e.id)||i.isFooterLocation(e.id)?g.push(e):(k={collection:[],options:[]},y=w.extend(!0,{},e),y=w.extend(y,k),g.push(y)):g.push(m)})}else{if(l&&l.template&&"nimble_template"===l.template.local_template?v="loop_start":_.contains(a,"loop_start")?v="loop_start":_.each(a,function(e){i.isHeaderLocation(e)||i.isFooterLocation(e)||(v=e)}),"__not_set__"===v){z.errare("updateAPISetting::sek-import-tmpl-from-gallery => target location id is empty");break}if("no_match"===(p=i.getLevelModel(v,g))){z.errare("::_updAPISet_sek_import_tmpl_from_gallery => error => target location id "+v);break}(p=w.extend(!0,{},p)).collection=h,g=[],r()&&_.each(e,function(e){if(o(e)||n(e)){if("no_match"===(m=i.getLevelModel(e,s)))return void z.errare("::_updAPISet_sek_import_tmpl_from_gallery => error => location id "+e+" not found in template collection");g.push(m)}}),_.each(a,function(e){v===e&&g.push(p),localLocModel=i.getLevelModel(e,c),"no_match"!==localLocModel?r()||(i.isHeaderLocation(e)||i.isFooterLocation(e))&&g.push(localLocModel):z.errare("::_updAPISet_sek_import_tmpl_from_gallery => error => location id "+e+" not found in current setting collection")})}break;case"before":if(_.each(a,function(e){"__not_set__"==v&&("no_match"!==(u=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(u.collection)||(v=e,p=u):z.errare("::_updAPISet_sek_import_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-import-tmpl-from-gallery => target location id is empty");break}(p=w.extend(!0,{},p)).collection=_.union(h,p.collection),g=[],_.each(a,function(e){if(v===e)g.push(p);else{if("no_match"===u)return void z.errare("::_updAPISet_sek_import_tmpl_from_gallery => error => location id not found"+e);g.push(i.getLevelModel(e,c))}});break;case"after":if(_.each(a.reverse(),function(e){"__not_set__"==v&&("no_match"!==(u=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(u.collection)||(v=e,p=u):z.errare("::_updAPISet_sek_import_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-import-tmpl-from-gallery => target location id is empty");break}(p=w.extend(!0,{},p)).collection=_.union(p.collection,h),g=[],_.each(a,function(e){if(v===e)g.push(p);else{if("no_match"===(u=i.getLevelModel(e,c)))return void z.errare("::_updAPISet_sek_import_tmpl_from_gallery => error => loc id not found"+e);g.push(u)}})}if(i.updAPISetParams.newSetValue.collection=g,!_.isEmpty(l)&&"replace"===t.tmpl_import_mode){var b=i.updAPISetParams.newSetValue.local_options;b=w.extend(!0,{},_.isObject(b)?b:{}),i.updAPISetParams.newSetValue.local_options=_.extend(b,l)}if(_.isArray(d)&&!_.isEmpty(d))if("replace"!=t.tmpl_import_mode){var I=i.updAPISetParams.newSetValue.fonts;I=w.extend(!0,[],_.isArray(I)?I:[]),i.updAPISetParams.newSetValue.fonts=_.uniq(_.union(d,I))}else i.updAPISetParams.newSetValue.fonts=d}else z.errare("updateAPISetting::sek-import-tmpl-from-gallery => invalid imported template locations",t)}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(o,n){n.extend(CZRSeksPrototype,{cleanRegistered:function(t){var i=this,e=n.extend(!0,[],i.registered()||[]);o.trigger("sek-before-clean-registered"),e=_.filter(e,function(e){if("setting"!==e.what&&o[e.what].has(e.id)){if(!_.isEmpty(t)&&e.id!==t)return;_.isFunction(o[e.what](e.id).trigger)&&i.trigger("sek-ui-pre-removal",{what:e.what,id:e.id}),n.when(o[e.what](e.id).container.remove()).done(function(){o[e.what].remove(e.id),i.trigger("sek-ui-removed",{what:e.what,id:e.id})})}return"setting"===e.what}),i.registered(e)},cleanRegisteredLocalOptionSettings:function(){var t=this.getLocalSkopeOptionId(),e=n.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return e.id&&-1!==e.id.indexOf(t)&&o.has(e.id)&&o.remove(e.id),e.id&&-1===e.id.indexOf(t)}),this.registered(e)},cleanRegisteredLevelSettingsAfterHistoryNavigation:function(){var e=n.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return!_.isEmpty(e.level)&&"setting"===e.what&&o.has(e.id)&&o.remove(e.id),_.isEmpty(e.level)&&"setting"===e.what}),this.registered(e)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(u,p){p.extend(CZRSeksPrototype,{rootPanelFocus:function(){u.section.has(u.czr_activeSectionId())?u.section(u.czr_activeSectionId()).expanded(!1):u.section.each(function(e){e.expanded(!1)}),u.panel.each(function(e){e.expanded(!1)})},guid:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()},getGlobalSectionsSettingId:function(){return sektionsLocalizedData.settingIdForGlobalSections},getParentSectionFromColumnId:function(i,o){var s=this,a="no_match",c=function(i,e,o,n){if(_.isUndefined(e)){var t=u(o)(),r=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},s.getDefaultSektionSettingValue(n));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){var t;"no_match"==a&&("section"==e.level&&(t=_.findWhere(e.collection,{id:i})),_.isEmpty(t)?_.isArray(e.collection)&&c(i,e.collection,o,n):a=e)}),a};return _.isEmpty(o)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&c(i,o,e,t)}):c(i,o),a},isGlobalLocation:function(e){var t=!1;return e=e||{},_.has(e,"is_global_location")?t=e.is_global_location:_.has(e,"scope")?t="global"===e.scope:_.isEmpty(e.location)?_.isEmpty(e.in_sektion)?_.isEmpty(e.id)||(t=this.isChildOfAGlobalLocation(e.id)):t=this.isChildOfAGlobalLocation(e.in_sektion):t=this.isChildOfAGlobalLocation(e.location),t},isChildOfAGlobalLocation:function(e){var r=this,s=function(t,e){var i="no_match";if(_.isUndefined(e)){var o=u(r.getGlobalSectionsSettingId())(),n=_.isObject(o)?p.extend(!0,{},o):r.getDefaultSektionSettingValue("global");e=_.isArray(n.collection)?n.collection:[]}return _.each(e,function(e){"no_match"==i&&(t===e.id?i=e:_.isArray(e.collection)&&(i=s(t,e.collection)))}),i};return"no_match"!==s(e)},isGlobalLocationId:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_global},isHeaderLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_header},isFooterLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_footer},getLevelModel:function(i,o){var s=this,a="no_match",c=function(t,e,i,o){if(_.isUndefined(e)){var n=u(i)(),r=_.isObject(n)?p.extend(!0,{},n):p.extend(!0,{},s.getDefaultSektionSettingValue(o));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){"no_match"==a&&(t===e.id?a=e:_.isArray(e.collection)&&c(t,e.collection,i,o))}),a};return _.isEmpty(o)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&c(i,o,e,t)}):c(i,o),a},getLevelPositionInCollection:function(i,o){var s=this,a="no_match",c=function(i,e,o,n){if(_.isUndefined(e)){var t=u(o)(),r=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},s.getDefaultSektionSettingValue(n));e=_.isArray(r.collection)?r.collection:[]}_.each(e,function(e,t){"no_match"==a&&(i===e.id?a=t:_.isArray(e.collection)&&c(i,e.collection,o,n))})};return _.isEmpty(o)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&c(i,e,t,o)}):c(i,o),a},getLevelProperty:function(e){if(e=_.extend({id:"",property:""},e),_.isEmpty(e.id))u.errare("getLevelProperty => invalid id provided");else{var t=this.getLevelModel(e.id);if("no_match"!=t){if(_.isObject(t))return t[e.property];u.errare("getLevelProperty => invalid model for id : "+e.id,t)}else u.errare("getLevelProperty => no level model found for id : "+e.id)}},cloneLevel:function(e){var t=this,i=t.getLevelModel(e);if("no_match"==i)throw new Error("cloneLevel => no match for level id : "+e);var o=p.extend(!0,{},i),n=function(e){if(_.isEmpty(e.id))throw new Error("cloneLevel => missing level id");if(e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),!_.isEmpty(e.collection)){if(!_.isArray(e.collection))throw new Error("cloneLevel => the collection must be an array for level id : "+e.id);_.each(e.collection,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),n(e)})}return e};return n(o)},getDefaultItemModelFromRegisteredModuleData:function(e){if(!this.isModuleRegistered(e))return{};if(sektionsLocalizedData.registeredModules[e].is_father)return u.errare("getDefaultItemModelFromRegisteredModuleData => Father modules should be treated specifically"),{};var t=sektionsLocalizedData.registeredModules[e].tmpl["item-inputs"],i={id:"",title:""};return _.each(t,function(e,t){switch(t){case"tabs":_.each(e,function(e){_.each(e.inputs,function(e,t){i[t]=e.default||""})});break;default:i[t]=e.default||""}}),i},getRegisteredModuleProperty:function(e,t){return this.isModuleRegistered(e)?sektionsLocalizedData.registeredModules[e][t]:"not_set"},isModuleRegistered:function(e){return sektionsLocalizedData.registeredModules&&!_.isUndefined(sektionsLocalizedData.registeredModules[e])},isMultiItemsModule:function(e){return sektionsLocalizedData.registeredModules[e]&&!0===sektionsLocalizedData.registeredModules[e].is_crud},maybeGenerateNewItemIdsForCrudModules:function(t){var i=this;return(_.isArray(t)||_.isObject(t))&&_.each(t,function(e){_.isArray(t)&&_.isObject(e)&&e.id&&!_.has(e,"level")?-1===e.id.indexOf(sektionsLocalizedData.optPrefixForSektionsNotSaved)&&(e.id=i.guid()):(_.isArray(e)||_.isObject(e))&&i.maybeGenerateNewItemIdsForCrudModules(e)}),t},sniffGFonts:function(e){var n=this,r=[],s=function(i,o,e){if(_.isUndefined(e)){var t=u(i)();e=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},n.getDefaultSektionSettingValue(o))}_.each(e,function(e,t){_.isString(t)&&"_css"===t.substr(t.length-4)&&!0===n.inputIsAFontFamilyModifier(t)&&-1<e.indexOf("gfont")&&!_.contains(r,e)&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,o,e)})};return(e=e||{is_global_location:!1}).is_global_location?s(n.getGlobalSectionsSettingId(),"global"):s(n.localSectionsSettingId(),"local"),r},sniffAllFonts:function(){var n=this,r=[],s=function(i,o,e){if(_.isUndefined(e)){var t=u(i)();e=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},n.getDefaultSektionSettingValue(o))}_.each(e,function(e,t){_.isString(t)&&_.isString(e)&&(-1<e.indexOf("[gfont]")||-1<e.indexOf("[cfont]"))&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,o,e)})};return _.each([{id:n.localSectionsSettingId(),scope:"local"},{id:n.getGlobalSectionsSettingId(),scope:"global"},{id:sektionsLocalizedData.optNameForGlobalOptions,scope:"global"}],function(e){s(e.id,e.scope)}),r},getInputDefaultValue:function(i,o,e){var n=this;if(n.cachedDefaultInputValues=n.cachedDefaultInputValues||{},n.cachedDefaultInputValues[o]=n.cachedDefaultInputValues[o]||{},_.has(n.cachedDefaultInputValues[o],i))return n.cachedDefaultInputValues[o][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))u.errare("getInputDefaultValue => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[o]))u.errare("getInputDefaultValue => missing "+o+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[o].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[o].tmpl);var r="no_default_value_specified";return _.each(e,function(e,t){"no_default_value_specified"===r&&(i!==t||_.isUndefined(e.default)||(r=e.default),"no_default_value_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=n.getInputDefaultValue(i,o,e)),"no_default_value_specified"!==r&&(n.cachedDefaultInputValues[o][i]=r))}),r}u.errare("getInputDefaultValue => Father modules should be treated specifically")}},getInputType:function(i,o,e){var n=this;if(n.cachedInputTypes=n.cachedInputTypes||{},n.cachedInputTypes[o]=n.cachedInputTypes[o]||{},_.has(n.cachedInputTypes[o],i))return n.cachedInputTypes[o][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))u.errare("getInputType => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[o]))u.errare("getInputType => missing "+o+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[o].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[o].tmpl);var r="no_input_type_specified";return _.each(e,function(e,t){"no_input_type_specified"===r&&(i!==t||_.isUndefined(e.input_type)||(r=e.input_type),"no_input_type_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=n.getInputType(i,o,e)),"no_input_type_specified"!==r&&(n.cachedInputTypes[o][i]=r))}),r}u.errare("getInputType => Father modules should be treated specifically")}},getInputRegistrationParams:function(i,o,e){var n=this;if(n.cachedInputRegistrationParams=n.cachedInputRegistrationParams||{},n.cachedInputRegistrationParams[o]=n.cachedInputRegistrationParams[o]||{},_.has(n.cachedInputRegistrationParams[o],i))return n.cachedInputRegistrationParams[o][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))u.errare("getInputRegistrationParams => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[o]))u.errare("getInputRegistrationParams => missing "+o+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[o].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[o].tmpl);var r={};return _.each(e,function(e,t){_.isEmpty(r)&&(i!==t||_.isUndefined(e.input_type)||(r=e),_.isEmpty(r)&&(_.isArray(e)||_.isObject(e))&&(r=n.getInputRegistrationParams(i,o,e)),_.isEmpty(r)||(n.cachedInputRegistrationParams[o][i]=r))}),r}u.errare("getInputRegistrationParams => Father modules should be treated specifically")}},inputIsAFontFamilyModifier:function(i,e){var o=this;if(o.cachedFontFamilyModifier=o.cachedFontFamilyModifier||{},_.has(o.cachedFontFamilyModifier,i))return o.cachedFontFamilyModifier[i];if(!_.isUndefined(sektionsLocalizedData.registeredModules)){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules);var n="not_set";return _.each(e,function(e,t){"not_set"===n&&(i!==t||_.isUndefined(e.input_type)||(n=!_.isUndefined(e.refresh_fonts)&&e.refresh_fonts),"not_set"===n&&(_.isArray(e)||_.isObject(e))&&(n=o.inputIsAFontFamilyModifier(i,e)),"not_set"!==n&&(o.cachedFontFamilyModifier[i]=n))}),n}u.errare("inputIsAFontFamilyModifier => missing sektionsLocalizedData.registeredModules")},getModuleStartingValue:function(e){var a=this;if(!sektionsLocalizedData.registeredModules)return u.errare("getModuleStartingValue => missing sektionsLocalizedData.registeredModules"),"no_starting_value";if(_.isUndefined(sektionsLocalizedData.registeredModules[e]))return u.errare("getModuleStartingValue => the module type "+e+" is not registered"),"no_starting_value";var t,i,o,c=function(e){return readyStartValues=[],_.each(e,function(e){if(_.isObject(e)){var t=p.extend(!0,{},e);t.id=u.czr_sektions.guid(),readyStartValues.push(t)}else u.errare("getModuleStartingValue => multi-item module => items should be objects for module "+mod_type)}),readyStartValues},l={},d=(t=e,sektionsLocalizedData.registeredModules[t]&&sektionsLocalizedData.registeredModules[t].starting_value?sektionsLocalizedData.registeredModules[t].starting_value:{});return o=e,sektionsLocalizedData.registeredModules[o]&&!0===sektionsLocalizedData.registeredModules[o].is_father?_.each((i=e,sektionsLocalizedData.registeredModules[i]&&sektionsLocalizedData.registeredModules[i].children?sektionsLocalizedData.registeredModules[i].children:{}),function(e,t){var i,o,n,r,s=(i=e,r=(n=d)[o=t]?n[o]:{},a.isMultiItemsModule(i)&&_.isArray(r)?c(r):r);_.isEmpty(s)||(l[t]=s)}):l=a.isMultiItemsModule(e)&&_.isArray(d)?c(d):d,_.isEmpty(l)?"no_starting_value":l},selectNextTabbableOrFocusable:function(e){var t=p(e),i=p(":focus"),o=0;if(1===i.length){var n=t.index(i);n+1<t.length&&(o=n+1)}t.eq(o).focus()},selectPrevTabbableOrFocusable:function(e){var t=p(e),i=p(":focus"),o=t.length-1;if(1===i.length){var n=t.index(i);0<n&&(o=n-1)}t.eq(o).focus()},setupSelectInput:function(e){var o=this,t=(o.input_parent,o.module,u.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type)),i={params:e=_.isEmpty(e)?t.choices:e};if(o.module.trigger("nimble-set-select-input-options",i),e=i.params,!_.isEmpty(e)&&_.isObject(e))switch(o.type){case"simpleselect":_.each(e,function(e,t){var i={value:t,html:e};t==o()?p.extend(i,{selected:"selected"}):"px"===t&&p.extend(i,{selected:"selected"}),p("select[data-czrtype]",o.container).append(p("<option>",i))}),p("select[data-czrtype]",o.container).selecter();break;case"multiselect":var n=o();n=_.isString(n)?[n]:n,n=_.isArray(n)?n:[],_.each(e,function(e,t){var i={value:t,html:e};_.contains(n,t)&&p.extend(i,{selected:"selected"}),p("select[data-czrtype]",o.container).append(p("<option>",i))}),p("select[data-czrtype]",o.container).czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),p("select[data-czrtype]",o.container).on("change",function(){0===p(this).find("option:selected").length&&o([])});break;default:u.errare("::setupSelectInput => invalid input type => "+o.type)}else u.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+o.id+" in module "+o.module.module_type)},maybeSetupDeviceSwitcherForInput:function(){var o=this;if(!o.previewedDevice){var e=['<span class="sek-input-device-switcher">','<i data-sek-device="desktop" class="sek-switcher preview-desktop active" title="'+sektionsLocalizedData.i18n["Settings on desktops"]+'"></i>','<i data-sek-device="tablet" class="sek-switcher preview-tablet" title="'+sektionsLocalizedData.i18n["Settings on tablets"]+'"></i>','<i data-sek-device="mobile" class="sek-switcher preview-mobile" title="'+sektionsLocalizedData.i18n["Settings on mobiles"]+'"></i>',"</span>"].join(" ");o.container.find(".customize-control-title").first().prepend(e),o.previewedDevice=new u.Value(u.previewedDevice()),syncWithPreviewedDevice=function(e){e.stopPropagation(),o.container.find("[data-sek-device]").removeClass("active"),p(this).addClass("active");var t,i="desktop";try{i=p(this).data("sek-device")}catch(e){u.errare("maybeSetupDeviceSwitcherForInput => error when binding sek-switcher",e)}try{u.previewedDevice(i)}catch(e){u.errare("maybeSetupDeviceSwitcherForInput => error when setting the previewed device",e)}o.previewedDevice(i),_.isUndefined(e.isTrigger)&&o.module&&o.module.control&&o.module.control.params.section&&(t=o.module.control.params.section,_.delay(function(){u.previewer.send("sek-animate-to-level",{id:t})},600))},o.container.on("click","[data-sek-device]",syncWithPreviewedDevice);var t=o.container.find('[data-sek-device="'+u.previewedDevice()+'"]');0<t.length&&t.trigger("click")}},scheduleModuleAccordion:function(e){e=e||{expand_first_control:!0};var i=this;if(!0!==i.container.data("sek-module-accordion-has-been-setup")&&(p(i.container).on("click",".customize-control label > .customize-control-title",function(e){e.stopPropagation();var t=p(this).closest(".customize-control");"no"!==t.attr("data-sek-accordion")&&(i.container.find(".customize-control").not(t).each(function(){p(this).attr("data-sek-accordion")||p(this).attr("data-sek-expanded","false")}),t.attr("data-sek-expanded","false"==t.attr("data-sek-expanded")?"true":"false"),t.trigger("true"==t.attr("data-sek-expanded")?"sek-accordion-expanded":"sek-accordion-collapsed"),!0===t.data("module_ready_on_custom_control_event_is_setup")?t.trigger("sek-accordion-expanded"):t.one("module_ready_on_custom_control_event_is_setup",function(){t.trigger("sek-accordion-expanded")}))}),i.container.data("sek-module-accordion-has-been-setup",!0),e.expand_first_control)){var t=_.filter(i.controls(),function(e){return!e.params||!e.params.sek_registration_params||!1!==e.params.sek_registration_params.has_accordion}),o=_.first(t);_.isObject(o)&&!_.isEmpty(o.id)&&u.control(o.id,function(e){e.container.one("items-collection-populated",function(){p(this).find("label > .customize-control-title").trigger("click")}),!0===e.container.data("module_ready_on_custom_control_event_is_setup")?e.container.trigger("sek-accordion-expanded"):e.container.one("module_ready_on_custom_control_event_is_setup",function(){e.container.trigger("sek-accordion-expanded")})})}},isPromise:function(e){return e&&"function"==typeof e.then&&String(p.Deferred().then)===String(e.then)},whenAllPromisesInParallel:function(e){var i=this,t=p.Deferred(),o=[],n=_.keys(e);return _.each(e,function(e,t){o.push(p.Deferred(function(t){(i.isPromise(e)?e:p.Deferred()).done(t.resolve).fail(function(e){t.reject(e)})}))}),p.when.apply(this,o).done(function(){var i={},e=Array.prototype.slice.call(arguments);_.each(e,function(e,t){i[n[t]]=e}),t.resolve(i)}).fail(t.reject),t},whenAllPromisesInSerie:function(t,i,o,n){i=i||0,o=o||{},n=n||p.Deferred();var r=this;if(_.isArray(t)){var e=t[i];(r.isPromise(e)?e:p.Deferred(function(e){e.resolve()})).always(function(e){o[i]=e,i+1==t.length?n.resolve(o):i+1<t.length&&r.whenAllPromisesInSerie(t,i+1,o,n)})}return n},importAttachment:function(t){return wp.ajax.post("sek_import_attachment",{img_url:t,nonce:u.settings.nonce.save}).fail(function(e){u.errare("sek_import_attachment ajax action failed for image "+t,e)})},cleanIds:function(e){e.id="";var t=this;return _.each(e.collection,function(e){e.id="",_.isArray(e.collection)&&t.cleanIds(e)}),e},getDefaultSektionSettingValue:function(e){return!_.isUndefined(e)&&_.contains(["local","global"],e)||u.errare("getDefaultSektionSettingValue => the skope should be set to local or global"),"global"===e?sektionsLocalizedData.defaultGlobalSektionSettingValue:sektionsLocalizedData.defaultLocalSektionSettingValue},scheduleVisibilityOfInputId:function(t,i){var o=this.input_parent;if(!_.isFunction(i)||_.isEmpty(t))throw new Error("::scheduleVisibilityOfInputId => error when firing for input id : "+this.id);if(!o.czr_Input.has(t))throw new Error("::scheduleVisibilityOfInputId => missing input id : "+t);o.czr_Input(t).visible(i()),this.bind(function(e){o.czr_Input(t).visible(i())})},hasCurrentPageNBSectionsNotHeaderFooter:function(){var e,t=this,i=!1,o=this.localSectionsSettingId(),n=u(o)();this.activeLocationsInfo();return n=_.isObject(n)?n:{},e=p.extend(!0,{},n),e=_.isEmpty(e.collection)?[]:e.collection,e=_.isArray(e)?e:[],_.each(e,function(e){i||_.isObject(e)&&"location"==e.level&&e.collection&&(t.isHeaderLocation(e.id)||t.isFooterLocation(e.id)||(i=!_.isEmpty(e.collection)))}),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,m){m.extend(CZRSeksPrototype,{setupDnd:function(){var t=this;t.bind("sek-refresh-dragzones",function(e){!0!="draggable"in document.createElement("span")&&c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){c.notifications.remove("drag-drop-support")},1e4)}),t.setupNimbleDragZones(e.input_container)}),c.previewer.bind("ready",function(){try{t.setupNimbleDropZones()}catch(e){c.errare("::setupDnd => error on self.setupNimbleDropZones()",e)}_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_intro_sec_picker_module"}))&&_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_module_picker_module"}))||t.rootPanelFocus()}),t.reactToDrop()},setupNimbleDragZones:function(e){var o=this,n=function(){c.notifications.add(new c.Notification("missing-injection-target",{type:"info",message:sektionsLocalizedData.i18n["You first need to click on a target ( with a + icon ) in the preview."],dismissible:!0})),_.delay(function(){c.notifications.remove("missing-injection-target")},3e4)};e.find('[draggable="true"]').each(function(){m(this).on("dragstart",function(e){(function(e){o.lastClickedTargetInPreview({}),e.originalEvent.dataTransfer.setData("sek-content-type",m(this).data("sek-content-type")),e.originalEvent.dataTransfer.setData("sek-eligible-for-module-dropzones",m(this).data("sek-eligible-for-module-dropzones")),e.originalEvent.dataTransfer.setData("sek-content-id",m(this).data("sek-content-id")),e.originalEvent.dataTransfer.setData("sek-section-type",m(this).data("sek-section-type")),e.originalEvent.dataTransfer.setData("sek-is-user-section",m(this).data("sek-is-user-section")),o.dndData={content_type:e.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===e.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:e.originalEvent.dataTransfer.getData("sek-content-id"),section_type:e.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===e.originalEvent.dataTransfer.getData("sek-is-user-section")};try{e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.clearData("browserSupport")}catch(e){c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){c.notifications.remove("drag-drop-support")},1e4)})}m(this).addClass("sek-dragged"),o.cachedElements.$body.addClass("sek-dragging"),c.previewer.send("sek-drag-start",{content_type:o.dndData.content_type,eligible_for_module_dropzones:o.dndData.eligible_for_module_dropzones})}).call(m(this),e)}).on("dragend",function(e){(function(e){o.cachedElements.$body.removeClass("sek-dragging"),m(this).removeClass("sek-dragged"),c.previewer.send("sek-drag-stop")}).call(m(this),e)}).on("dblclick",function(e){(function(e){var t,i=o.lastClickedTargetInPreview();!_.isEmpty(i)&&i.id?t=o.dnd_getDropZonesElements().find('[data-sek-id="'+i.id+'"]').find(".sek-module-drop-zone-for-first-module").first():n(),t&&0<t.length?(c.czr_sektions.trigger("sek-content-dropped",{drop_target_element:t,location:t.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:t.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:t.data("drop-zone-after-module-or-nested-section"),before_section:t.data("drop-zone-before-section"),after_section:t.data("drop-zone-after-section"),content_type:m(this).attr("data-sek-content-type"),content_id:m(this).attr("data-sek-content-id"),section_type:m(this).attr("data-sek-section-type"),is_user_section:"true"===m(this).attr("data-sek-is-user-section")}),o.lastClickedTargetInPreview({})):(n(),c.errare("Double click insertion => the target zone was not found"))}).call(m(this),e)})})},setupNimbleDropZones:function(){var t=this;if(this.$dropZones=this.dnd_getDropZonesElements(),this.preDropElement=m("<div>",{class:sektionsLocalizedData.preDropElementClass,html:""}),this.$dropZones.length<1)throw new Error("::setupNimbleDropZones => invalid Dom element");this.$dropZones.each(function(){var e=m(this);!0!==e.data("zone-droppable-setup")&&(t.enterOverTimer=null,e.on("dragenter dragover",sektionsLocalizedData.dropSelectors,function(e){_.isNull(t.enterOverTimer)&&(t.enterOverTimer=!0,_.delay(function(){t.currentMousePosition&&t.currentMousePosition+""==e.clientY+""+e.clientX?t.enterOverTimer=null:(t.currentMousePosition=e.clientY+""+e.clientX,t.dnd_toggleDragApproachClassesToDropZones(e))},100)),t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.stopPropagation(),t.dnd_OnEnterOver(m(this),e))}).on("dragleave drop",sektionsLocalizedData.dropSelectors,function(e){switch(e.type){case"dragleave":t.dnd_isOveringDropTarget(m(this),e)||t.dnd_cleanOnLeaveDrop(m(this),e);break;case"drop":this.$cachedDropZoneCandidates=null,t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.preventDefault(),t.dnd_onDrop(m(this),e),t.dnd_cleanOnLeaveDrop(m(this),e),c.previewer.send("sek-drag-stop"))}}).data("zone-droppable-setup",!0))})},dnd_isInTarget:function(e,t){var i=t.clientY,o=t.clientX,n=e[0].getBoundingClientRect(),r=o<=n.right&&n.left<=o;return i>=n.top&&n.bottom>=i&&r},dnd_toggleDragApproachClassesToDropZones:function(u){var p=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.$cachedDropZoneCandidates=_.isEmpty(this.$cachedDropZoneCandidates)?this.$dropZones.find(".sek-drop-zone"):this.$cachedDropZoneCandidates,this.distanceTable=[],this.$dropZones.find(".sek-drop-zone").each(function(){var e,t,i=u.clientY,o=u.clientX,n=m(this)[0].getBoundingClientRect(),r=Math.abs(i-(n.bottom-(n.bottom-n.top)/2)),s=(Math.abs(n.top-i),Math.abs(o-(n.right-(n.right-n.left)/2))),a=(n.right,n.left,r<50),c=s<50,l=o<=n.right&&n.left<=o,d=i>=n.top&&n.bottom>=i;p.distanceTable.push({el:m(this),dist:d&&l?0:(e=s,t=r,Math.sqrt(e*e+t*t))}),m(this).removeClass("sek-drag-is-in"),(a||d)&&(c||l)?(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).addClass("sek-drag-is-very-close")):(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).removeClass("sek-drag-is-very-close")),m(this).removeClass("sek-drag-is-in")});var t=_.min(_.pluck(p.distanceTable,"dist"));p.$dropTargetCandidate=null,_.each(p.distanceTable,function(e){_.isNull(p.$dropTargetCandidate)&&t===e.dist&&(p.$dropTargetCandidate=e.el)}),p.$dropTargetCandidate&&0<p.$dropTargetCandidate.length&&p.dnd_isInTarget(p.$dropTargetCandidate,u)&&p.$dropTargetCandidate.addClass("sek-drag-is-in"),p.enterOverTimer=null},dnd_getPreDropElementContent:function(e){var t,i,o=m(e.currentTarget);switch(this.dndData.content_type){case"module":t=sektionsLocalizedData.i18n["Insert here"],0<o.length&&("between-sections"!==o.data("sek-location")&&"in-empty-location"!==o.data("sek-location")||(t=sektionsLocalizedData.i18n["Insert in a new section"])),i='<div class="sek-module-placeholder-content"><p>'+t+"</p></div>";break;case"preset_section":i='<div class="sek-module-placeholder-content"><p>'+(t=sektionsLocalizedData.i18n["Insert a new section here"])+"</p></div>";break;default:c.errare("::dnd_getPreDropElementContent => invalid content type provided")}return i},dnd_getDropZonesElements:function(){return m(c.previewer.targetWindow().document)},dnd_canDrop:function(e){var t=this,i=(e=_.extend({targetEl:{},evt:{}},e||{})).targetEl;if(!_.isObject(i)||i.length<1)return!1;if(i.closest('[data-sek-level="location"]').length<1)return!1;var o=i.hasClass("sek-content-preset_section-drop-zone"),n=i.hasClass("sek-module-drop-zone-for-first-module"),r=!0===i.closest('[data-sek-level="location"]').data("sek-is-header-location"),s=!0===i.closest('[data-sek-level="location"]').data("sek-is-footer-location"),a="preset_section"===t.dndData.content_type&&"content"===t.dndData.section_type,c=function(e){m(".sek-no-drop-possible-message",i).length<1&&i.append(['<div class="sek-no-drop-possible-message">','<i class="material-icons">not_interested</i>',e,"</div>"].join(""))};return!!i.hasClass("sek-drop-zone")&&(!t.dndData.is_user_section&&(r||s)&&a?(c(r?sektionsLocalizedData.i18n["Header location only accepts modules and pre-built header sections"]:sektionsLocalizedData.i18n["Footer location only accepts modules and pre-built footer sections"]),!1):s&&"preset_section"===t.dndData.content_type&&"header"===t.dndData.section_type?(c(sektionsLocalizedData.i18n["You can't drop a header section in the footer location"]),!1):r&&"preset_section"===t.dndData.content_type&&"footer"===t.dndData.section_type?(c(sektionsLocalizedData.i18n["You can't drop a footer section in the header location"]),!1):"preset_section"===t.dndData.content_type&&!0===t.dndData.eligible_for_module_dropzones&&!o||("preset_section"===t.dndData.content_type&&o||"module"===t.dndData.content_type&&!o||"preset_section"===t.dndData.content_type&&n))},dnd_OnEnterOver:function(e,t){t.preventDefault(),!0!==e.data("is-drag-entered")&&(e.data("is-drag-entered",!0),e.addClass("sek-active-drop-zone"),this.$dropZones.addClass("sek-is-dragging"));try{this.dnd_mayBePrintPreDropElement(e,t)}catch(e){c.errare("Error when trying to insert the preDrop content",e)}},dnd_cleanOnLeaveDrop:function(e,t){var i=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.preDropElement.remove(),this.$dropZones.removeClass("sek-is-dragging"),m(sektionsLocalizedData.dropSelectors,this.$dropZones).each(function(){i.dnd_cleanSingleDropTarget(m(this))})},dnd_cleanSingleDropTarget:function(e){_.isEmpty(e)||e.length<1||(e.data("is-drag-entered",!1),e.data("preDrop-position",!1),e.removeClass("sek-active-drop-zone"),e.find(".sek-drop-zone").removeClass("sek-drag-is-close"),e.find(".sek-drop-zone").removeClass("sek-drag-is-approaching"),e.removeClass("sek-feed-me-seymore"),e.find(".sek-no-drop-possible-message").remove())},dnd_getPosition:function(e,t){var i=e[0].getBoundingClientRect(),o=i.height;return"before"===e.data("preDrop-position")?o+=this.preDropElement.outerHeight():"after"===e.data("preDrop-position")&&(o-=this.preDropElement.outerHeight()),0<t.originalEvent.clientY-i.top-o/2?"after":"before"},dnd_mayBePrintPreDropElement:function(e,t){var i=this,o=e.data("preDrop-position"),n=this.dnd_getPosition(e,t);if(o!==n&&!0!==i.isPrintingPreDrop){i.isPrintingPreDrop=!0,this.dnd_cleanSingleDropTarget(this.$currentPreDropTarget);var r="between-sections"===e.data("sek-location")||"in-empty-location"===e.data("sek-location");m.when(i.preDropElement.remove()).done(function(){e["before"===n?"prepend":"append"](i.preDropElement).find("."+sektionsLocalizedData.preDropElementClass).html(i.dnd_getPreDropElementContent(t)),e.find("."+sektionsLocalizedData.preDropElementClass).toggleClass("in-new-sektion",r),e.data("preDrop-position",n),e.addClass("sek-feed-me-seymore"),i.isPrintingPreDrop=!1,i.$currentPreDropTarget=e})}},dnd_isOveringDropTarget:function(e,t){var i=e[0].getBoundingClientRect(),o=t.clientX,n=t.clientY,r=i.left,s=i.right,a=i.top,c=i.bottom;return r<=o&&o-r<=s-r&&(a<=n&&n-a<=c-a)},dnd_onDrop:function(e,t){t.stopPropagation();this.dnd_getPosition(e,t),e.index();c.czr_sektions.trigger("sek-content-dropped",{drop_target_element:e,location:e.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:e.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:e.data("drop-zone-after-module-or-nested-section"),before_section:e.data("drop-zone-before-section"),after_section:e.data("drop-zone-after-section"),content_type:t.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===t.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:t.originalEvent.dataTransfer.getData("sek-content-id"),section_type:t.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===t.originalEvent.dataTransfer.getData("sek-is-user-section")})},reactToDrop:function(){this.bind("sek-content-dropped",function(e){try{!function(e){if(!_.isObject(e))throw new Error("Invalid params provided");if(e.drop_target_element.length<1)throw new Error("Invalid drop_target_element");var t,i=e.drop_target_element,o="content-in-column";switch(i.data("sek-location")){case"between-sections":o="content-in-a-section-to-create";break;case"in-empty-location":e.is_first_section=!0,e.send_to_preview=!1,o="content-in-empty-location";break;case"between-columns":o="content-in-new-column"}"preset_section"===e.content_type&&(i.hasClass("sek-module-drop-zone-for-first-module")?1<(t=i.closest('div[data-sek-level="section"]')).find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length?(o="preset-section-in-a-nested-section-to-create",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),e.in_sektion=t.data("sek-id")):(e.sektion_to_replace=t.data("sek-id"),e.after_section=e.sektion_to_replace,e.in_column=t.closest('[data-sek-level="column"]').data("sek-id"),o="content-in-a-section-to-replace"):("between-sections"===i.data("sek-location")&&(o="content-in-a-section-to-create"),"between-modules-and-nested-sections"===i.data("sek-location")&&e.eligible_for_module_dropzones&&(o="preset-section-eligible-for-module-dropzones-in-new-nested-sektion",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),t=i.closest('div[data-sek-level="section"]'),e.in_sektion=t.data("sek-id"))));switch(o){case"content-in-column":var n=i.closest("div[data-sek-level]");if(n.length<1)throw new Error("No valid level dom element found");var r=n.data("sek-level"),s=n.data("sek-id");if(_.isEmpty(r)||_.isEmpty(s))throw new Error("No valid level id found");c.previewer.trigger("sek-add-module",{level:r,id:s,in_column:i.closest('div[data-sek-level="column"]').data("sek-id"),in_sektion:i.closest('div[data-sek-level="section"]').data("sek-id"),before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section,content_type:e.content_type,content_id:e.content_id});break;case"content-in-a-section-to-create":case"content-in-a-section-to-replace":case"content-in-empty-location":c.previewer.trigger("sek-add-content-in-new-sektion",e);break;case"preset-section-in-a-nested-section-to-create":c.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",e);break;case"preset-section-eligible-for-module-dropzones-in-new-nested-sektion":var a=m.extend(!0,{},e);a=m.extend(a,{before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section}),c.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",a);break;default:c.errare("sek control panel => ::reactToDrop => invalid drop case : "+o)}}(e)}catch(e){c.errare("error when reactToDrop",e)}})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{setupTinyMceEditor:function(){var o=this;l.sekEditorExpanded=new l.Value(!1),o.editorEventsListenerSetup=!1,o.$editorPane=d("#czr-customize-content_editor-pane"),o.$editorDragbar=d("#czr-customize-content_editor-dragbar"),o.$preview=d("#customize-preview"),o.$collapseSidebar=d(".collapse-sidebar"),o.attachResizeEventsToEditor();d("#customize-theme-controls").on("click",'[data-czr-action="open-tinymce-editor"]',function(){var e=d(this).data("czr-control-id"),t=d(this).data("czr-input-id");_.isEmpty(e)||_.isEmpty(t)?l.errare("toggle-tinymce-editor => missing input or control id"):l.sekEditorExpanded(!0)}),l.sekEditorExpanded.bind(function(e,t,i){!function(){l.sekTinyMceEditor=tinyMCE.get(sektionsLocalizedData.idOfDetachedTinyMceTextArea);var e=function(){!1===o.editorEventsListenerSetup&&(o.editorEventsListenerSetup=!0,o.trigger("sek-tiny-mce-editor-bound-and-instantiated"))};l.sekTinyMceEditor&&(l.sekTinyMceEditor.initialized?e():l.sekTinyMceEditor.on("init",function(){e()}))}(),e&&l.sekTinyMceEditor&&l.sekTinyMceEditor.focus(),d(document.body).toggleClass("czr-customize-content_editor-pane-open",e),o.cachedElements.$window[e?"on":"off"]("resize",function(){l.sekEditorExpanded()&&_.delay(function(){o.czrResizeEditor(window.innerHeight-o.$editorPane.height())},50)}),e?(o.czrResizeEditor(window.innerHeight-o.$editorPane.height()),_.delay(function(){o.cachedElements.$window.trigger("resize")},100)):(o.$preview.css("bottom",""),o.$collapseSidebar.css("bottom",""))}),d("#czr-customize-content_editor-pane").on("click",'[data-czr-action="close-tinymce-editor"]',function(){l.sekEditorExpanded(!1)}),d("#customize-controls").on("click",function(e){"open-tinymce-editor"!=d(e.target).data("czr-action")&&l.sekEditorExpanded(!1,{context:"clicked anywhere"})}),d(document).on("keydown",_.throttle(function(e){27===e.keyCode&&l.sekEditorExpanded(!1)},50)),o.bind("sek-tiny-mce-editor-bound-and-instantiated",function(){var e=d(l.sekTinyMceEditor.iframeElement).contents().get(0);d(e).on("keydown",_.throttle(function(e){27===e.keyCode&&l.sekEditorExpanded(!1)},50))}),_.each(["sek-click-on-inactive-zone","sek-add-section","sek-add-column","sek-add-module","sek-remove","sek-move","sek-duplicate","sek-resize-columns","sek-add-content-in-new-sektion","sek-pick-content","sek-edit-options","sek-edit-module","sek-notify"],function(e){"sek-edit-module"!=e?l.previewer.bind(e,function(){l.sekEditorExpanded(!1)}):l.previewer.bind(e,function(e){l.sekEditorExpanded("czr_tiny_mce_editor_module"===e.module_type)})})},attachResizeEventsToEditor:function(){var t=this;d("#czr-customize-content_editor-pane").on("mousedown mouseup",function(e){if(("mousedown"!==e.type||"czr-customize-content_editor-dragbar"===d(e.target).attr("id")||d(e.target).hasClass("czr-resize-handle"))&&l.sekEditorExpanded())switch(e.type){case"mousedown":d(document).on("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea,function(e){e.preventDefault(),d(document.body).addClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","none"),t.czrResizeEditor(e.pageY)});break;case"mouseup":d(document).off("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea),d(document.body).removeClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","")}})},czrResizeEditor:function(e){var t,i=this,o=window.innerHeight,n=(window.innerWidth,{}),r=d("#czr-customize-content_editor_ifr"),s=d("#wp-czr-customize-content_editor-tools"),a=i.$editorPane.find(".mce-toolbar-grp"),c=i.$editorPane.find(".mce-statusbar");l.sekEditorExpanded()&&(_.isNaN(e)||(t=o-e),n.height=t,n.components=s.outerHeight()+a.outerHeight()+c.outerHeight(),t<40&&(n.height=40),o-1<t&&(n.height=o-1),o<i.$editorPane.outerHeight()&&(n.height=o),i.$preview.css("bottom",n.height),i.$editorPane.css("height",n.height),r.css("height",n.height-n.components))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,a){a.extend(CZRSeksPrototype,{export_template:function(e){e=e||{},e=a.extend({scope:"local"},e);var i=[],t={sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()};_.each(t,function(e,t){i.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),wp.ajax.post("sek_pre_export_checks",{nonce:d.settings.nonce.save,sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()}).done(function(){a(window).off("beforeunload"),window.location.href=[sektionsLocalizedData.customizerURL,"?",i.join("&")].join(""),a(window).on("beforeunload")}).fail(function(e){d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Export failed"],encodeURIComponent(e)].join(" "),"</strong>","</span>"].join("")})})},import_template_from_file:function(i){i=i||{};var e,t,o=(i=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},i)).input;if(_.isEmpty(o))throw new Error("::import_template => missing file_input param");if(_.isEmpty(i.file_input))throw new Error("::import_template => missing file_input param");if(i.file_input.length<1||_.isUndefined(i.file_input[0])||!i.file_input[0].files||_.isEmpty(i.file_input.val()))d.previewer.trigger("sek-notify",{notif_id:"missing-import-file",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Missing file"],"</strong>","</span>"].join("")});else{t=d.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type).scope,o.container.find(".sek-uploading").show(),d.notifications.remove("missing-import-file"),d.notifications.remove("import-success"),d.notifications.remove("import-failed"),d.notifications.remove("img-import-errors");var n=new FormData;if(n.append("file_candidate",i.file_input[0].files[0]),n.append("action","sek_get_manually_imported_file_content"),n.append("nonce",d.settings.nonce.save),_.contains(["local","global"],t)){if(n.append("skope",t),i.pre_import_check&&n.append("pre_import_check",i.pre_import_check),n.append("import_img",o.input_parent.czr_Input("import_img")()),o.container.find(".sek-uploading").show(),e=a.ajax({url:wp.ajax.settings.url,data:n,processData:!1,contentType:!1,type:"POST"}),i.pre_import_check)return a.Deferred(function(){var t=this;e.done(function(e){e.success||t.reject(e),d.czr_sektions.isImportedContentEligibleForAPI(e,i)||t.reject(e),t.resolve(e)}).fail(function(e){t.reject(e)})});d.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),_.delay(function(){"pending"===e.state()&&d.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>",sektionsLocalizedData.i18n['Import exceeds server response time, try to uncheck "import images" option.'],"</strong>","</span>"].join("")})},3e4),e.done(function(e){d.czr_sektions.isImportedContentEligibleForAPI(e,i)?(e.data.data.collection=d.czr_sektions.setIdsForImportedTmpl(e.data.data.collection),d.czr_sektions.doUpdateApiSettingAfter_FileImport(e,i)):d.infoLog("::import_template problem => !api.czr_sektions.isImportedContentEligibleForAPI",e,i)}).fail(function(e){d.errare("::import_template => ajax error",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Import failed, file problem"],"</strong>","</span>"].join("")})}).always(function(){d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(i)})}else d.errare("::import_template => invalid scope provided",t)}},pre_checks_from_file_import:function(e,t){if(t=t||{},(t=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},t)).is_file_import&&_.isEmpty(t.input))throw new Error("::pre_checks_from_file_import => missing file_input param");var i=d.czr_sektions.activeLocations(),o=a.extend(!0,[],_.isArray(e.data.metas.active_locations)?e.data.metas.active_locations:[]),n=t.input,r=d.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type);if(o=_.filter(o,function(e){return!_.contains(["nimble_local_header","nimble_local_footer"],e)}),_.isArray(o)&&_.isArray(i)){var s=a(o).not(i).get();_.isEmpty(s)?d.czr_sektions.import_template_from_file(t):(t.is_file_import&&(n.container.find('button[data-czr-action="sek-pre-import"]').hide(),"local"===r.scope?n.container.find(".czr-import-dialog.czr-local-import").slideToggle():n.container.find(".czr-import-dialog.czr-global-import").slideToggle()),d.infoLog("sek-pre-import => imported locations missing in current page.",s))}else d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Import failed"],"</strong>","</span>"].join("")}),t.is_file_import&&d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},setIdsForImportedTmpl:function(i){var o=this;return(_.isObject(i)||_.isArray(i))&&_.each(i,function(e,t){(_.isObject(e)||_.isArray(e))&&(i[t]=o.setIdsForImportedTmpl(e)),"id"!==t||!_.isString(e)||0!==e.indexOf("__rep__me__")&&0!==e.indexOf("__nimble__")||(i[t]=sektionsLocalizedData.optPrefixForSektionsNotSaved+d.czr_sektions.guid())}),i},isImportedContentEligibleForAPI:function(e,t){var i=!0,o=e.data,n=null;e.success||(n=[sektionsLocalizedData.i18n["Import failed"],o].join(" : ")),_.isNull(n)&&!_.isObject(o)&&(n=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var r=o.data,s=o.metas,a=o.img_errors;_.isNull(n)&&!_.isObject(r)&&(n=sektionsLocalizedData.i18n["Import failed, invalid file content"]),_.isNull(n)&&!_.isObject(s)&&(n=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var c=d.czr_sektions.localSectionsSettingId();if(t.is_file_import){var l=t.input;c="local"===d.czr_sektions.getInputRegistrationParams(l.id,l.module.module_type).scope?c:d.czr_sektions.getGlobalSectionsSettingId()}return _.isNull(n)&&_.isEqual(d(c)(),r)&&(d.infoLog("::isImportedContentEligibleForAPI => Setting unchanged"),i=!1),_.isNull(n)||(d.errare("::isImportedContentEligibleForAPI => invalid data sent from server",o),d.errare("::isImportedContentEligibleForAPI => importErrorMsg",n),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",n,"</strong>","</span>"].join("")}),i=!1),_.isEmpty(a)||d.previewer.trigger("sek-notify",{notif_id:"img-import-errors",type:"info",duration:6e4,message:['<span style="color:#0075a2">',["<strong>"+sektionsLocalizedData.i18n["Some image(s) could not be imported"]+"</strong><br/>",'<span style="font-size:11px">'+a+"</span>"].join(" : "),"</span>"].join("")}),i},doUpdateApiSettingAfter_FileImport:function(e,t){if(t=t||{},d.czr_sektions.isImportedContentEligibleForAPI(e,t)||!t.is_file_import){var i="local",o=!1;if(t.is_file_import){var n=t.input,r=d.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type);i=r.scope,o="local"===r.scope&&n.input_parent.czr_Input("keep_existing_sections")()}d.czr_sektions.updateAPISetting({action:"sek-import-from-file",scope:i,imported_content:e.data,assign_missing_locations:t.assign_missing_locations,keep_existing_sections:o}).done(function(){"local"===i&&d.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),d.previewer.refresh(),d.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["File successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){d.errare("::doUpdateApiSettingAfter_FileImport => error when firing ::updateAPISetting",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),d.previewer.refresh()}else d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},doAlwaysAfterFileImportAndApiSettingUpdate:function(e){if(d.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0}),e=e||{},(e=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},e)).is_file_import){var t=e.input;t.container.find(".sek-uploading").hide(),e.file_input.val("").trigger("change"),t.container.find(".czr-import-dialog").hide(),t.container.find('button[data-czr-action="sek-pre-import"]').show()}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(o,d){d.extend(CZRSeksPrototype,{setupTemplateGallery:function(){var t=this;t.templateGalleryExpanded=new o.Value(!1),t.tmplImportDialogVisible=new o.Value(!1),sektionsLocalizedData.isTemplateGalleryEnabled&&(t.templateGalleryExpanded.bind(function(e){t.cachedElements.$body.toggleClass("sek-template-gallery-expanded",e),e?(t.tmplDialogVisible(!1),t.levelTreeExpanded(!1),t.tmplImportDialogVisible(!1),d("#customize-preview iframe").css("z-index",1),t.renderOrRefreshTempGallery()):d("#customize-preview iframe").css("z-index","")}),t.tmplImportDialogVisible.bind(function(e){t.cachedElements.$body.toggleClass("sek-tmpl-dialog-expanded",e),e&&(t.tmplDialogVisible(!1),t.levelTreeExpanded(!1),d("#customize-preview iframe").css("z-index",1))}),o.previewer.bind("ready",function(){t.templateGalleryExpanded(!1)}))},renderTmplGalleryUI:function(){if(0<d("#nimble-tmpl-gallery").length)return d("#nimble-tmpl-gallery");try{_tmpl=wp.template("nimble-top-tmpl-gallery")({})}catch(e){return o.errare("Error when parsing nimble-top-tmpl-gallery template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-tmpl-gallery")},renderOrRefreshTempGallery:function(){var e=this;d("#nimble-tmpl-gallery").length<1&&d.when(e.renderTmplGalleryUI({})).done(function(){e.setupTmplGalleryDOMEvents()});var t=d("#nimble-tmpl-gallery").find(".sek-tmpl-gallery-inner");t.html(""),e.getTemplateGalleryHtml().done(function(e){t.html(e)})},setupTmplGalleryDOMEvents:function(){var l=d("#nimble-tmpl-gallery"),i=this;l.on("click",".sek-tmpl-item .use-tmpl",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).closest(".sek-tmpl-item").data("sek-tmpl-item-id");_.isEmpty(t)?o.errare("::setupTmplGalleryDOMEvents => error => invalid template id"):i.hasCurrentPageNBSectionsNotHeaderFooter()?(i._tmplNameWhileImportDialog=t,i.tmplImportDialogVisible(!0)):(o.czr_sektions.get_gallery_tmpl_json_and_import({template_name:t,from:"user"}),i.templateGalleryExpanded(!1))}).on("click",".sek-tmpl-gal-import-dialog .sek-ui-button",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).data("sek-tmpl-import-mode");_.contains(["replace","before","after"],t)?(o.czr_sektions.get_gallery_tmpl_json_and_import({template_name:i._tmplNameWhileImportDialog,from:"user",tmpl_import_mode:t}),i.templateGalleryExpanded(!1)):o.errare("::setupTmplGalleryDOMEvents => error => invalid import mode")}).on("propertychange change click keyup input paste",".sek-filter-tmpl",_.debounce(function(e){e.preventDefault();var t,i,o,n,r,s,a=d(this).val(),c=function(){l.removeClass("search-active"),l.find(".sek-tmpl-item").each(function(){d(this).removeClass("search-match")})};_.isString(a)?(a=a.trim().toLowerCase(),_.isEmpty(a.replace(/\s/g,""))?c():(l.addClass("search-active"),l.find(".sek-tmpl-item").each(function(){t=(d(this).find(".tmpl-title").html()+"").toLowerCase(),i=(d(this).find(".tmpl-desc").html()+"").toLowerCase(),o=(d(this).find(".tmpl-date").html()+"").toLowerCase(),n=-1!=t.indexOf(a),r=-1!=i.indexOf(a),s=-1!=o.indexOf(a),d(this).toggleClass("search-match",n||r||s)}))):c()},100)).on("click",".sek-tmpl-info .remove-tmpl",function(e){e.preventDefault();var t=function(e){i.tmplDialogMode("remove"),i.tmplDialogMode.unbind(t)};i.tmplDialogMode.bind(t),i.tmplDialogVisible(!0)}).on("click",".sek-close-dialog",function(e){e.preventDefault(),i.templateGalleryExpanded(!1)})},getTemplateGalleryHtml:function(){var i,o="",n=[sektionsLocalizedData.baseUrl,"/assets/admin/img/wire_frame.png","?ver=",sektionsLocalizedData.nimbleVersion].join(""),r=d.Deferred();return this.getSavedTmplCollection().done(function(e){_.each(e,function(e,t){i=_.isEmpty(e.description)?[e.title,e.last_modified_date].join(" | "):[e.title,e.last_modified_date,e.description].join(" | "),o+='<div class="sek-tmpl-item" data-sek-tmpl-item-id="'+t+'">',o+='<div class="sek-tmpl-thumb"><img src="'+n+'"/></div>',o+='<div class="sek-tmpl-info" title="'+i+'">',o+='<h3 class="tmpl-title">'+e.title+"</h3>",o+='<p class="tmpl-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",o+='<p class="tmpl-desc">'+e.description+"</p>",o+='<i class="material-icons use-tmpl" title="'+sektionsLocalizedData.i18n["Use this template"]+'">add_circle_outline</i>',o+='<i class="material-icons remove-tmpl" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>',o+="</div>",o+="</div>"});var t=d("#nimble-tmpl-gallery").find(".czr-css-loader");0<t.length?t.hide({duration:300,complete:function(){d(this).remove(),r.resolve(o)}}):r.resolve(o)}),r.promise()}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(t,e){jQuery.extend(CZRSeksPrototype,t.Events);var i=t.Class.extend(CZRSeksPrototype);try{t.czr_sektions=new i}catch(e){t.errare("api.czr_sektions => problem on instantiation",e)}}(wp.customize),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{content_type_switcher:function(e){var i,o=this,n=r.czr_sektions;if(!r.section.has(o.module.control.section()))throw new Error("api.czrInputMap.content_type_switcher => section not registered");i=r.section(o.module.control.section());var t=function(t){o.container.find('[data-sek-content-type="'+(t||"module")+'"]').trigger("click"),a.each(i.controls(),function(e){a.isUndefined(e.content_type)||e.active(t===e.content_type)})};r.czr_sektions.currentContentPickerType=r.czr_sektions.currentContentPickerType||new r.Value,r.bind("nimble-modules-and-sections-controls-registered",function(){t(r.czr_sektions.currentContentPickerType())}),r.czr_sektions.currentContentPickerType.bind(function(e){t(e)}),r.czr_sektions.currentContentPickerType(o()),o.container.on("click","[data-sek-content-type]",function(e){e.preventDefault();var t=s(this).data("sek-content-type");if(o.container.find("[data-sek-content-type]").attr("aria-pressed",!1),n.templateGalleryExpanded(!1),n.levelTreeExpanded(!1),n.tmplDialogVisible&&n.tmplDialogVisible(!1),n.saveSectionDialogVisible&&n.saveSectionDialogVisible(!1),"template"===t){var i=r.czr_sektions.templateGalleryExpanded();s(this).attr("aria-pressed",!i),r.czr_sektions.templateGalleryExpanded(!i)}else r.czr_sektions.templateGalleryExpanded(!1),s(this).attr("aria-pressed",!0),r.czr_sektions.currentContentPickerType(t)}),t(r.czr_sektions.currentContentPickerType())}})}(wp.customize,jQuery,_),function(t,e,i){t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{module_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"module",input_container:this.container})},section_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:this.container})}})}(wp.customize,jQuery,_),function(s,a,c){s.czrInputMap=s.czrInputMap||{},a.extend(s.czrInputMap,{module_option_switcher:function(e){var t=this;if(!s.section.has(t.module.control.section()))throw new Error(t.input_type+" => section not registered");s.section(t.module.control.section());var i,o="",n=t.module.control.params.sek_registration_params;if(c.isUndefined(n))throw new Error(t.input_type+" => missing registration params");if(n&&n.module_id&&(o=n.module_id,i=n.ui_action),c.isEmpty(o))throw new Error(t.input_type+" => missing module id");t.container.on("click","[data-sek-option-type]",function(e){e.preventDefault(),t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),a(this).addClass("is-selected").attr("aria-pressed",!0),s.previewer.trigger("settings"===a(this).data("sek-option-type")?"sek-edit-options":"sek-edit-module",{id:o,level:"module"})});var r="sek-generate-level-options-ui"===i?"settings":"content";t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),t.container.find('[data-sek-option-type="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(l,d,u){l.czrInputMap=l.czrInputMap||{};var p=function(e){return u.contains(["px","em","%"],e)||(l.errare("error : invalid unit for input "+this.id,e),e="px"),e},_=function(i){var o=this;i.on("click",".sek-ui-button",function(e,t){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),d(this).addClass("is-selected").attr("aria-pressed",!0),o.css_unit(d(this).data("sek-unit"),t)}),i.find('.sek-ui-button[data-sek-unit="'+(o.initial_unit||"px")+'"]').addClass("is-selected").attr("aria-pressed",!0)},m=function(t,i){var o=this;t.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),t.find('input[type="number"]').each(function(){d(this).val("")}),o(i),d(".sek-unit-wrapper",t).find('[data-sek-unit="px"]').trigger("click")})};d.extend(l.czrInputMap,{spacing:function(e){var n=this,i=d(".sek-spacing-wrapper",n.container),t=l.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type),o=u.isEmpty(t)||u.isEmpty(t.default)?[]:t.default;if(i.on("input",'input[type="number"]',function(e){var t=d(this).closest("[data-sek-spacing]").data("sek-spacing"),i=d.extend(!0,{},u.isObject(n())?n():{}),o=d(this).val();u.isString(o)&&!u.isEmpty(o)||u.isNumber(o)?i[t]=o:i=u.omit(i,t),n(i)}),m.call(n,i,o),u.isObject(n())){u.each(n(),function(e,t){d('[data-sek-spacing="'+t+'"]',i).find('input[type="number"]').val(e)});var r="px";d(".sek-unit-wrapper .sek-ui-button",n.container).each(function(){var e=d(this).data("sek-unit");u.isEmpty(n())||u.isEmpty(n().unit)||e===n().unit&&(r=e)}),d(".sek-unit-wrapper",n.container).find('[data-sek-unit="'+p.call(n,r)+'"]').trigger("click")}var s=n();n.initial_unit="px",u.isEmpty(s)||(n.initial_unit=u.isEmpty(s.unit)?"px":s.unit),n.css_unit=new l.Value(p.call(n,n.initial_unit)),n.css_unit.bind(function(e){var t;e=u.isEmpty(e)?"px":e,(t=d.extend(!0,{},u.isObject(n())?n():{})).unit=e,n(t)}),_.call(n,i)}}),d.extend(l.czrInputMap,{spacingWithDeviceSwitcher:function(e){var r=this,s=d(".sek-spacing-wrapper",r.container),t=l.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=u.isEmpty(t)||u.isEmpty(t.default)?{}:t.default,c=function(e,t){var i=["mobile","tablet","desktop"];if(u.has(e,t))return e[t];var o=u.findIndex(i,function(e){return t===e});return!u.isEmpty(t)&&o<i.length?c(e,i[o+1]):{}},i=function(e){var t=d.extend(!0,{},u.isObject(r())?r():{}),i=d.extend(!0,{},a);t=u.isObject(t)?d.extend(i,t):i;var o=c(t,e);d("[data-sek-spacing]",s).each(function(){var e=d(this).data("sek-spacing"),t="";u.isEmpty(o)||u.isEmpty(o[e])||(t=o[e]),d(this).find('input[type="number"]').val(t)});var n="px";d(".sek-unit-wrapper .sek-ui-button",r.container).each(function(){var e=d(this).data("sek-unit");u.isEmpty(o)||u.isEmpty(o.unit)||e===o.unit&&(n=e)}),d(".sek-unit-wrapper",r.container).find('[data-sek-unit="'+p.call(r,n)+'"]').trigger("click",{previewed_device_switched:!0})};l.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r);var o=r();r.initial_unit="px",u.isEmpty(o)||u.isEmpty(o[r.previewedDevice()])||(r.initial_unit=u.isEmpty(o[r.previewedDevice()].unit)?"px":o[r.previewedDevice()].unit),r.css_unit=new l.Value(p.call(r,r.initial_unit)),s.on("input",'input[type="number"]',function(e){var t,i=d(this).closest("[data-sek-spacing]").data("sek-spacing"),o=d(this).val(),n=l.previewedDevice()||"desktop";(t=d.extend(!0,{},u.isObject(r())?r():{}))[n]=d.extend(!0,{},t[n]||{}),u.isString(o)&&!u.isEmpty(o)||u.isNumber(o)?t[n][i]=o:t[n]=u.omit(t[n],i),t[n].unit&&r.css_unit()==t[n].unit||(t[n].unit=r.css_unit()),r(t)}),m.call(r,s,a),r.previewedDevice.bind(function(e){try{i(e)}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}),r.css_unit.bind(function(e,t,i){if(!u.isObject(i)||!0!==i.previewed_device_switched){e=u.isEmpty(e)?"px":e;var o,n=r.previewedDevice()||"desktop";(o=d.extend(!0,{},u.isObject(r())?r():{}))[n]=d.extend(!0,{},o[n]||{}),o[n].unit=e,r(o)}}),_.call(r,s);try{i(l.previewedDevice())}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}})}(wp.customize,jQuery,_),function(o,a,c){o.czrInputMap=o.czrInputMap||{},a.extend(o.czrInputMap,{bg_position:function(e){var t=this;a(".sek-bg-pos-wrapper",t.container).on("change",'input[type="radio"]',function(e){t(a(this).val())}),c.isEmpty(t())||t.container.find('input[value="'+t()+'"]').attr("checked",!0).trigger("click")},bgPositionWithDeviceSwitcher:function(e){var n=this,t=o.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type),r=c.isEmpty(t)||c.isEmpty(t.default)?{}:t.default;o.czr_sektions.maybeSetupDeviceSwitcherForInput.call(n);var s=function(e,t){var i=["mobile","tablet","desktop"];if(c.has(e,t))return e[t];var o=c.findIndex(i,function(e){return t===e});return!c.isEmpty(t)&&o<i.length?s(e,i[o+1]):{}},i=function(e){var t=a.extend(!0,{},c.isObject(n())?n():{}),i=a.extend(!0,{},r);t=c.isObject(t)?a.extend(i,t):i;var o=s(t,e);n.container.find('input[value="'+o+'"]').attr("checked",!0).trigger("click",{previewed_device_switched:!0})};a(".sek-bg-pos-wrapper",n.container).on("change",'input[type="radio"]',function(e){var t,i=a(this).val();(t=a.extend(!0,{},c.isObject(n())?n():{}))[o.previewedDevice()||"desktop"]=i,n(t)}),n.previewedDevice.bind(function(e){try{i(e)}catch(e){o.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+n.id,e)}});try{i(o.previewedDevice())}catch(e){o.errare("Error when firing syncWithPreviewedDevice for input type bgPositionWithDeviceSwitcher for input id "+n.id,e)}}})}(wp.customize,jQuery,_),function(c,l,d){c.czrInputMap=c.czrInputMap||{};var e=function(e){var n=this,t=c.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type),r=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i="verticalAlignWithDeviceSwitcher"===n.type?".sek-v-align-wrapper":".sek-h-align-wrapper",s=l(i,n.container);c.czr_sektions.maybeSetupDeviceSwitcherForInput.call(n);var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var o=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&o<i.length?a(e,i[o+1]):{}},o=function(e){var t=l.extend(!0,{},d.isObject(n())?n():{}),i=l.extend(!0,{},r);t=d.isObject(t)?l.extend(i,t):i;var o=a(t,e);s.find(".selected").removeClass("selected"),s.find('div[data-sek-align="'+o+'"]').addClass("selected")};s.on("click","[data-sek-align]",function(e){var t;e.preventDefault(),(t=l.extend(!0,{},d.isObject(n())?n():{}))[c.previewedDevice()||"desktop"]=l(this).data("sek-align"),s.find(".selected").removeClass("selected"),l.when(l(this).addClass("selected")).done(function(){n(t)})}),n.previewedDevice.bind(function(e){try{o(e)}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type : "+n.type+" for input id "+n.id,e)}});try{o(c.previewedDevice())}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type : "+n.type+" for input id "+n.id,e)}};l.extend(c.czrInputMap,{horizTextAlignmentWithDeviceSwitcher:e,horizAlignmentWithDeviceSwitcher:e,verticalAlignWithDeviceSwitcher:e})}(wp.customize,jQuery,_),function(f,g,h){f.czrInputMap=f.czrInputMap||{},g.extend(f.czrInputMap,{font_picker:function(e){var p=this,_=p.input_parent,o=function(e,t){_();var o=g('select[data-czrtype="'+p.id+'"]',p.container);h.isNull(p())||h.isEmpty(p())?o.append('<option value="none" selected="selected">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"):o.append('<option value="none">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>");var i=[{title:sektionsLocalizedData.i18n["Web safe fonts"],type:"cfont",list:t.cfonts},{title:sektionsLocalizedData.i18n["Google fonts"],type:"gfont",list:t.gfonts}],n=f.czr_sektions.sniffAllFonts(),r=sektionsLocalizedData.alreadyUsedFonts,s=[],a=[];if(!h.isEmpty(r)&&h.isObject(r)&&h.each(r,function(e){a.push(e)}),h.isArray(n)&&h.each(n,function(e){a.push(e)}),!h.isEmpty(a)){var c={},l=[];a.forEach(function(e){c[e]=(c[e]||0)+1});var d=h.sortBy(c,function(e){return e});h.each(d,function(i){h.each(c,function(e,t){i!==e||h.contains(l,t)||l.unshift(t)})}),h.each(l,function(e){s.push({name:e})}),i.unshift({title:sektionsLocalizedData.i18n["Already used fonts"],type:null,list:s})}h.each(i,function(e){var t,r,s,i=g("<optgroup>",{label:e.title,html:(t=e.list,r=e.type,s="",h.each(t,function(e){var t,i,o=h.isString(e.name)?e.name:"Undefined Font Family",n=o.replace(/[+|:]/g," ");t=o,i=r,o=h.isEmpty(i)?t:h.isString(t)?["[",i,"]",t].join(""):"",n=n.replace("[cfont]","").replace("[gfont]",""),o==p()?s+='<option selected="selected" value="'+o+'">'+n+"</option>":s+='<option value="'+o+'">'+n+"</option>"}),s)});o.append(i)});var u={escapeMarkup:function(e){return e}};e&&g.extend(u,{resultsAdapter:e,closeOnSelect:!1}),o.czrSelect2(u),g(".czrSelect2-selection__rendered",p.container).css(m(p()))},m=function(e){if(!h.isString(e)||h.isEmpty(e))return{};var t,i,o,n=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return t=r(e),i=n[1]?n[1].replace(/[^0-9.]+/g,""):400,i=h.isNumber(i)?i:400,o=n[1]&&-1!=n[1].indexOf("italic")?"italic":"",{"font-family":"none"==t?"inherit":t.replace(/[+|:]/g," "),"font-weight":i||400,"font-style":o||"normal"}},r=function(e){if(!h.isString(e)||h.isEmpty(e))return e;var t=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return h.isString(t[0])?t[0].replace(/[+|:]/g," "):""};g.when(function(){var e,t=g.Deferred();h.isEmpty(f.sek_fontCollections)?(h.isUndefined(f.sek_fetchingFontCollection)||"pending"!=f.sek_fetchingFontCollection.state()?(e=f.CZR_Helpers.getModuleTmpl({tmpl:"font_list",module_type:"font_picker_input",module_id:p.module.id}),f.sek_fetchingFontCollection=e):e=f.sek_fetchingFontCollection,e.done(function(e){if("string"!=typeof e||"{"!==e[0])throw new Error("font_picker => server list is not JSON.parse-able");f.sek_fontCollections=JSON.parse(e),t.resolve(f.sek_fontCollections)}).fail(function(e){t.reject(e)})):t.resolve(f.sek_fontCollections);return t.promise()}()).done(function(t){var i;(i=g.Deferred(),void 0!==g.fn.czrSelect2&&void 0!==g.fn.czrSelect2.amd&&"function"==typeof g.fn.czrSelect2.amd.require?g.fn.czrSelect2.amd.require(["czrSelect2/results","czrSelect2/utils"],function(e,t){var o=function(e,t,i){o.__super__.constructor.call(this,e,t,i)};t.Extend(o,e),o.prototype.bind=function(e,t){var i=this;e.on("results:focus",function(e){"true"!=e.element.attr("aria-selected")&&i.trigger("select",{data:e.data})}),o.__super__.bind.call(this,e,t)},i.resolve(o)}):i.resolve(!1),i.promise()).done(function(e){o(e,t)})}).fail(function(e){f.errare("font_picker => fail response =>",e)})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{fa_icon_picker:function(){var o=this,n=!1,e=function(t){!0!==o.iconCollectionSet&&(s.when(s.Deferred(function(t){a.isEmpty(o.sek_faIconCollection)?r.CZR_Helpers.getModuleTmpl({tmpl:"icon_list",module_type:"fa_icon_picker_input",module_id:o.module.id}).done(function(e){if("string"!=typeof e||"["!==e[0])throw new Error("fa_icon_picker => server list is not JSON.parse-able");o.sek_faIconCollection=JSON.parse(e),t.resolve(o.sek_faIconCollection)}).fail(function(e){t.reject(e)}):t.resolve(o.sek_faIconCollection)})).done(function(e){!function(e){a.each(e,function(e){var t={value:e,html:r.CZR_Helpers.capitalize(e.substring(7))};t.value==o()&&(s.extend(t,{selected:"selected"}),n=!0),s("select[data-czrtype]",o.container).append(s("<option>",t))});var t,i=function(e){return e.id?s('<span class="'+e.element.value+'"></span><span class="social-name"> '+e.text+"</span>"):e.text};t=n?s("<option>"):s("<option>",{selected:"selected"}),s("select[data-czrtype]",o.container).prepend(t).czrSelect2({templateResult:i,templateSelection:i,placeholder:sektionsLocalizedData.i18n["Select an icon"],allowClear:!0})}(e),t&&!0===t.open_on_init&&a.delay(function(){try{s("select[data-czrtype]",o.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){r.errare("fa_icon_picker => fail response =>",e)}),o.iconCollectionSet=!0)};o.container.on("click",function(){e()}),a.delay(function(){e({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(u,p,_){u.czrInputMap=u.czrInputMap||{},p.extend(u.czrInputMap,{code_editor:function(e){var o=this,i=this.module.control,n=(o.input_parent(),!1),r=o.container.find("textarea"),s=o.container.find(".customize-control-title"),a=function(){return p.Deferred(function(t){var i=_.isEmpty(r.data("editor-code-type"))?"text/html":r.data("editor-code-type");u.czr_sektions.code_editor_params&&u.czr_sektions.code_editor_params[i]?t.resolve(u.czr_sektions.code_editor_params[i]):wp.ajax.post("sek_get_code_editor_params",{nonce:u.settings.nonce.save,code_type:i}).done(function(e){_.isObject(e)||u.errare(o.id+" => error => invalid code editor params sent by server",e),u.czr_sektions.code_editor_params={},u.czr_sektions.code_editor_params[i]=e,t.resolve(u.czr_sektions.code_editor_params[i])}).fail(function(e){t.reject(e)})})};o.isReady.done(function(){var t=function(e){_.isEmpty(this.editor)&&(_.isEmpty(this.module.control.container.attr("data-sek-expanded"))||"false"==this.module.control.container.attr("data-sek-expanded")||setTimeout(function(){if(n)try{c(n)}catch(e){u.errare("error in sek_control => code_editor() input",e),l()}else l();s.trigger("click")},10))};r.html(o()),p.when(a()).done(function(e){wp.codeEditor&&(_.isUndefined(e)||!1!==e)&&(n=e),t.call(o),o.module.control.container.on("sek-accordion-expanded",function(){t.call(o)})}).fail(function(e){u.errare(o.id+" => error when getting the editor params from server")})});var c=function(e){var t,i=!1;t=_.extend({},e,{onTabNext:CZRSeksPrototype.selectNextTabbableOrFocusable(":tabbable"),onTabPrevious:CZRSeksPrototype.selectPrevTabbableOrFocusable(":tabbable"),onUpdateErrorNotice:d}),o.editor=wp.codeEditor.initialize(r,t),p(o.editor.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-label":s.html(),"aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),s.on("click",function(e){e.stopPropagation(),o.editor.codemirror.focus()}),o.editor.codemirror.on("change",function(e){i=!0,r.val(e.getValue()).trigger("change"),i=!1}),o.editor.codemirror.setValue(o()),o.bind(o.id+":changed",function(e){i||o.editor.codemirror.setValue(e)}),o.editor.codemirror.on("keydown",function(e,t){27===t.keyCode&&t.stopPropagation()})},l=function(){var n=r[0];o.editor=n,r.on("blur",function(){r.data("next-tab-blurs",!1)}),r.on("keydown",function(e){var t,i,o;27!==e.keyCode?9!==e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||r.data("next-tab-blurs")||(t=n.selectionStart,i=n.selectionEnd,o=n.value,0<=t&&(n.value=o.substring(0,t).concat("\t",o.substring(i)),r.selectionStart=n.selectionEnd=t+1),e.stopPropagation(),e.preventDefault()):r.data("next-tab-blurs")||(r.data("next-tab-blurs",!0),e.stopPropagation())})},d=function(e){var t;i.setting.notifications.remove(o.id),0!==e.length&&(t=1===e.length?sektionsLocalizedData.i18n.codeEditorSingular.replace("%d","1").replace("%s",s.html()):sektionsLocalizedData.i18n.codeEditorPlural.replace("%d",String(e.length)).replace("%s",s.html()),i.setting.notifications.add(o.id,new u.Notification(o.id,{message:t,type:"warning"})))}}})}(wp.customize,jQuery,_),function(e,r,t){e.czrInputMap=e.czrInputMap||{},r.extend(e.czrInputMap,{range_simple:function(e){var t=this,i=r(".sek-range-with-unit-picker-wrapper",t.container),o=i.find('input[type="number"]'),n=i.find('input[type="range"]');n.on("input",function(e){o.val(r(this).val()).trigger("input")}),o.on("input",function(e){t(r(this).val()),n.val(r(this).val())}),n.val(o.val()||0)},number_simple:function(e){var t=this;t.container.find('input[type="number"]').on("input",function(e){t(r(this).val())})}})}(wp.customize,jQuery,_),function(d,u,p){d.czrInputMap=d.czrInputMap||{},u.extend(d.czrInputMap,{range_simple_device_switcher:function(e){var s=this,t=u(".sek-range-with-unit-picker-wrapper",s.container),a=t.find('input[type="number"]'),r=t.find('input[type="range"]'),i=d.czr_sektions.getInputRegistrationParams(s.id,s.module.module_type),c=p.isEmpty(i)||p.isEmpty(i.default)?{}:i.default,l=function(e,t){var i=["mobile","tablet","desktop"];if(p.has(e,t))return e[t];var o=p.findIndex(i,function(e){return t===e});return!p.isEmpty(t)&&o<i.length?l(e,i[o+1]):u.extend(!0,{desktop:""},c).desktop},o=function(e){var t=s(),i={};i=u.extend(!0,{},c),p.isObject(t)?i=u.extend(!0,{},t):p.isString(t)&&!p.isEmpty(t)&&(i={desktop:t});var o,n=l(i,e),r=(o=n,p.isEmpty(o)||!p.isString(o)?"16":o.replace(/px|em|%/g,""));a.val(r).trigger("input",{previewed_device_switched:!0})};d.czr_sektions.maybeSetupDeviceSwitcherForInput.call(s),r.on("input",function(e){a.val(u(this).val()).trigger("input")}),a.on("input",function(e,t){var i,o=d.previewedDevice()||"desktop",n=u(this).val();(i=u.extend(!0,{},p.isObject(s())?s():{}))[o]=u.extend(!0,{},i[o]||{}),p.isString(n)&&!p.isEmpty(n)&&(i[o]=n),(p.isEmpty(t)||p.isObject(t)&&!0!==t.previewed_device_switched)&&s(i),r.val(u(this).val())}),s.previewedDevice.bind(function(e){try{o(e)}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}),r.val(a.val()||0);try{o(d.previewedDevice())}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}})}(wp.customize,jQuery,_),function(a,c,l){a.czrInputMap=a.czrInputMap||{},c.extend(a.czrInputMap,{range_with_unit_picker:function(e){var t=this,i=c(".sek-range-with-unit-picker-wrapper",t.container),o=i.find('input[type="number"]'),n=i.find('input[type="range"]'),r=i.find("input[data-czrtype]").data("sek-unit"),s=function(e){return l.contains(["px","em","%"],e)||(a.errare("error : invalid unit for input "+t.id,e),e="px"),e};t.css_unit=new a.Value(l.isEmpty(r)?"px":s(r)),t.css_unit.bind(function(e){e=l.isEmpty(e)?"px":e,i.find('input[type="number"]').trigger("input")}),n.on("input",function(e){o.val(c(this).val()).trigger("input")}),o.on("input",function(e){t(c(this).val()+s(t.css_unit())),n.val(c(this).val())}),n.val(o.val()||0),i.on("click",".sek-ui-button",function(e){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),c(this).addClass("is-selected").attr("aria-pressed",!0),i.find("input[data-czrtype]").data("sek-unit",c(this).data("sek-unit")),t.css_unit(c(this).data("sek-unit"))}),i.find('.sek-ui-button[data-sek-unit="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(a,_,m){a.czrInputMap=a.czrInputMap||{},_.extend(a.czrInputMap,{range_with_unit_picker_device_switcher:function(e){var c=this,l=_(".sek-range-with-unit-picker-wrapper",c.container),d=l.find('input[type="number"]'),r=l.find('input[type="range"]'),s=function(e){return m.contains(["px","em","%"],e)||(a.errare("range_with_unit_picker_device_switcher => error : invalid unit for input "+c.id,e),e="px"),e},t=a.czr_sektions.getInputRegistrationParams(c.id,c.module.module_type),u=m.isEmpty(t)||m.isEmpty(t.default)?{}:t.default,i=function(){return l.find("input[data-czrtype]").data("sek-unit")||"px"},p=function(e,t){var i=["mobile","tablet","desktop"];if(m.has(e,t))return e[t];var o=m.findIndex(i,function(e){return t===e});return!m.isEmpty(t)&&o<i.length?p(e,i[o+1]):_.extend(!0,{desktop:""},u).desktop},o=function(e){var t=c(),i={};i=_.extend(!0,{},u),m.isObject(t)?i=_.extend(!0,{},t):m.isString(t)&&!m.isEmpty(t)&&(i={desktop:t});var o,n,r=p(i,e),s=(n=r,m.isEmpty(n)||!m.isString(n)?"px":n.replace(/[0-9]|\.|,/g,"")),a=(o=r,m.isEmpty(o)||!m.isString(o)?"16":o.replace(/px|em|%/g,""));_(".sek-unit-wrapper",l).find('[data-sek-unit="'+s+'"]').trigger("click",{previewed_device_switched:!0}),l.find('.sek-ui-button[data-sek-unit="'+s+'"]').addClass("is-selected").attr("aria-pressed",!0),d.val(a).trigger("input",{previewed_device_switched:!0})};a.czr_sektions.maybeSetupDeviceSwitcherForInput.call(c),c.css_unit=new a.Value(m.isEmpty(i())?"px":s(i()));var n='<button type="button" class="button sek-reset-button sek-float-right">'+sektionsLocalizedData.i18n.Reset+"</button>";c.container.find(".customize-control-title").append(n),c.css_unit.bind(function(e,t,i){m.isObject(i)&&!0===i.previewed_device_switched||d.trigger("input")}),r.on("input",function(e){d.val(_(this).val()).trigger("input")}),d.on("input",function(e,t){var i,o=a.previewedDevice()||"desktop",n=_(this).val()+s(c.css_unit());(i=_.extend(!0,{},m.isObject(c())?c():{}))[o]=_.extend(!0,{},i[o]||{}),m.isString(n)&&!m.isEmpty(n)&&(i[o]=n),(m.isEmpty(t)||m.isObject(t)&&!0!==t.previewed_device_switched)&&c(i),r.val(_(this).val())}),l.on("click",".sek-ui-button",function(e,t){e.stopPropagation(),l.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),_(this).addClass("is-selected").attr("aria-pressed",!0),l.find("input[data-czrtype]").data("sek-unit",_(this).data("sek-unit")),c.css_unit(_(this).data("sek-unit"),t)}),c.previewedDevice.bind(function(e){try{o(e)}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+c.id,e)}}),c.container.on("click",".sek-reset-button",function(e){var t=a.previewedDevice(),i=_.extend(!0,{},m.isObject(c())?c():{});m.isEmpty(i[t])||(i=m.omit(i,t),c(i),o(a.previewedDevice()))}),r.val(d.val()||0);try{o(a.previewedDevice())}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+c.id,e)}}})}(wp.customize,jQuery,_),function(g,h,v){g.czrInputMap=g.czrInputMap||{},h.extend(g.czrInputMap,{borders:function(e){var a=this,c=h(".sek-borders",a.container),l=c.find('input[type="number"]'),d=c.find('input[type="range"]'),u=c.find(".sek-alpha-color-input"),p=function(e){return v.contains(["px","em","%"],e)||(g.errare("borders => error : invalid unit for input "+a.id,e),e="px"),e},_=function(e){return v.isEmpty(e)||!v.isString(e)?"16":e.replace(/px|em|%/g,"")},m=function(e){return v.isEmpty(e)||!v.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=g.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),f=v.isEmpty(t)||v.isEmpty(t.default)?{}:t.default;a.cssBorderTypes=["top","left","right","bottom"];var i,o,n=function(){var e=a(),t="px";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.wght)&&(t=p(m(e._all_.wght))),t},r=function(){var e=a(),t="#000000";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.col)&&(t=e._all_.col),t},s=function(e){if(!v.contains(v.union(a.cssBorderTypes,["_all_"]),e))throw new Error("Error in syncWithBorderType : the border type must be one of those values '_all_', 'top', 'left', 'right', 'bottom'");var t=a(),i={},o=h.extend(!0,{},f);v.isObject(t)?i=h.extend(!0,{},t):v.isString(t)&&(i={_all_:{wght:t}});var n,r,s=function(e,t){var i,o=h.extend(!0,{},f);if(!v.has(o,"_all_"))throw new Error("Error when firing getCurrentBorderTypeOrAllValue : the default value of the borders input must be php registered as an array formed : array( 'wght' => '1px', 'col' => '#000000' )");return i=v.isObject(e)&&v.has(e,"_all_")?v.extend(o._all_,e._all_):o._all_,v.has(e,t)&&v.isObject(e[t])?v.extend(i,e[t]):o._all_}(i=h.extend(o,i),e);if(v.isEmpty(s)||!v.isObject(s)||v.isEmpty(s.wght)||v.isEmpty(s.col))throw new Error("Error in syncWithBorderType : getCurrentBorderTypeOrAllValue must return an object formed : array( 'wght' => '1px', 'col' => '#000000' )");n=m(s.wght),r=_(s.wght),h(".sek-unit-wrapper",c).find('[data-sek-unit="'+n+'"]').trigger("click",{border_type_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+n+'"]').addClass("is-selected").attr("aria-pressed",!0),l.val(r).trigger("input",{border_type_switched:!0}),u.data("border_type_switched",!0),u.val(s.col).trigger("change"),u.data("border_type_switched",!1)};a.borderColor=new g.Value(v.isEmpty(r())?"#000000":r()),a.css_unit=new g.Value(v.isEmpty(n())?"px":p(n())),a.borderType=new g.Value("_all_"),l.val((i=a(),o=1,v.isObject(i)&&v.has(i,"_all_")&&v.isObject(i._all_)&&!v.isEmpty(i._all_.wght)&&(o=_(i._all_.wght)),o=parseInt(o,10),(!v.isNumber(o)||o<0)&&(g.errare("Error in borders input type for module : "+a.module.module_type+" the initial border width is invalid : "+o),o=1),o)),u.val(a.borderColor()),u.wpColorPicker({palettes:!0,width:1440<=window.innerWidth?271:251,change:function(e,t){h(this).val(t.color.toString()).trigger("colorpickerchange"),a.borderColor(t.color.toString(),{border_type_switched:!0===h(this).data("border_type_switched")})},clear:function(e,t){h(this).val("").trigger("colorpickerchange"),a.borderColor("")}}),a.css_unit.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_unit)&&l.trigger("input",i)}),a.borderColor.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_color)&&l.trigger("input",i)}),a.borderType.bind(function(e){try{s(e)}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}}),d.on("input",function(e){l.val(h(this).val()).trigger("input")}),l.on("input",function(e,t){var i,o=a.borderType()||"_all_",n=a.borderColor(),r=h(this).val()+p(a.css_unit()),s=h.extend(!0,{},f);(i=h.extend(!0,{},v.isObject(a())?a():s))[o]=h.extend(!0,{},i[o]||s[o]),v.isString(r)&&!v.isEmpty(r)&&(i[o].wght=r),i[o].col=n,(v.isEmpty(t)||v.isObject(t)&&!0!==t.border_type_switched)&&("_all_"===o&&v.each(a.cssBorderTypes,function(e){i=v.omit(i,e)}),a(i)),d.val(h(this).val())}),c.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),c.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",h(this).data("sek-unit")),a.css_unit(h(this).data("sek-unit"),t)}),c.on("click","[data-sek-border-type]",function(e,t){e.preventDefault(),c.find("[data-sek-border-type]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=h(this).data("sek-border-type")}catch(e){g.errare("borders input type => error when attaching click event",e)}a.borderType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.borderType()||"_all_",i=h.extend(!0,{},v.isObject(a())?a():{});v.isEmpty(i[t])||(i=v.omit(i,t),a(i),s(t))}),d.val(l.val()||0);try{s(a.borderType())}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}h('[data-sek-unit="'+a.css_unit()+'"]',c).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(m,f,g){m.czrInputMap=m.czrInputMap||{},f.extend(m.czrInputMap,{border_radius:function(e){var a=this,c=f(".sek-borders",a.container),l=c.find('input[type="number"]'),s=c.find('input[type="range"]'),d=function(e){return g.contains(["px","em","%"],e)||(m.errare("border_radius => error : invalid unit for input "+a.id,e),e="px"),e},u=function(e){return g.isEmpty(e)||!g.isString(e)?"16":e.replace(/px|em|%/g,"")},p=function(e){return g.isEmpty(e)||!g.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=m.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),_=g.isEmpty(t)||g.isEmpty(t.default)?{}:t.default;a.cssRadiusTypes=["top_left","top_right","bottom_right","bottom_left"];var i,o,n=function(){var e=a(),t="px";return g.isObject(e)&&g.has(e,"_all_")&&(t=d(p(e._all_))),t},r=function(e){if(!g.contains(["_all_","top_left","top_right","bottom_right","bottom_left"],e))throw new Error("Error in syncWithRadiusType : the radius type must be one of those values '_all_', 'top_left', 'top_right', 'bottom_right', 'bottom_left', => radius type => "+e);var t=a(),i={},o=f.extend(!0,{},_);g.isObject(t)?i=f.extend(!0,{},t):g.isString(t)&&(i={_all_:"0px"});var n,r,s=function(e,t){var i,o=f.extend(!0,{},_);if(!g.has(o,"_all_"))throw new Error("Error when firing getCurrentRadiusTypeOrAllValue : the default value of the border_radius input must be php registered as an array");return i=g.isObject(e)&&g.has(e,"_all_")?e._all_:o._all_,g.has(e,t)?e[t]:i}(i=f.extend(o,i),e);if(g.isEmpty(s)||!g.isString(s))throw new Error("Error in syncWithRadiusType : getCurrentRadiusTypeOrAllValue must return a string like 3em");n=p(s),r=u(s),f(".sek-unit-wrapper",c).find('[data-sek-unit="'+n+'"]').trigger("click",{radius_type_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+n+'"]').addClass("is-selected").attr("aria-pressed",!0),l.val(r).trigger("input",{radius_type_switched:!0})};a.css_unit=new m.Value(g.isEmpty(n())?"px":d(n())),a.radiusType=new m.Value("_all_"),l.val((i=a(),o=0,g.isObject(i)&&g.has(i,"_all_")&&(o=u(i._all_)),o=parseInt(o,10),(!g.isNumber(o)||o<0)&&(m.errare("Error in border_radius input type for module : "+a.module.module_type+" the initial radius is invalid : "+o),o=0),o)),a.css_unit.bind(function(e,t,i){(!g.isObject(i)||!0!==i.radius_type_switched&&!0!==i.initializing_the_unit)&&l.trigger("input",i)}),a.radiusType.bind(function(e){try{r(e)}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}}),s.on("input",function(e){l.val(f(this).val()).trigger("input")}),l.on("input",function(e,t){var i,o=a.radiusType()||"_all_",n=f(this).val()+d(a.css_unit()),r=f.extend(!0,{},_);(i=f.extend(!0,{},g.isObject(a())?a():r))[o]=f.extend(!0,{},i[o]||r[o]),g.isString(n)&&!g.isEmpty(n)&&(i[o]=n),(g.isEmpty(t)||g.isObject(t)&&!0!==t.radius_type_switched)&&("_all_"===o&&g.each(a.cssRadiusTypes,function(e){i=g.omit(i,e)}),a(i)),s.val(f(this).val())}),c.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),c.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",f(this).data("sek-unit")),a.css_unit(f(this).data("sek-unit"),t)}),c.on("click","[data-sek-radius-type]",function(e,t){e.preventDefault(),c.find("[data-sek-radius-type]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=f(this).data("sek-radius-type")}catch(e){m.errare("border_radius input type => error when attaching click event",e)}a.radiusType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.radiusType()||"_all_",i=f.extend(!0,{},g.isObject(a())?a():{});g.isEmpty(i[t])||(i=g.omit(i,t),a(i),r(t))}),s.val(l.val()||0);try{r(a.radiusType())}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}f('[data-sek-unit="'+a.css_unit()+'"]',c).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{buttons_choice:function(e){var o=this,n=s(".sek-button-choice-wrapper",o.container),t=n.find('input[type="number"]'),i=r.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type);a.isEmpty(i)||a.isEmpty(i.default)||i.default;t.val(o()),n.on("click","[data-sek-choice]",function(e,t){var i;e.stopPropagation(),n.find("[data-sek-choice]").removeClass("is-selected").attr("aria-pressed",!1),s(this).addClass("is-selected").attr("aria-pressed",!0);try{i=s(this).data("sek-choice")}catch(e){r.errare("buttons_choice input type => error when attaching click event",e)}o(i)}),s('[data-sek-choice="'+o()+'"]',n).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(o,n,r){o.czrInputMap=o.czrInputMap||{},n.extend(o.czrInputMap,{reset_button:function(e){this.container.on("click","[data-sek-reset-scope]",function(e,t){e.stopPropagation();var i=n(this).data("sek-reset-scope");!r.isEmpty(i)&&r.contains(["local","global"],i)?o.czr_sektions.updateAPISetting({action:"sek-reset-collection",scope:i}).done(function(e){o.previewer.refresh(),o.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}).fail(function(e){o.errare("reset_button input => error when firing ::updateAPISetting",e),o.previewer.trigger("sek-notify",{notif_id:"reset-failed",type:"error",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset failed"],"<br/>","<i>"+e+"</i>","</strong>","</span>"].join("")})}):o.errare("reset_button input => invalid scope provided.",i)})}})}(wp.customize,jQuery,_),function(i,r,s){i.czrInputMap=i.czrInputMap||{},r.extend(i.czrInputMap,{revision_history:function(e){var n=this;_selected_found=!1;var t=function(t){!0!==n.revisionHistorySet&&(r.when(r.Deferred(function(t){s.isEmpty(n.sek_revisionHistory)?i.czr_sektions.getRevisionHistory({is_local:"local_revisions"===n.id}).done(function(e){if(!s.isObject(e))throw new Error("_getRevisionHistory => server list is not a object");n.sek_revisionHistory=e,t.resolve(n.sek_revisionHistory)}).fail(function(e){t.reject(e)}):t.resolve(n.sek_revisionHistory)})).done(function(e){!function(e){if(!(0<n.container.find(".sek-revision-history").length))if(s.isEmpty(e))n.container.append(["<i>",sektionsLocalizedData.i18n["No revision history available for the moment."],"</i>"].join(""));else{n.container.append(r("<select/>",{class:"sek-revision-history",html:['<option value="_select_">'," -",sektionsLocalizedData.i18n.Select,"- ","</option>"].join("")}));var o=[];s.each(e,function(e,t){var i={value:t,html:e};i.value==n()&&(r.extend(i,{selected:"selected"}),_selected_found=!0),o.unshift(r("<option>",i))}),o[0].html([o[0].html(),sektionsLocalizedData.i18n["(currently published version)"]].join(" ")),s.each(o,function(e){r("select.sek-revision-history",n.container).append(e)}),r("select.sek-revision-history",n.container).selecter()}}(e),t&&!0===t.open_on_init&&s.delay(function(){try{r("select[data-czrtype]",n.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){i.errare("_getRevisionHistory => fail response =>",e)}),n.revisionHistorySet=!0)};n.container.on("change",".sek-revision-history",function(){var e=r(this).val();"_select_"!==e&&i.czr_sektions.setSingleRevision({revision_post_id:e,is_local:"local_revisions"===n.id})}),s.delay(function(){t({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(p,_,m){p.czrInputMap=p.czrInputMap||{},_.extend(p.czrInputMap,{nimble_tinymce_editor:function(){var t=this,e=t.container.find("textarea").first(),i=0<e.length?e.attr("id"):null,o=p.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type),n=sektionsLocalizedData.defaultToolbarBtns;if(m.isNull(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => missing textarea for module :"+t.module.id);if(tinyMCE.get(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => duplicate editor id.");var r,s,a=function(){return o&&o.editor_params&&!0===o.editor_params.autop},c={tinymce:{toolbar1:function(){var e=n.split(",");if(o.editor_params&&m.isArray(o.editor_params.excludedBtns)){var t=o.editor_params.excludedBtns;e=m.filter(e,function(e){return!m.contains(t,e)})}if(o.editor_params&&m.isString(o.editor_params.includedBtns)){var i=o.editor_params.includedBtns;m.isEmpty(i)||!m.isArray(sektionsLocalizedData[i])?p.errare("nimble_tinymce_editor input => invalid set of buttons provided",i):(i=sektionsLocalizedData[i],e=m.filter(e,function(e){return m.contains(i,e)}))}return e.join(",")}(),content_css:(r=wp.editor.getDefaultSettings(),s=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],r&&r.tinymce&&r.tinymce.content_css&&(s=m.union(r.tinymce.content_css.split(","),s)),s.join(",")),min_height:40,height:o.editor_params&&m.isNumber(o.editor_params.height)?o.editor_params.height:p.czr_sektions.TINYMCE_EDITOR_HEIGHT},quicktags:{buttons:"strong,em,link,code"},mediaButtons:!o.editor_params||!1!==o.editor_params.media_button};c.tinymce.wpautop=a(),a()||(c.tinymce.forced_root_block=""),wp.editor.initialize(i,c);var l=tinyMCE.get(i);if(!l)throw new Error("setupTinyMceEditor => missing editor instance for module :"+t.module.id);p.czrActiveWPEditors=p.czrActiveWPEditors||[];var d=_.extend(!0,[],p.czrActiveWPEditors);d.push(i),p.czrActiveWPEditors=d;var u=function(){e.html(t()),l.setContent(t())};l.initialized?u():l.on("init",u),l.on("input change keyup",function(e){t(l.getContent())})},detached_tinymce_editor:function(){var e,t=this,i=_("textarea#"+sektionsLocalizedData.idOfDetachedTinyMceTextArea),o=p.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type);if(!(0<i.length))throw new Error("api.czrInputMap::detached_tinymce_editor => missing textarea element");if(e=i.attr("id"),window.tinymce&&(mceInstance=window.tinymce.get(e),mceInstance&&mceInstance.remove()),!window.nimbleTinyMCEPreInit||!window.nimbleTinyMCEPreInit.mceInit||!window.nimbleTinyMCEPreInit.mceInit[e])throw new Error("setupDetachedTinyMceEditor => invalid nimbleTinyMCEPreInit global var");var n,r,s=nimbleTinyMCEPreInit.mceInit[e];s.content_css=(n=wp.editor.getDefaultSettings(),r=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],n&&n.tinymce&&n.tinymce.content_css&&(r=m.union(n.tinymce.content_css.split(","),r)),r.join(","));var a=t.input_parent,c=function(){var e=a();return m.isUndefined(e.autop)?o&&o.editor_params&&!0===o.editor_params.autop:e.autop};s.wpautop=c(),c()||(s.forced_root_block=""),s.toolbar1=sektionsLocalizedData.defaultToolbarBtns,s.toolbar2="",window.tinymce.init(s),window.QTags.getInstance(e);var l=tinyMCE.get(e);if(!l)throw new Error("setupDetachedTinyMceEditor => missing editor instance for module :"+t.module.id);var d=function(){var e=t();l.setContent(e),p.sekEditorExpanded(!0),_(window).trigger("resize")};l.initialized?d():l.on("init",d),l.on("input change keyup keydown click SetContent BeforeSetContent",function(e){t(c()?l.getContent():wp.editor.removep(l.getContent()))}),p.sekCurrentDetachedTinyMceInput=t,i.data("czr-bound-for-detached-editor")||(i.on("input",function(e,t){p.sekCurrentDetachedTinyMceInput(_(this).val())}),i.data("czr-bound-for-detached-editor",!0))}})}(wp.customize,jQuery,_),function(l,d,u){l.czrInputMap=l.czrInputMap||{},d.extend(l.czrInputMap,{import_export:function(){var r=this,t=r.container.find('button[data-czr-action="sek-pre-import"]'),s=r.container.find("input[name=sek-import-file]"),e=l.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=e.scope,c="local"===e.scope?l.czr_sektions.localSectionsSettingId():l.czr_sektions.getGlobalSectionsSettingId();u.contains(["local","global"],a)||l.errare("api.czrInputMap.import_export => invalid currentScope",a),s.on("change",function(e){t.toggleClass("disabled",u.isEmpty(d(this).val()))});r.container.on("click","[data-czr-action]",function(e){var i,t;switch(e.stopPropagation(),d(this).data("czr-action")){case"sek-export":if(i=!1,t=wp.customize.dirtyValues(),u.isEmpty(t)||u.each(t,function(e,t){i||(i=-1!==t.indexOf("nimble"))}),i){alert(sektionsLocalizedData.i18n["You need to publish before exporting."]);break}var o=l(c)(),n=!0;if(u.each(o.collection,function(e){n&&(u.isEmpty(e.collection)||(n=!1))}),n){alert(sektionsLocalizedData.i18n["Nothing to export."]);break}l.czr_sektions.export_template({scope:a});break;case"sek-pre-import":if(u.isEmpty(l.czr_sektions.activeLocations())){alert(sektionsLocalizedData.i18n["The current page has no available locations to import Nimble Builder sections."]);break}l.czr_sektions.import_template_from_file({pre_import_check:!0,input:r,file_input:s}).done(function(e){l.czr_sektions.pre_checks_from_file_import(e,{pre_import_check:!1,input:r,file_input:s})}).fail(function(e){l.errare("import_export_ input => pre_checks_from_file_import failed",e),l.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s}),l.czr_sektions.import_template_from_file({input:r,file_input:s})});break;case"sek-import-as-is":l.czr_sektions.import_template_from_file({input:r,file_input:s});break;case"sek-import-assign":l.czr_sektions.import_template_from_file({assign_missing_locations:!0,input:r,file_input:s});break;case"sek-cancel-import":l.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s})}})}})}(wp.customize,jQuery,_),function(c,l,d){c.czrInputMap=c.czrInputMap||{},l.extend(c.czrInputMap,{simpleselect:function(e){c.czr_sektions.setupSelectInput.call(this,e)},multiselect:function(e){c.czr_sektions.setupSelectInput.call(this,e)},simpleselectWithDeviceSwitcher:function(e){var r=this,t=(r.input_parent,r.module,c.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type)),n=l("select",r.container),s=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i={params:e=d.isEmpty(e)?t.choices:e};if(r.module.trigger("nimble-set-select-input-options",i),e=i.params,!d.isEmpty(e)&&d.isObject(e)){d.each(e,function(e,t){var i={value:t,html:e};t==r()?l.extend(i,{selected:"selected"}):"px"===t&&l.extend(i,{selected:"selected"}),n.append(l("<option>",i))});var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var o=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&o<i.length?a(e,i[o+1]):l.extend(!0,{desktop:""},s).desktop};c.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r),n.on("change",function(e,t){var i,o=c.previewedDevice()||"desktop",n=l(this).val();(i=l.extend(!0,{},d.isObject(r())?r():{}))[o]=l.extend(!0,{},i[o]||{}),d.isString(n)&&!d.isEmpty(n)&&(i[o]=n),(d.isEmpty(t)||d.isObject(t)&&!0!==t.previewed_device_switched)&&r(i)}),r.previewedDevice.bind(function(e){try{!function(e){var t=r(),i={};i=l.extend(!0,{},s),d.isObject(t)?i=l.extend(!0,{},t):d.isString(t)&&!d.isEmpty(t)&&(i={desktop:t});var o=a(i,e);n.val(o).trigger("change",{previewed_device_switched:!0})}(e)}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type "+r.type+" for input id "+r.id,e)}})}else c.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+r.id+" in module "+r.module.module_type)}})}(wp.customize,jQuery,_),function(a,c,l){a.czrInputMap=a.czrInputMap||{},c.extend(a.czrInputMap,{category_picker:function(e){var o=this,n=c("select[data-czrtype]",o.container),r=function(){var e=o();return e=l.isString(e)?[e]:e,l.isArray(e)?e:[]},t=function(t){!0!==o.catCollectionSet&&(c.when(c.Deferred(function(i){l.isEmpty(a.czr_sektions.post_categories)?wp.ajax.post("sek_get_post_categories",{nonce:a.settings.nonce.save}).done(function(e){l.isArray(e)||a.errare(o.id+" => error => invalid category collection sent by server");var t={};l.each(e,function(e){l.isEmpty(e.slug)||l.isEmpty(e.name)?i.reject("missing slug or name for at least one category"):t[e.slug]=e.name}),a.czr_sektions.post_categories=t,i.resolve(a.czr_sektions.post_categories)}).fail(function(e){i.reject(e)}):i.resolve(a.czr_sektions.post_categories)})).done(function(e){i(e),t&&!0===t.open_on_init&&l.delay(function(){try{n.czrSelect2("open")}catch(e){}},100)}).fail(function(e){a.errare(o.id+" => fail response when _getCategoryCollection()",e)}),o.catCollectionSet=!0)},i=function(e){l.each(e,function(e,t){var i={value:t,html:e};l.contains(r(),t)&&c.extend(i,{selected:"selected"}),n.append(c("<option>",i))}),n.czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),n.on("change",function(){0===c(this).find("option:selected").length&&o([])})},s={};l.each(r(),function(e){s[e]=(e+"").replace(/-/g," ")}),i(s),o.container.on("click",function(){!0!==o.catCollectionSet&&(n.czrSelect2("destroy"),c.when(n.find("option").remove()).done(function(){t({open_on_init:!0})}))})}})}(wp.customize,jQuery,_),function(r,s,e){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{grid_layout:function(e){var o=this,n=s(".sek-grid-layout-wrapper",o.container);n.find('input[type="hidden"]').val(o()),n.on("click","[data-sek-grid-layout]",function(e,t){var i;e.stopPropagation(),n.find("[data-sek-grid-layout]").removeClass("selected").attr("aria-pressed",!1),s(this).addClass("selected").attr("aria-pressed",!0);try{i=s(this).data("sek-grid-layout")}catch(e){r.errare(o.type+" => error when attaching click event",e)}o(i)}),s('[data-sek-grid-layout="'+o()+'"]',n).trigger("click")}})}(wp.customize,jQuery,_),function(i,e,t){i.czrInputMap=i.czrInputMap||{},e.extend(i.czrInputMap,{refresh_preview_button:function(e){this.container.on("click",".sek-refresh-button",function(e,t){e.stopPropagation(),i.previewer.refresh()})}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_content_type_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_content_type_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_module_picker_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_module_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_module_picker_module"))}})}(wp.customize,jQuery,_),function(t,e,i){t.czrModuleMap=t.czrModuleMap||{};var o=sektionsLocalizedData.presetSectionsModules;i.isArray(o)&&!i.isEmpty(o)?i.each(o,function(e){t.czrModuleMap[e]={crud:!1,name:t.czr_sektions.getRegisteredModuleProperty(e,"name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData(e))}}):t.errare("api.czrModuleMap => error when adding section modules")}(wp.customize,jQuery,_),function(s,i,a){var e={initialize:function(e,t){this.inputConstructor=s.CZRInput.extend({initialize:function(e,t){var i=this;s.CZRInput.prototype.initialize.call(i,e,t),i.isReady.then(function(){i.renderUserSavedSections(),i.attachDomEvents()})},getUserSavedSections:function(){var t=i.Deferred();return a.isEmpty(s.czr_sektions.userSavedSections)?s.czr_sektions.getSavedSectionCollection().done(function(e){t.resolve(e)}):t.resolve(s.czr_sektions.userSavedSections),t.promise()},renderUserSavedSections:function(){var o=this,n="",r=o.container.find(".sek-content-type-wrapper"),t=function(e){if(r.find(".sek-user-section-wrapper").remove(),a.isEmpty(e)){var t=[sektionsLocalizedData.baseUrl,"/assets/admin/img/save_section_notice.png","?ver=",sektionsLocalizedData.nimbleVersion].join("");doc_url="https://docs.presscustomizr.com/article/417-how-to-save-and-reuse-sections-with-nimble-builder",n=['<div class="sek-user-section-wrapper">','<img src="'+t+'" />','<br/><a href="'+doc_url+'" target="_blank" rel="noreferrer nofollow">'+doc_url+"</a>","</div>"].join(""),r.append(n),o.module.container.find(".czr-item-content .customize-control-title").html("You did not save any section yet.")}else{var i="background: url("+[sektionsLocalizedData.baseUrl,"/assets/admin/img/nb_sec_pholder.png","?ver=",sektionsLocalizedData.nimbleVersion].join("")+") 50% 50% / cover no-repeat;";a.each(e,function(e,t){a.isEmpty(e.description)?_titleAttr=[e.title,e.last_modified_date].join(" | "):_titleAttr=[e.title,e.last_modified_date,e.description].join(" | "),n=['<div class="sek-user-section-wrapper">','<div draggable="true" data-sek-is-user-section="true" data-sek-section-type="content" data-sek-content-type="preset_section" data-sek-content-id="'+t+'" style="" title="'+e.title+'">','<div class="sek-sec-thumb" style="'+i+'"></div>','<div class="sek-overlay"></div>','<div class="sek-sec-info" title="'+_titleAttr+'">','<h3 class="sec-title">'+e.title+"</h3>",'<p class="sec-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",'<p class="sec-desc">'+e.description+"</p>",'<i class="material-icons remove-user-sec" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>',"</div>","</div>","</div>"].join(""),r.append(n)})}s.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:o.container})};o.getUserSavedSections().done(function(e){t(e)}),s.czr_sektions.allSavedSections.bind(function(e){t(e)})},attachDomEvents:function(){this.container.on("click",".sek-sec-info .remove-user-sec",function(e){e.preventDefault();var t=s.czr_sektions,i=function(e){t.saveSectionDialogMode("remove"),t.saveSectionDialogMode.unbind(i)};t.saveSectionDialogMode.bind(i),t.saveSectionDialogVisible(!0)})}}),s.CZRDynModule.prototype.initialize.call(this,e,t)}};s.czrModuleMap=s.czrModuleMap||{},i.extend(s.czrModuleMap,{sek_my_sections_sec_picker_module:{mthds:e,crud:!1,name:s.czr_sektions.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:s.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_my_sections_sec_picker_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_mod_option_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_mod_option_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_mod_option_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_anchor_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_anchor_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_anchor_module"))}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"bg-image":s.each(["bg-attachment","bg-scale","bg-repeat","bg-parallax","bg-parallax-force"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"bg-parallax-force":e=!s.isEmpty(i()+"")&&r.CZR_Helpers.isChecked(o.czr_Input("bg-parallax")());break;case"bg-scale":case"bg-repeat":e=!s.isEmpty(i()+"")&&!r.CZR_Helpers.isChecked(o.czr_Input("bg-parallax")());break;default:e=!s.isEmpty(i()+"")}return e})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-apply-overlay":s.each(["bg-color-overlay","bg-opacity-overlay"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return r.CZR_Helpers.isChecked(i())})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-parallax":s.each(["bg-parallax-force","bg-scale","bg-repeat"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"bg-parallax-force":e=!s.isEmpty(o.czr_Input("bg-image")()+"")&&r.CZR_Helpers.isChecked(i());break;case"bg-repeat":case"bg-scale":e=!s.isEmpty(o.czr_Input("bg-image")()+"")&&!r.CZR_Helpers.isChecked(i())}return e})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}}),i.bind(function(e){r.CZR_Helpers.isChecked(i())&&r.CZR_Helpers.isChecked(o.czr_Input("bg-attachment")())&&o.czr_Input("bg-attachment").container.find("input[type=checkbox]").trigger("click")});break;case"bg-attachment":i.bind(function(e){r.CZR_Helpers.isChecked(i())&&r.CZR_Helpers.isChecked(o.czr_Input("bg-parallax")())&&o.czr_Input("bg-parallax").container.find("input[type=checkbox]").trigger("click")});break;case"bg-use-video":s.each(["bg-video","bg-video-loop","bg-video-delay-start","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return r.CZR_Helpers.isChecked(i())})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}})}}),n.control&&n.control.params&&n.control.params.sek_registration_params&&(s.contains(["section","column"],n.control.params.sek_registration_params.level)||s.each(["bg-use-video","bg-video","bg-video-loop","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){o.czr_Input(e).visible(!1)}))}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{sek_level_bg_module:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("sek_level_bg_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:s.extend({id:"",title:""},r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_bg_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_text_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_text_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_text_module")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_border_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_border_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_border_module"))}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":n.each(["custom-breakpoint","apply-to-all"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_breakpoint_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_breakpoint_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_breakpoint_module"))}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":n.each(["custom-height","overflow_hidden"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_height_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_height_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_height_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_visibility_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_visibility_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_visibility_module"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"width-type":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"custom-width",function(){return"custom"===e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_module"))}})}(wp.customize,jQuery,_),function(d,u,p){var e={initialize:function(e,t){var i=this;i.inputConstructor=d.CZRInput.extend(i.CZRInputConstructor||{}),i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputConstructor:{range_simple:function(e){var t,i=this,o=u(".sek-range-with-unit-picker-wrapper",i.container),n=o.find('input[type="number"]'),r=o.find('input[type="range"]');try{t=i.module.control.params.sek_registration_params}catch(e){return void d.errare("Error when getting the module registration params",e)}if(p.isUndefined(t.level_id))d.errare("Error : missing column id",er);else if(i.columnId=t.level_id,i.columnModel=u.extend(!0,{},d.czr_sektions.getLevelModel(i.columnId)),i.parentSectionModel=d.czr_sektions.getParentSectionFromColumnId(i.columnId),"no_match"!=i.columnModel)if("no_match"!=i.parentSectionModel){i.colNb=p.size(i.parentSectionModel.collection),n.attr("data-sek-width-range-column-id",i.columnId),1===i.colNb?i.container.html(["<p>",sektionsLocalizedData.i18n["This is a single-column section with a width of 100%. You can act on the internal width of the parent section, or adjust padding and margin."]].join("")):i.container.show();var s,a=d.czr_sektions.getLevelModel(i.columnId),c="_not_set_";if("no_match"!=a){var l=a.options&&a.options.width&&a.options.width["custom-width"]&&p.isNumber(+a.options.width["custom-width"]);l?c=a.options.width["custom-width"]:!l&&a.width&&p.isNumber(+a.width)&&(c=a.width),s="_not_set_"!==c?c:"_not_set_"===i()?Math.floor(100/i.colNb):i(),s=1*+parseFloat(s).toFixed(3),(!p.isNumber(s)||100<s||s<0)&&(d.errare("Error => invalid column width",s),s=50),r.on("input",function(e,t){n.val(u(this).val()).trigger("input",t)}),n.on("input",p.debounce(function(e,t){r.val(u(this).val()),t&&t.is_init||i(+parseFloat(u(this).val()).toFixed(3))},300)),n.on("input",p.debounce(function(e,t){t&&(t.is_init||t.is_resize_column_trigger)||i.sayItToApi(u(this).val())},300)),r.val(s).trigger("input",{is_init:!0})}else d.errare("sek_level_width_column module => invalid column model")}else d.errare("sek_level_width_column module => invalid parent section model");else d.errare("sek_level_width_column module => invalid column model")},sayItToApi:function(e,t){var i=this,o=p.findIndex(i.parentSectionModel.collection,{id:i.columnId}),n=o+1==i.colNb?o-1:o+1,r=p.find(i.parentSectionModel.collection,function(e,t){return n===t});"no_match"===r&&d.errare("sek_level_width_column module => invalid sister column model"),d.previewer.trigger("sek-resize-columns",{action:"sek-resize-columns",level:"column",in_sektion:i.parentSectionModel.id,id:i.columnId,resized_column:i.columnId,sister_column:r.id,resizedColumnWidthInPercent:e,col_number:i.colNb})}}};d.czrModuleMap=d.czrModuleMap||{},u.extend(d.czrModuleMap,{sek_level_width_column:{mthds:e,crud:!1,name:d.czr_sektions.getRegisteredModuleProperty("sek_level_width_column","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:p.extend({id:"",title:""},d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_column"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_section:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_section","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_section"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_spacing_module:{mthds:"",crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_spacing_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_spacing_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_cust_css_section:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_cust_css_section","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_cust_css_section"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this.module;i.trigger("nb_setup_visibility_deps_for_animation_module",{item:this,module:e})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_animation_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_animation_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_animation_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_template:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_template","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_template"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_local_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_local_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_custom_css:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_custom_css","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_custom_css"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_header_footer"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_imp_exp"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"links_underline":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"links_underline_hover",function(){return!e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_text:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_text","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_text"))}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":n.each(["global-custom-breakpoint","apply-to-all"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_global_breakpoint:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_global_breakpoint","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_breakpoint"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_header_footer"))}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"enable":s.each(["public_key","private_key","badge","show_failure_message","failure_message","score"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"failure_message":e=i()&&o.czr_Input("show_failure_message")();break;default:e=i()}return e})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_failure_message":s.each(["failure_message"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&o.czr_Input("enable")()})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{sek_global_recaptcha:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("sek_global_recaptcha","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:s.extend({id:"",title:""},r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_recaptcha"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_imp_exp"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_beta_features:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_beta_features","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_beta_features"))}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,t=o.module;o.czr_Input.each(function(i){switch(i.id){case"img":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"img-size",function(){return!r.isEmpty(i()+"")&&r.isNumber(i())});break;case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!r.contains(["no-link","img-lightbox"],i())}return e})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"border-type":r.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"none"!==i()})}catch(e){n.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"use_custom_width":r.each(["custom_width"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_height":r.each(["custom_height"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_title_attr":r.each(["heading_title"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}})}}),n.trigger("nb_setup_visibility_deps_for_img_module",{item:o,module:t})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_image_main_settings_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_image_main_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_main_settings_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_image_borders_corners_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_image_borders_corners_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_borders_corners_child")}})}(wp.customize,jQuery,_),function(o,e,t){var i={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend(this.CZRTextEditorInputMths||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRTextEditorInputMths:{initialize:function(e,t){var i=this;"detached_tinymce_editor"==i.type&&i.isReady.then(function(){i.container.find('[data-czr-action="open-tinymce-editor"]').trigger("click")}),o.CZRInput.prototype.initialize.call(i,e,t)}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_tinymce_child:{mthds:i,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_tinymce_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_tinymce_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_html_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_html_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_html_module")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(i){switch(i.id){case"img-type":n.each(["img-id","img-size"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img-id":e="custom"===i();break;default:e="none"!==i()}return e})}catch(e){o.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"content-type":n.each(["content-custom-text"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"custom"===i()})}catch(e){o.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"btn-display":n.each(["btn-custom-text"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_featured_pages_module:{mthds:t,crud:o.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","is_crud"),hasPreItem:!1,refresh_on_add_item:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_featured_pages_module")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":s.each(["link-pick-url","link-custom-url","link-target"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":r.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"use_custom_color_on_hover":s.each(["color_hover"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_icon_settings_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_icon_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_settings_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_icon_spacing_border_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_icon_spacing_border_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_spacing_border_child")}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this;o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e=i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;case"link-pick-url":case"link-target":e=i()}return e})}catch(e){n.errare("Heading module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&!0===o.czr_Input("link-to")()})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_heading_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_heading_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_heading_spacing_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_heading_spacing_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_spacing_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_divider_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_divider_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_divider_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_spacer_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_spacer_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_spacer_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_map_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_map_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_map_module")}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRButtonItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"quote_design":o.each(["border_width_css","border_color_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"border-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}}),o.each(["icon_color_css","icon_size_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"quote-icon-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_quote_design_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_quote_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_design_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_quote_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_quote_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_quote_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_cite_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_cite_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_cite_child")}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this;o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"icon":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"icon-side",function(){return!r.isEmpty(i())})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_btn_content_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_btn_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_content_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":n.each(["bg_color_hover"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":n.each(["push_effect"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"width-type":o.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-width",function(){return"custom"===t()}),n.each(["custom-width","h_inner_align_css"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"height-type":o.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-height",function(){return"custom"===t()})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_btn_design_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_btn_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_design_child")}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this.module;this.czr_Input.each(function(i){switch(i.id){case"layout":r.each(["columns","img_column_width","has_tablet_breakpoint","has_mobile_breakpoint"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"columns":e="grid"===i();break;case"has_tablet_breakpoint":case"has_mobile_breakpoint":case"img_column_width":e="list"===i()}return e})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"categories":r.each(["must_have_all_cats"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){var e=i();return r.isArray(e)&&1<e.length})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"display_pagination":r.each(["posts_per_page","post_number"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"posts_per_page"===e?i():!i()})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"custom_grid_spaces":r.each(["column_gap","row_gap"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_excerpt":r.each(["excerpt_length"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_post_grid_main_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_post_grid_main_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_main_child")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"show_thumb":s.each(["img_size","img_has_custom_height","img_height","border_radius_css","use_post_thumb_placeholder"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img_height":e=i()&&o.czr_Input("img_has_custom_height")();break;default:e=i()}return e})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"img_has_custom_height":s.each(["img_height"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&o.czr_Input("show_thumb")()})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_post_grid_thumb_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_post_grid_thumb_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_thumb_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_metas_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_metas_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_metas_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_content_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_content_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_mobile_options:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_mobile_options","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_mobile_options")}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"show_name_field":o.each(["name_field_label","name_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_subject_field":o.each(["subject_field_label","subject_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_message_field":o.each(["message_field_label","message_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_privacy_field":o.each(["privacy_field_label","privacy_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,"link-custom-url",function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_simple_form_fields_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fields_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fields_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_simple_form_design_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_simple_form_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_design_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":n.each(["bg_color_hover"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":n.each(["push_effect"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_simple_form_button_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_simple_form_button_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_button_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_submission_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_submission_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_submission_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_font_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_font_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_font_child")}})}(wp.customize,jQuery,_),function(i,e,t){var o={initialize:function(e,t){this.bind("nimble-set-select-input-options",function(e){e.params=sektionsLocalizedData.registeredWidgetZones}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_widget_area_module:{mthds:o,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_widget_area_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_widget_area_module")}})}(wp.customize,jQuery,_),function(s,a,c){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=s.CZRItem.extend(i.CZRItemConstructor||{}),s.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return s.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&a.fn.sortable){var i=this;a("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){c.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!c.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){s.errorLog("item.setInputVisibilityDeps() : "+e)}}),s.CZRItem.prototype.ready.call(t)},_buildTitle:function(e,t,i){var o=this.module;return e=e||("string"==typeof t?s.CZR_Helpers.capitalize(t.replace("fa-","")):""),e=s.CZR_Helpers.truncate(e,20),'<div><span class="'+t+'" style="color:'+(i=i||o.defaultSocialColor)+'"></span> '+e+"</div>"},writeItemViewTitle:function(e){var t=this.module,i=e||this(),o=(i.icon?i.icon:"").replace("fa-","").replace("envelope","email").replace("far","").replace("fab","").replace("fas","");a("."+t.control.css_attr.item_title,this.container).html(this._buildTitle(o,i.icon,i.color_css))},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_color_on_hover":c.each(["social_color_hover"],function(e){try{s.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){s.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,o=c.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),o=c.without(o,c.findWhere(o,{id:t.id})),i.itemCollection.set(o),i.trigger("pre_item_api_remove",t());var n=a.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=s(i.control.id).transport||!c.has(e,"dom_event")||c.has(e.dom_event,"isTrigger")||s.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",n),i.control.trigger("item-removed",n);else{var r=function(){s.previewer.unbind("ready",r),i.trigger("item-removed",n)};s.previewer.bind("ready",r)}}}};s.czrModuleMap=s.czrModuleMap||{},a.extend(s.czrModuleMap,{czr_social_icons_settings_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:s.czr_sektions.getRegisteredModuleProperty("czr_social_icons_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:s.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_settings_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_social_icons_style_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_social_icons_style_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_style_child")}})}(wp.customize,jQuery,_),function(g,h,v){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=g.CZRItem.extend(i.CZRItemConstructor||{}),g.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return g.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&h.fn.sortable){var i=this;h("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){v.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","starting_value"),t=h.extend(!0,{},this.preItem());if(v.isObject(e)){var i=h.extend(!0,{},e);return h.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!v.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){g.errorLog("item.setInputVisibilityDeps() : "+e)}}),g.CZRItem.prototype.ready.call(t);var i=function(){g.previewer.send("sek-item-focus",{control_id:t.module.control.id,item_id:t.id,item_value:t()})};t.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),t.callbacks.add(i),t.bind("sek-request-item-focus-in-preview",i)},writeItemViewTitle:function(e,t){var i=this,o=i.module,n=e||i(),r="",s="",a="not_set",c=!v.isUndefined(t)&&v.isObject(t);if(!c||!t.input_changed||v.contains(["img","text_content"],t.input_changed)){if(v.isEmpty(n.title)){var l=v.findIndex(o.itemCollection(),function(e){return e.id===i.id});l=v.isUndefined(l)?1:l+1}else r=n.title;r=g.CZR_Helpers.truncate(r,15),n.img&&(s=n.img,v.isString(n.img)&&(s=-1!==n.img.indexOf("http")?n.img:parseInt(n.img,10)));var d=function(){return h.Deferred(function(){var e=this;v.isUndefined(s)||v.isEmpty(""+s)?e.resolve(""):v.isString(s)&&-1!==s.indexOf("http")?e.resolve(s):wp.media.attachment(s).fetch().always(function(){if(v.isObject(this)&&v.has(this,"attributes")&&v.has(this.attributes,"sizes")){var i=this.get("sizes");i&&v.isObject(i)&&v.each(["thumbnail","medium","large","full"],function(e,t){"not_set"===a&&i[e]&&v.isObject(i[e])&&i[e].url&&(a=i[e].url)}),e.resolve(a)}})}).promise()},u=h("."+o.control.css_attr.item_title,i.container).find(".sek-slide-title"),p=h("."+o.control.css_attr.item_title,i.container).find(".sek-slide-thumb"),_=n.text_content?n.text_content:"";_=(_=h("<div>").html(_).text()).substring(0,60),u.length<1?(h("."+o.control.css_attr.item_title,i.container).html(""),h("."+o.control.css_attr.item_title,i.container).append(h("<div/>",{class:"sek-slide-title",html:_}))):u.html(_);var m=c&&t.input_changed&&"img"===t.input_changed,f=function(e){return v.isEmpty(""+e)||"not_set"===e?"":'<img src="'+e+'" width="32" alt="'+r+'" />'};h("."+o.control.css_attr.item_title,i.container).css("padding","0 4px"),p.length<1?d().done(function(e){h("."+o.control.css_attr.item_title,i.container).prepend(h("<div/>",{class:"sek-slide-thumb",html:f(e)}))}):!m&&c||d().done(function(e){p.html(f(e))})}},setInputVisibilityDeps:function(){var o=this,t=o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":v.each(["link-pick-url","link-custom-url","link-target"],function(t){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!v.contains(["no-link"],i())}return e})}catch(e){g.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":g.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"apply-overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"enable_text":v.each(["text_content","font_family_css","font_size_css","line_height_css","color_css","h_alignment_css","v_alignment","spacing_css"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"apply_overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,o=v.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),o=v.without(o,v.findWhere(o,{id:t.id})),i.itemCollection.set(o),i.trigger("pre_item_api_remove",t());var n=h.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=g(i.control.id).transport||!v.has(e,"dom_event")||v.has(e.dom_event,"isTrigger")||g.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",n),i.control.trigger("item-removed",n);else{var r=function(){g.previewer.unbind("ready",r),i.trigger("item-removed",n)};g.previewer.bind("ready",r)}}}};g.czrModuleMap=g.czrModuleMap||{},h.extend(g.czrModuleMap,{czr_img_slider_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:g.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_collection_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=o.CZRItem.extend(i.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":n.each(["custom-height"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"autoplay":n.each(["autoplay_delay","pause_on_hover"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return o.CZR_Helpers.isChecked(t())})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_img_slider_opts_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_img_slider_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_opts_child")}})}(wp.customize,jQuery,_),function(d,u,p){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return d.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&u.fn.sortable){var i=this;u("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){p.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","starting_value"),t=u.extend(!0,{},this.preItem());if(p.isObject(e)){var i=u.extend(!0,{},e);return u.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var e=this;d.CZRItem.prototype.ready.call(e);var i=function(){d.previewer.send("sek-item-focus",{control_id:e.module.control.id,item_id:e.id,item_value:e()})};e.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),e.callbacks.add(i),e.bind("sek-request-item-focus-in-preview",i),e.module.bind("item-collection-sorted",function(){e.writeItemViewTitle(e(),{input_changed:"title_text"})})},writeItemViewTitle:function(e,t){var i=this,o=i.module,n=e||i(),r="";if(!(!p.isUndefined(t)&&p.isObject(t))||!t.input_changed||p.contains(["title_text"],t.input_changed)){if(p.isEmpty(n.title)){var s=p.findIndex(o.itemCollection(),function(e){return e.id===i.id});s=p.isUndefined(s)?1:s+1}else r=n.title;r=d.CZR_Helpers.truncate(r,25);var a=u("."+o.control.css_attr.item_title,i.container).find(".sek-accord-title"),c=n.title_text?n.title_text:"";c=u("<div>").html(c).text();var l=i.module.container.find(".czr-items-wrapper > li").index(i.container);c=(c=p.isEmpty(c)?sektionsLocalizedData.i18n["Accordion title"]+" #"+(+l+1):c).substring(0,60),a.length<1?(u("."+o.control.css_attr.item_title,i.container).html(""),u("."+o.control.css_attr.item_title,i.container).append(u("<div/>",{class:"sek-accord-title",html:c}))):a.html(c)}},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,o=p.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),o=p.without(o,p.findWhere(o,{id:t.id})),i.itemCollection.set(o),i.trigger("pre_item_api_remove",t());var n=u.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=d(i.control.id).transport||!p.has(e,"dom_event")||p.has(e.dom_event,"isTrigger")||d.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",n),i.control.trigger("item-removed",n);else{var r=function(){d.previewer.unbind("ready",r),i.trigger("item-removed",n)};d.previewer.bind("ready",r)}}}};d.czrModuleMap=d.czrModuleMap||{},u.extend(d.czrModuleMap,{czr_accordion_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_collection_child")}})}(wp.customize,jQuery,_),function(o,e,t){var i={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=o.CZRItem.extend(i.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){o.CZRItem.prototype.ready.call(this)}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_accordion_opts_child:{mthds:i,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_accordion_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_opts_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRButtonItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_flex":n.each(["h_alignment_css"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_shortcode_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_shortcode_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_shortcode_module")}})}(wp.customize,jQuery,_);
|
1 |
+
!function(p,m){p.CZR_Helpers.getInputSubTemplate=function(e){return 0<m("#tmpl-nimble-subtemplate___"+e).length?wp.template("nimble-subtemplate___"+e):(p.errare("problem in api.czr_sektions.getInputSubTemplate(), missing js template in the DOM for template_name : "+e),null)};var f=p.CZR_Helpers.getModuleTmpl;p.CZR_Helpers.getModuleTmpl=function(o){if(-1===(o=_.extend({tmpl:"",module_type:"",module_id:"",cache:!0,nonce:p.settings.nonce.save},o)).module_id.indexOf("__nimble__"))return f(o);var n=m.Deferred();if((_.isEmpty(o.tmpl)||_.isEmpty(o.module_type))&&n.reject("api.CZR_Helpers.getModuleTmpl => missing tmpl or module_type param"),!p.czr_sektions.isModuleRegistered(o.module_type))return n.reject("api.CZR_Helpers.getModuleTmpl => module type not registered"),n.resolve(),f(o);if(_.contains([],o.module_type))return n.resolve(),f(o);var e=p.czr_sektions.getRegisteredModuleProperty(o.module_type,"tmpl"),t=_.isObject(e)&&e[o.tmpl]?e[o.tmpl]:{};!_.isEmpty(t)&&_.isObject(t)||(p.errare("getModuleTmpl => Error empty or invalid input map for module : ",o.module_type),n.reject("getModuleTmpl => Error empty or invalid input map for module : ",o.module_type));var r=o.item_model,i=m.extend(!0,{},p.czr_sektions.getDefaultItemModelFromRegisteredModuleData(o.module_type)),s=m.extend(!0,{},i);r=m.extend(s,r),_.isEmpty(r)&&(p.errare("getModuleTmpl => Error invalid item model for module : ",o.module_type),n.reject("getModuleTmpl => Error invalid item model for module : ",o.module_type));var a,c="",l=function(e){var i="";return _.each(e,function(e,t){a=e.input_type;try{i+=wp.template("nimble-input-wrapper")({input_type:a,input_data:e,input_id:t,item_model:r,input_tmpl:function(e){var t=e;switch(e){case"czr_layouts":case"select":case"simpleselect":case"fa_icon_picker":case"font_picker":case"animation_picker":t="simpleselect";break;case"simpleselectWithDeviceSwitcher":t="simpleselect_deviceswitcher";break;case"multiselect":case"category_picker":t="multiselect";break;case"h_alignment":case"horizAlignmentWithDeviceSwitcher":t="h_alignment";break;case"h_text_alignment":case"horizTextAlignmentWithDeviceSwitcher":t="h_text_alignment";break;case"range_simple":case"range_simple_device_switcher":t="range_simple";break;case"number_simple":t="number_simple";break;case"font_size":case"line_height":case"range_with_unit_picker":case"range_with_unit_picker_device_switcher":t="range_with_unit_picker";break;case"spacing":case"spacingWithDeviceSwitcher":t="spacing";break;case"upload":case"upload_url":t="upload";break;case"bg_position":case"bgPositionWithDeviceSwitcher":t="bg_position";break;case"verticalAlignWithDeviceSwitcher":t="v_alignment"}return 0<m("#tmpl-nimble-input___"+t).length?wp.template("nimble-input___"+t):(p.errare("problem in getInputTemplate(), missing js template in the DOM for input_type : "+e),null)}(a),control_id:o.control_id})}catch(e){return p.errare("getModuleTmpl => Error when parsing the nimble-input-wrapper template",e),n.reject("getModuleTmpl => Error when parsing the nimble-input-wrapper template"),!1}}),i};if(t.tabs){var d="",u="";_.each(t.tabs,function(e,t){var i=m.extend(!0,{},e);i=m.extend({inputs:{},title:""},i);var o=_.isEmpty(i.attributes)?"":i.attributes;d+='<li data-tab-id="section-topline-'+(+t+1)+'" '+o+'><a href="#" title="'+i.title+'"><span>'+i.title+"</span></a></li>";var n=l(i.inputs);u+='<section id="section-topline-'+(+t+1)+'">'+n+"</section>"}),c+=['<div class="tabs tabs-style-topline">',"<nav>","<ul>",d,"</ul>","</nav>",'<div class="content-wrap">',u,"</div>","</div>"].join("")}else c=l(t);return n.resolve(c).promise()}}(wp.customize,jQuery);var CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{cachedElements:{$body:s("body"),$window:s(window)},initialize:function(){var e=this;if(_.isUndefined(window.sektionsLocalizedData))throw new Error("CZRSeksPrototype => missing localized server params sektionsLocalizedData");if(!_.isFunction(r.czr_activeSkopes))throw new Error("CZRSeksPrototype => api.czr_activeSkopes");e.SECTION_ID_FOR_GLOBAL_OPTIONS="__globalOptionsSectionId",e.SECTION_ID_FOR_LOCAL_OPTIONS="__localOptionsSection",e.SECTION_ID_FOR_CONTENT_PICKER="__content_picker__",e.MAX_NUMBER_OF_COLUMNS=12,e.SETTING_UPDATE_BUFFER=100,e.TINYMCE_EDITOR_HEIGHT=100,e.defaultLocalSektionSettingValue=e.getDefaultSektionSettingValue("local"),e.localSectionsSettingId=new r.Value({}),e.registered=new r.Value([]),wp.customize.apiIsReady?e.doSektionThinksOnApiReady():r.bind("ready",function(){e.doSektionThinksOnApiReady()}),r.bind("save-request-params",function(e){s.extend(e,{local_skope_id:r.czr_skopeBase.getSkopeProperty("skope_id"),active_locations:r.czr_sektions.activeLocations()})});var t=function(){_.isArray(r.czrActiveWPEditors)&&(_.each(r.czrActiveWPEditors,function(e){wp.editor.remove(e)}),r.czrActiveWPEditors=[])};r.bind("sek-before-clean-registered",t),r.bind("czr-all-items-closed",t)},doSektionThinksOnApiReady:function(){var n=this;n.registerAndSetupDefaultPanelSectionOptions(),n.localSectionsSettingId.callbacks.add(function(e,t){try{n.setupSettingsToBeSaved()}catch(e){r.errare("Error in self.localSectionsSettingId.callbacks => self.setupSettingsToBeSaved()",e)}n.initializeHistoryLogWhenSettingsRegistered(),r.previewer.send("sek-request-active-locations")});var i=function(e,t){n.setContextualCollectionSettingIdWhenSkopeSet(e,t),r.section(n.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){e.deferred.embedded.done(function(){!0!==e.boundForLocalOptionGeneration&&(e.boundForLocalOptionGeneration=!0,e.expanded.bind(function(e){!0===e&&n.generateUI({action:"sek-generate-local-skope-options-ui"})}))})}),r.section(n.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){!0!==e.nimbleGlobalOptionGenerated&&(n.generateUI({action:"sek-generate-global-options-ui"}),e.nimbleGlobalOptionGenerated=!0)}),n.nb_is_ready=!0,r.trigger("nimble-ready-for-current-skope")};_.isEmpty(r.czr_activeSkopes().local)||i(),r.czr_activeSkopes.callbacks.add(function(e,t){i(e,t)}),n.reactToPreviewMsg(),n.setupDnd(),n.setupTinyMceEditor(),n.schedulePrintSectionJson(),r.previewedDevice.bind(function(t){var e=_.filter(n.registered(),function(e){return"control"==e.what});_.each(e||[],function(e){r.control(e.id,function(e){e.container.find('[data-sek-device="'+t+'"]').each(function(){s(this).trigger("click")})})})}),s("#customize-notifications-area").on("click",'[data-sek-reset="true"]',function(){r.previewer.trigger("sek-reset-collection",{scope:"local"})}),n.bind("sek-ui-pre-removal",function(e){"control"==e.what&&-1<e.id.indexOf("draggable")&&r.control(e.id,function(e){e.container.find("[draggable]").each(function(){s(this).off("dragstart dragend")})}),"control"==e.what&&r.control(e.id,function(e){e.container.find("select").each(function(){_.isUndefined(s(this).data("czrSelect2"))||s(this).czrSelect2("destroy")})})}),r.bind("czr-new-registered",function(e){if(_.isUndefined(e.origin))throw new Error("czr-new-registered event => missing params.origin");if("nimble"===e.origin&&!1!==e.track){var t=n.registered(),i=s.extend(!0,[],t),o=_.findWhere(i,{id:e.id});if(!_.isEmpty(o)&&_.isEqual(o,e))throw new Error("register => duplicated element in self.registered() collection "+e.id);i.push(e),n.registered(i)}}),n.activeLocations=new r.Value([]),n.activeLocationsInfo=new r.Value([]),r.previewer.bind("sek-active-locations-in-preview",function(e){n.activeLocations(_.isObject(e)&&_.isArray(e.active_locations)?e.active_locations:[]),n.activeLocationsInfo(_.isObject(e)&&_.isArray(e.active_locs_info)?e.active_locs_info:[])}),n.setupTopBar(),n.setupSaveSectionUI(),n.setupSaveTmplUI(),n.lastClickedTargetInPreview=new r.Value,n.lastClickedTargetInPreview.bind(function(e,t){_.isObject(e)&&e.id?r.previewer.send("sek-set-double-click-target",e):r.previewer.send("sek-reset-double-click-target"),clearTimeout(n.cachedElements.$window.data("_preview_target_timer_")),n.cachedElements.$window.data("_preview_target_timer_",setTimeout(function(){n.lastClickedTargetInPreview({}),r.previewer.send("sek-reset-double-click-target")},2e4))}),r.previewer.bind("sek-clean-target-drop-zone",function(){n.lastClickedTargetInPreview({})}),s(document).keydown(function(e){e&&27===e.keyCode&&n.lastClickedTargetInPreview({})}),sektionsLocalizedData.hasActiveCachePlugin&&_.delay(function(){r.previewer.trigger("sek-notify",{notif_id:"has-active-cache-plugin",type:"info",duration:2e4,message:['<span style="color:#0075a2">',sektionsLocalizedData.i18n["You seem to be using a cache plugin."],!_.isString(sektionsLocalizedData.hasActiveCachePlugin)||sektionsLocalizedData.hasActiveCachePlugin.length<2?"":"<strong> ("+sektionsLocalizedData.hasActiveCachePlugin+")</strong><br/>"," <strong>",sektionsLocalizedData.i18n["It is recommended to disable your cache plugin when customizing your website."],"</strong>","</span>"].join("")})},2e3),r.previewer.bind("multi-items-module-refreshed",function(t){_.isUndefined(t.apiParams.control_id)||r.control(t.apiParams.control_id,function(e){_.isUndefined(e.params.sek_registration_params)||r.control(e.id).params.sek_registration_params.module_id===t.apiParams.id&&e.czr_Module.each(function(e){e.czr_Item.each(function(e){"expanded"===e.viewState()&&e.trigger("sek-request-item-focus-in-preview")})})})}),n.setupTemplateGallery()},registerAndSetupDefaultPanelSectionOptions:function(){var o=this,e=r.Panel.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}});r.panel(sektionsLocalizedData.sektionsPanelId,function(o){o.deferred.embedded.done(function(){var e=o.container.first().find("h3.accordion-section-title"),t=(o.container.first().find(".panel-meta .accordion-section-title"),['<img class="sek-nimble-logo" alt="'+o.params.title+'" src="',sektionsLocalizedData.baseUrl,"/assets/img/nimble/nimble_horizontal.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join(""));if(sektionsLocalizedData.isPro&&(t+=['<img class="sek-nimble-logo sek-pro-pastil" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_white.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),0<e.length){var i=e.find("span");e.addClass("sek-side-nimble-logo-wrapper").html(t).append(i)}})}),r.CZR_Helpers.register({origin:"nimble",what:"panel",id:sektionsLocalizedData.sektionsPanelId,title:sektionsLocalizedData.i18n["Nimble Builder"],priority:-1e3,constructWith:e,track:!1}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_GLOBAL_OPTIONS,title:sektionsLocalizedData.i18n["Site wide options"],panel:sektionsLocalizedData.sektionsPanelId,priority:20,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-globe sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-globe sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_LOCAL_OPTIONS,title:sektionsLocalizedData.i18n["Current page options"],panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"setting",id:sektionsLocalizedData.optNameForGlobalOptions,dirty:!1,value:sektionsLocalizedData.globalOptionDBValues,transport:"postMessage",type:"option"}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_CONTENT_PICKER,title:sektionsLocalizedData.i18n["Content Picker"],panel:sektionsLocalizedData.sektionsPanelId,priority:30,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_CONTENT_PICKER,function(e){"resolved"!=r.czr_initialSkopeCollectionPopulated.state()?r.czr_initialSkopeCollectionPopulated.done(function(){r.previewer.trigger("sek-pick-content",{focus:!1})}):r.previewer.trigger("sek-pick-content",{focus:!1})})})},setContextualCollectionSettingIdWhenSkopeSet:function(e,t){t=t||{},!_.isEmpty(t.local)&&r.panel(sektionsLocalizedData.sektionsPanelId).expanded()&&r.previewer.trigger("sek-pick-content"),sektionsData=r.czr_skopeBase.getSkopeProperty("sektions","local"),sektionsLocalizedData.isDevMode&&r.infoLog("::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ",sektionsData),_.isEmpty(sektionsData)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => no sektionsData"),_.isEmpty(sektionsData.setting_id)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => missing setting_id"),this.localSectionsSettingId(sektionsData.setting_id)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{setupTopBar:function(){var t=this;t.topBarId="#nimble-top-bar",t.topBarVisible=new r.Value(!1),t.topBarVisible.bind(function(e){t.levelTreeExpanded()||t.toggleTopBar(e)}),t.mouseMovedRecently=new r.Value({}),t.mouseMovedRecently.bind(function(e){t.topBarVisible(!_.isEmpty(e))});var e=function(e){t.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(t.cachedElements.$window.data("_scroll_move_timer_")),t.cachedElements.$window.data("_scroll_move_timer_",setTimeout(function(){t.mouseMovedRecently.set({})},4e3))};t.cachedElements.$window.on("mousemove scroll,",_.throttle(e,50)),r.previewer.bind("ready",function(){s(r.previewer.targetWindow().document).on("mousemove scroll,",_.throttle(e,50))}),t.setupLevelTree()},toggleTopBar:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?s.when(i.renderAndSetupTopBarTmpl({})).done(function(e){i.topBarContainer=e,_.delay(function(){i.cachedElements.$body.addClass("nimble-top-bar-visible")},200)}):(t=s.Deferred(),i.cachedElements.$body.removeClass("nimble-top-bar-visible"),i.topBarContainer&&i.topBarContainer.length?_.delay(function(){t.resolve()},300):t.resolve(),t.promise()).done(function(){i.topBarVisible(!1)})},renderAndSetupTopBarTmpl:function(e){var t,i=this;if(0<s(i.topBarId).length)return s(i.topBarId);try{t=wp.template("nimble-top-bar")({})}catch(e){return r.errare("Error when parsing the the top note template",e),!1}s("#customize-preview").after(s(t)),s(document).keydown(function(e){if(e.ctrlKey&&_.contains([89,90],e.keyCode))try{i.navigateHistory(90===e.keyCode?"undo":"redo")}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-add-content",i.topBarId).on("click",function(e){e.preventDefault(),r.previewer.trigger("sek-pick-content",{content_type:"module"})}),s(".sek-level-tree",i.topBarId).on("click",function(e){e.preventDefault(),i.levelTreeExpanded(!i.levelTreeExpanded())}),s("[data-nimble-history]",i.topBarId).on("click",function(e){try{i.navigateHistory(s(this).data("nimble-history"))}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-settings",i.topBarId).on("click",function(e){r.panel(sektionsLocalizedData.sektionsPanelId,function(e){i.rootPanelFocus(),e.focus()})}),s(".sek-nimble-doc",i.topBarId).on("click",function(e){e.preventDefault(),window.open(s(this).data("doc-href"),"_blank")}),s(".sek-tmpl-saving",i.topBarId).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!i.tmplDialogVisible())});var o=function(e){s(i.topBarId).length<1||sektionsLocalizedData.isDebugMode||(_.isObject(e)&&e.local_template&&"default"!==e.local_template?s(i.topBarId).find(".sek-notifications").html(['<span class="fas fa-info-circle"></span>',sektionsLocalizedData.i18n["This page uses a custom template."]].join(" ")):s(i.topBarId).find(".sek-notifications").html(""))},n=function(){r(i.localSectionsSettingId(),function(e){var t=e(),i=_.isObject(t)&&t.local_options&&t.local_options.template?t.local_options.template:null;o(i)}),r(i.getLocalSkopeOptionId()+"__template",function(e){e.bind(function(e,t){o(e)})})};return n(),r.bind("nimble-ready-for-current-skope",function(){n()}),s(i.topBarId)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{initializeHistoryLogWhenSettingsRegistered:function(){this.historyLog=new l.Value([{status:"current",value:{local:l(this.localSectionsSettingId())(),global:l(this.getGlobalSectionsSettingId())()},action:"initial"}]),this.historyLog.bind(function(e){if(!_.isEmpty(e)){var t=_.findKey(e,{status:"current"});t=Number(t),d("#nimble-top-bar").find("[data-nimble-history]").each(function(){"undo"===d(this).data("nimble-history")?d(this).attr("data-nimble-state",t<=0?"disabled":"enabled"):d(this).attr("data-nimble-state",e.length<=t+1?"disabled":"enabled")})}})},trackHistoryLog:function(e,t){var i=this,o=e.id===i.getGlobalSectionsSettingId();if(!_.isObject(t)||!_.isFunction(i.historyLog)||!_.isArray(i.historyLog()))throw l.errare("params, self.historyLog() ",t,i.historyLog()),new Error("trackHistoryLog => invalid params or historyLog value");var n,r=[],s=d.extend(!0,[],i.historyLog());_.isEmpty(t.in_sektion)?_.isEmpty(t.to_sektion)||(n=t.to_sektion):n=t.in_sektion,_.each(s,function(e){"future"!=e.status&&(d.extend(e,{status:"previous"}),r.push(e))}),r.push({status:"current",value:o?{global:e()}:{local:e()},action:_.isObject(t)&&t.action||"",sektionToRefresh:n}),i.historyLog(r)},navigateHistory:function(i){var t,o,n,r,e=this,s=d.extend(!0,[],e.historyLog()),a=[];if(_.each(s,function(e){if(_.isEmpty(r)){switch(e.status){case"previous":t=e;break;case"current":o=e;break;case"future":n=e}switch(i){case"undo":_.isEmpty(o)||_.isEmpty(t)||(r=t.value,o.sektionToRefresh,t.sektionToRefresh);break;case"redo":_.isEmpty(n)||(r=n.value,o.sektionToRefresh,n.sektionToRefresh)}}}),!_.isUndefined(r)){_.isEmpty(r.local)||(l(e.localSectionsSettingId())(e.validateSettingValue(r.local,"local"),{navigatingHistoryLogs:!0}),l.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0})),_.isEmpty(r.global)||l(e.getGlobalSectionsSettingId())(e.validateSettingValue(r.global,"global"),{navigatingHistoryLogs:!0});l.previewer.refresh(),l.previewer.trigger("sek-pick-content",{}),e.cleanRegistered(),e.cleanRegisteredLevelSettingsAfterHistoryNavigation()}var c=_.findKey(s,{status:"current"});c=Number(c),_.isNumber(c)?(_.each(s,function(e,t){switch(newLog=d.extend(!0,{},e),t=Number(t),i){case"undo":0<c&&(t===c-1?newLog.status="current":t===c&&(newLog.status="future"));break;case"redo":s.length>c+1&&(t===c?newLog.status="previous":t===c+1&&(newLog.status="current"))}a.push(newLog)}),e.historyLog(a)):l.errare("Error when navigating the history log, the current key should be a number")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(b,I){I.extend(CZRSeksPrototype,{setupLevelTree:function(){var i=this;i.levelTree=new b.Value([]),i.levelTree.bind(function(){i.levelTreeExpanded()&&i.renderOrRefreshTree()}),i.levelTreeExpanded=new b.Value(!1),i.levelTreeExpanded.bind(function(e){if(i.cachedElements.$body.toggleClass("sek-level-tree-expanded",e),e){if(i.templateGalleryExpanded(!1),i.tmplDialogVisible(!1),i.saveSectionDialogVisible&&i.saveSectionDialogVisible(!1),i.setLevelTreeValue(),_.isEmpty(i.levelTree()))return b.previewer.trigger("sek-notify",{type:"info",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["No sections to navigate"]+"</strong>","</span>"].join("")}),void i.levelTreeExpanded(!1);I("#customize-preview iframe").css("z-index",1),i.renderOrRefreshTree()}else 0<I("#nimble-level-tree").length&&_.delay(function(){I("#nimble-level-tree").remove(),I("#customize-preview iframe").css("z-index","")},300)}),i.activeLocations.bind(function(){_.isEmpty(i.levelTree())||i.renderOrRefreshTree()}),b.previewer.bind("ready",function(){i.localSectionsSettingId.callbacks.add(function(){i.levelTreeExpanded(!1),_.each([i.getGlobalSectionsSettingId(),i.localSectionsSettingId(),sektionsLocalizedData.optNameForGlobalOptions],function(e){b(e)._isBoundForNimbleLevelTree||(b(e).bind(function(e){i.setLevelTreeValue()}),b(e)._isBoundForNimbleLevelTree=!0)})})}),i.cachedElements.$body.on("click","#nimble-level-tree [data-nimb-level]",function(e){e.preventDefault(),e.stopPropagation();var i=I(e.target).closest("[data-nimb-level]");b.previewer.send("sek-animate-to-level",{id:i.data("nimb-id")}),b.previewer.send("sek-clean-level-uis"),_.delay(function(){b.previewer.send("sek-display-level-ui",{id:i.data("nimb-id")});var e=i.data("nimb-id"),t=i.data("nimb-level");"column"===t||"section"===t?b.previewer.trigger("sek-edit-options",{id:e,level:t}):"module"===t&&b.previewer.trigger("sek-edit-module",{id:e,level:t})},100)}),i.cachedElements.$body.on("click","#nimble-level-tree .sek-remove-level",function(e){e.preventDefault(),e.stopPropagation();var t=I(e.target).closest("[data-nimb-level]");b.previewer.trigger("sek-remove",{level:t.data("nimb-level"),id:t.data("nimb-id"),location:t.closest('[data-nimb-level="location"]').data("nimb-id"),in_sektion:t.closest('[data-nimb-level="section"]').data("nimb-id"),in_column:t.closest('[data-nimb-level="column"]').data("nimb-id")}),t.fadeOut("slow"),i.renderOrRefreshTree()}),i.cachedElements.$body.on("click",".sek-close-level-tree",function(e){e.preventDefault(),i.levelTreeExpanded(!1)})},setLevelTreeValue:function(){var e,t,i,o,n,r=this.getGlobalSectionsSettingId(),s=this.localSectionsSettingId(),a=sektionsLocalizedData.optNameForGlobalOptions,c=!1;if(_.each([r,s,a],function(e){b.has(e)||(c=e)}),!1===c){e=b(r)(),i=_.isObject(e)?I.extend(!0,{},e):{},i=_.isEmpty(i.collection)?[]:i.collection,i=_.isArray(i)?i:[],t=b(s)(),t=_.isObject(t)?t:{},o=I.extend(!0,{},t),o=_.isEmpty(o.collection)?[]:o.collection,o=_.isArray(o)?o:[];var l,d=_.union(i,o),u=!1,p=!1;n=b(a)(),n=_.isObject(n)?n:{},t.local_options&&t.local_options.local_header_footer&&(u="nimble_local"===(l=t.local_options.local_header_footer["header-footer"])),n.global_header_footer&&!u&&"theme"!==l&&(p="nimble_global"===n.global_header_footer["header-footer"]||"nimble_global"===l);var m,f,g=I.extend(!0,[],d);g=_.filter(g,function(e,t){return!_.contains(["nimble_global_header","nimble_global_footer","nimble_local_header","nimble_local_footer"],e.id)});var h=function(e){m=_.findWhere(d,{id:"nimble_"+e+"_header"}),f=_.findWhere(d,{id:"nimble_"+e+"_footer"}),g.unshift(m),g.push(f)};u?h("local"):p&&h("global");var v,k=this.activeLocations(),y=[];_.isEmpty(k)?y=g:_.each(k,function(e){v=_.findWhere(g,{id:e}),_.isUndefined(v)||y.push(v)}),this.levelTree(y)}else b.errare("::setLevelTreeValue => a setting id is not registered ")},renderOrRefreshTree:function(){var e;if(I("#nimble-level-tree").length<1){try{e=wp.template("nimble-level-tree")({})}catch(e){return b.errare("Error when parsing the nimble-level-tree template",e),!1}I("#customize-preview").after(I(e))}I("#nimble-level-tree").find(".sek-tree-wrap").html(this.getLevelTreeHtml())},getLevelTreeHtml:function(e,t){var i=this;e=e||i.levelTree();var o,n,r,s=!1;if(!_.isArray(e)||_.isEmpty(e))return b.errare("::buildLevelTree => invalid collection param",e),r;var a='<i class="material-icons sek-remove-level" title="'+sektionsLocalizedData.i18n["Remove this element"]+'">delete_forever</i>';return r="<ul>",_.each(e,function(e){_.isUndefined(e.level)?b.errare("::buildLevelTree => missing level property",e):_.isUndefined(e.id)?b.errare("::buildLevelTree => missing id property",e):(o=e.level,"location"===(n=o)&&(s=!_.contains(i.activeLocations(),e.id)),s||(sektionsLocalizedData.i18n[o]&&(n=sektionsLocalizedData.i18n[o]),!0===e.is_nested&&(n=sektionsLocalizedData.i18n["nested section"]),a="location"!==o?a:"",r+='<li data-nimb-level="'+o+'" data-nimb-id="'+e.id+'">',r+='<div class="sek-level-infos"><div class="sek-inner-level-infos">',"module"===o&&(r+=[i.getTreeModuleIcon(e.module_type),i.getTreeModuleTitle(e.module_type)].join(" ")),r+=[" ",n,"( id :",e.id,")",a].join(" "),r+="</div></div>",_.isArray(e.collection)&&!_.isEmpty(e.collection)&&(r+=i.getLevelTreeHtml(e.collection,t)),r+="</li>"))}),r+="</ul>"},getTreeModuleIcon:function(t){var i,o={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(o)&&t===e["content-id"]&&(_.isEmpty(e.icon)||(i="http"===e.icon.substring(0,4)?e.icon:sektionsLocalizedData.moduleIconPath+e.icon,o={svg:e.icon?i:"",font:e.font_icon?e.font_icon:""}))}),_.isEmpty(o.svg)?_.isEmpty(o.font)?void 0:o.font:'<img class="sek-svg-mod-icon" src="'+o.svg+'"/>'},getTreeModuleTitle:function(t){var i={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(i)&&t===e["content-id"]&&(i=e.title)}),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{setupSaveSectionUI:function(){var r=this;r.saveSectionDialogVisible=new l.Value(!1),r.saveSectionDialogVisible.bind(function(e){e&&(r.templateGalleryExpanded(!1),r.levelTreeExpanded(!1),r.tmplDialogVisible&&r.tmplDialogVisible(!1)),r.toggleSaveSectionUI(e)}),r.allSavedSections=new l.Value("_not_populated_"),r.allSavedSections.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,r.refreshSectionPickerHtml(e)):l.errare("error setupSaveSectionUI => section collection should be an object")}),r.saveSectionDialogMode=new l.Value("hidden"),r.saveSectionDialogMode.bind(function(e){_.contains(["hidden","save","update","remove","edit"],e)||(l.errare("error setupSaveSectionUI => unknown section dialog mode",e),e="save");var t,i=d("#nimble-top-section-save-ui"),o=i.find("#sek-saved-section-title"),n=i.find("#sek-saved-section-description");switch(i.find("[data-section-mode-switcher]").attr("aria-pressed",!1),i.find('[data-section-mode-switcher="'+e+'"]').attr("aria-pressed",!0),d("#nimble-top-section-save-ui").attr("data-sek-section-dialog-mode",e),i.removeClass("sek-removal-confirmation-opened"),e){case"save":o.val(""),n.val("");break;case"update":case"edit":(t=i.find(".sek-saved-section-picker")).val("none").trigger("change"),r.setSavedSectionCollection().done(function(e){r.refreshSectionPickerHtml(),t.val(r.userSectionToEdit||"none").trigger("change"),r.userSectionToEdit=null});break;case"remove":console.log("sOOO ?",r.userSectionToRemove),(t=i.find(".sek-saved-section-picker")).val("none").trigger("change"),r.setSavedSectionCollection().done(function(e){r.refreshSectionPickerHtml(),t.val(r.userSectionToRemove||"none").trigger("change"),r.userSectionToRemove=null})}"remove"===e&&_.isEmpty(r.idOfSectionToSave)?i.addClass("sek-is-removal-only"):i.removeClass("sek-is-removal-only")})},refreshSectionPickerHtml:function(e){e=e||this.allSavedSections();var t=d("#nimble-top-section-save-ui"),i=t.find(".sek-saved-section-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==d(this).attr("value")&&d(this).remove()});var o,n,r="";_.each(e,function(e,t){_.isObject(e)&&(n=e.last_modified_date?e.last_modified_date:"",o=e.title?e.title:"section title not set",r+='<option value="'+t+'">'+[o,sektionsLocalizedData.i18n["Last modified"]+" : "+n].join(" | ")+"</option>")}),i.append(r),t.addClass("section-collection-populated")},renderSectionSaveUI:function(e){if(0<d("#nimble-top-section-save-ui").length)return d("#nimble-top-section-save-ui");try{_tmpl=wp.template("nimble-top-section-save-ui")({})}catch(e){return l.errare("Error when parsing nimble-top-section-save-ui template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-top-section-save-ui")},maybeScheduleSectionSaveDOMEvents:function(){var i=this,o=d("#nimble-top-section-save-ui");o.data("nimble-sec-save-dom-events-scheduled")||(o.on("click","[data-section-mode-switcher]",function(e){e.preventDefault(),i.saveSectionDialogMode(d(this).data("section-mode-switcher"))}).on("change",".sek-saved-section-picker",function(e){i.reactOnSectionSelection(e,d(this))}).on("click",".sek-do-save-section",function(e){o.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e).done(function(e){o.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}))})}).on("click",".sek-do-update-section",function(e){var t=o.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e,t).done(function(e){o.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}).done(function(e){i.refreshSectionPickerHtml()}))}))}).on("click",".sek-open-remove-confirmation",function(e){o.addClass("sek-removal-confirmation-opened")}).on("click",".sek-do-remove-section",function(e){var t=o.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-section-processing-ajax"),i.removeSavedSection(e,t).done(function(e){o.removeClass("nimble-section-processing-ajax"),o.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedSectionCollection({refresh:!0})}))}).on("click",".sek-cancel-remove-section",function(e){o.removeClass("sek-removal-confirmation-opened")}),d(".sek-close-dialog",o).on("click",function(e){e.preventDefault(),i.saveSectionDialogVisible(!1)}),o.data("nimble-sec-save-dom-events-scheduled",!0))},reactOnSectionSelection:function(e,t){var i=d("#nimble-top-section-save-ui"),o=t.val(),n=i.find("#sek-saved-section-title"),r=i.find("#sek-saved-section-description"),s="update"===this.saveSectionDialogMode()?"sek-section-update-selected":"sek-section-remove-selected";if("none"===o)n.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedSections();(a=_.isObject(a)&&!_.isArray(a)?a:{})[o]=d.extend({title:"",description:"",last_modified_date:""},a[o]||{}),n.val(a[o].title),r.val(a[o].description),i.addClass(s)}},saveOrUpdateSavedSection:function(e,t){var i=this,o=d.Deferred(),n="edit"===i.saveSectionDialogMode();if(!n&&(!i.idOfSectionToSave||_.isEmpty(i.idOfSectionToSave)))return l.errare("saveOrUpdateSavedSection => error => missing section id"),o.resolve({success:!1});e.preventDefault();var r,s=d("#sek-saved-section-title"),a=s.val(),c=d("#sek-saved-section-description").val();if(!n){if("no_match"==(r=d.extend(!0,{},i.getLevelModel(i.idOfSectionToSave))))return l.errare("saveOrUpdateSavedSection => error => no section model with id "+i.idOfSectionToSave),o.resolve({success:!1});if(r=i.preProcessSection(r),!_.isObject(r))return l.errare("::saveOrUpdateSavedSection => error => invalid sectionModel"),o.resolve({success:!1})}return _.isEmpty(a)?(s.addClass("error"),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),o.resolve({success:!1})):(d("#sek-saved-section-title").removeClass("error"),wp.ajax.post("sek_save_user_section",{nonce:l.settings.nonce.save,section_data:n?"":JSON.stringify(r),section_title:a,section_description:c,section_post_name:t||"",skope_id:l.czr_skopeBase.getSkopeProperty("skope_id"),edit_metas_only:n?"yes":"no"}).done(function(e){o.resolve({success:!0}),l.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){o.resolve({success:!1}),l.errorLog("ajax sek_save_section => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),o)},preProcessSection:function(e){if(!_.isObject(e))return null;var t=d.extend({},!0,e);return _.has(t,"is_nested")&&(t=_.omit(t,"is_nested")),t},removeSavedSection:function(e,t){var i=this,o=d.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_section",{nonce:l.settings.nonce.save,section_post_name:t}).done(function(e){o.resolve({success:!0}),l.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){o.resolve({success:!1}),l.errorLog("ajax sek_remove_section => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),o},toggleSaveSectionUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderSectionSaveUI({})).done(function(e){i.maybeScheduleSectionSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.saveSectionDialogMode("save"),i.cachedElements.$body.addClass("sek-save-section-ui-visible")},200)}):(t=d.Deferred(),i.cachedElements.$body.removeClass("sek-save-section-ui-visible"),0<d("#nimble-top-section-save-ui").length?_.delay(function(){i.saveSectionDialogMode=i.saveSectionDialogMode?i.saveSectionDialogMode:new l.Value,i.saveSectionDialogMode("hidden"),i.saveUIContainer.remove(),i.idOfSectionToSave=null,t.resolve()},250):t.resolve(),t.promise()).done(function(){i.saveSectionDialogVisible(!1)})},setSavedSectionCollection:function(e){var t=this,i=d.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedSections()?((t.sectionCollectionPromise&&"pending"===t.sectionCollectionPromise.state()?t.sectionCollectionPromise:t.getSavedSectionCollection(e)).done(function(e){t.allSavedSections(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedSections())},getSavedSectionCollection:function(e){var t=this;return e=e||{refresh:!1},t.sectionCollectionPromise=d.Deferred(),e.refresh||"_not_populated_"===t.allSavedSections()?wp.ajax.post("sek_get_all_saved_sections",{nonce:l.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?t.sectionCollectionPromise.resolve(e):(t.sectionCollectionPromise.resolve({}),_.isEmpty(e)||l.errorLog("control::getSavedSectionCollection => collection is empty or invalid"))}).fail(function(e){l.errorLog("ajax sek_get_all_saved_section => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.sectionCollectionPromise.resolve({})}):t.sectionCollectionPromise.resolve(t.allSavedSections()),t.sectionCollectionPromise}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{setupSaveTmplUI:function(){var r=this;r.tmplDialogVisible=new l.Value(!1),sektionsLocalizedData.isTemplateSaveEnabled&&(r.tmplDialogVisible.bind(function(e){e&&(r.templateGalleryExpanded(!1),r.levelTreeExpanded(!1),r.saveSectionDialogVisible&&r.saveSectionDialogVisible(!1)),r.toggleSaveTmplUI(e)}),r.allSavedTemplates=new l.Value("_not_populated_"),r.allSavedTemplates.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,r.refreshTmplPickerHtml(e)):l.errare("error setupSaveTmplUI => tmpl collection should be an object")}),r.allApiTemplates=new l.Value("_not_populated_"),r.tmplDialogMode=new l.Value("hidden"),r.tmplDialogMode.bind(function(e){_.contains(["hidden","save","update","remove","edit"],e)||(l.errare("::setupSaveTmplUI => unknown tmpl dialog mode",e),e="save");var t,i=d("#nimble-top-tmpl-save-ui"),o=i.find("#sek-saved-tmpl-title"),n=i.find("#sek-saved-tmpl-description");switch(i.find("[data-tmpl-mode-switcher]").attr("aria-pressed",!1),i.find('[data-tmpl-mode-switcher="'+e+'"]').attr("aria-pressed",!0),d("#nimble-top-tmpl-save-ui").attr("data-sek-tmpl-dialog-mode",e),i.removeClass("sek-removal-confirmation-opened"),e){case"save":o.val(""),n.val("");break;case"update":case"remove":(t=i.find(".sek-saved-tmpl-picker")).val("none").trigger("change"),r.setSavedTmplCollection().done(function(e){r.refreshTmplPickerHtml(),t.val(r.tmplToRemove||"none").trigger("change"),r.tmplToRemove=null});break;case"edit":(t=i.find(".sek-saved-tmpl-picker")).val("none").trigger("change"),r.setSavedTmplCollection().done(function(e){r.refreshTmplPickerHtml(),t.val(r.tmplToEdit||"none").trigger("change"),r.tmplToEdit=null})}}))},refreshTmplPickerHtml:function(e){e=e||this.allSavedTemplates();var t=d("#nimble-top-tmpl-save-ui"),i=t.find(".sek-saved-tmpl-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==d(this).attr("value")&&d(this).remove()});var o,n,r="";_.each(e,function(e,t){_.isObject(e)&&(n=e.last_modified_date?e.last_modified_date:"",o=e.title?e.title:"template title not set",r+='<option value="'+t+'">'+[o,sektionsLocalizedData.i18n["Last modified"]+" : "+n].join(" | ")+"</option>")}),i.append(r),t.addClass("tmpl-collection-populated")},renderTmplUI:function(e){if(0<d("#nimble-top-tmpl-save-ui").length)return d("#nimble-top-tmpl-save-ui");try{_tmpl=wp.template("nimble-top-tmpl-save-ui")({})}catch(e){return l.errare("Error when parsing nimble-top-tmpl-save-ui template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-top-tmpl-save-ui")},scheduleTmplSaveDOMEvents:function(){var i=this,o=d("#nimble-top-tmpl-save-ui");o.data("nimble-tmpl-dom-events-scheduled")||(o.on("click","[data-tmpl-mode-switcher]",function(e){e.preventDefault(),i.tmplDialogMode(d(this).data("tmpl-mode-switcher"))}),o.on("change",".sek-saved-tmpl-picker",function(e){i.reactOnTemplateSelection(e,d(this))}),o.on("click",".sek-do-save-tmpl",function(e){o.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e).done(function(e){o.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}))})}),o.on("click",".sek-do-update-tmpl",function(e){var t=o.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e,t).done(function(e){o.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}).done(function(e){i.refreshTmplPickerHtml()}))}))}),o.on("click",".sek-open-remove-confirmation",function(e){o.addClass("sek-removal-confirmation-opened")}),o.on("click",".sek-do-remove-tmpl",function(e){var t=o.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(o.addClass("nimble-tmpl-processing-ajax"),i.removeTemplate(e,t).done(function(e){o.removeClass("nimble-tmpl-processing-ajax"),o.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedTmplCollection({refresh:!0})}))}),o.on("click",".sek-cancel-remove-tmpl",function(e){o.removeClass("sek-removal-confirmation-opened")}),d(".sek-close-dialog",o).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!1)}),o.data("nimble-tmpl-dom-events-scheduled",!0))},reactOnTemplateSelection:function(e,t){var i=d("#nimble-top-tmpl-save-ui"),o=t.val(),n=i.find("#sek-saved-tmpl-title"),r=i.find("#sek-saved-tmpl-description"),s="update"===this.tmplDialogMode()?"sek-tmpl-update-selected":"sek-tmpl-remove-selected";if("none"===o)n.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedTemplates();(a=_.isObject(a)&&!_.isArray(a)?a:{})[o]=d.extend({title:"",description:"",last_modified_date:""},a[o]||{}),n.val(a[o].title),r.val(a[o].description),i.addClass(s)}},saveOrUpdateTemplate:function(e,t){var i=this,o=d.Deferred();e.preventDefault();var n,r=d("#sek-saved-tmpl-title"),s=r.val(),a=d("#sek-saved-tmpl-description").val(),c=i.localSectionsSettingId();try{n=i.preProcessTmpl(l(c)())}catch(e){l.errorLog("error in ::saveOrUpdateTemplate",e),o.resolve({success:!1})}return _.isEmpty(s)?(r.addClass("error"),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),o.resolve({success:!1})):(d("#sek-saved-tmpl-title").removeClass("error"),wp.ajax.post("sek_save_user_template",{nonce:l.settings.nonce.save,tmpl_data:"edit"===i.tmplDialogMode()?"":JSON.stringify(n),tmpl_title:s,tmpl_description:a,tmpl_post_name:t||"",edit_metas_only:"edit"===i.tmplDialogMode()?"yes":"no",skope_id:l.czr_skopeBase.getSkopeProperty("skope_id"),tmpl_locations:i.getActiveLocationsForTmpl(n),tmpl_header_location:i.getHeaderOrFooterLocationIdForTmpl("header",n),tmpl_footer_location:i.getHeaderOrFooterLocationIdForTmpl("footer",n)}).done(function(e){o.resolve({success:!0}),l.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){o.resolve({success:!1}),l.errorLog("ajax sek_save_template => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}),o)},getActiveLocationsForTmpl:function(e){if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var t=[];return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&"location"===e.level&&t.push(e.id)}),t},getHeaderOrFooterLocationIdForTmpl:function(t,e){var i=this;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var o="";return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&("header"===t&&i.isHeaderLocation(e.id)||"footer"===t&&i.isFooterLocation(e.id))&&(o=e.id)}),o},preProcessTmpl:function(e){var t,i;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");return(t=d.extend(!0,{},e)).collection=[],i=this.activeLocations(),_.each(e.collection,function(e){_.isObject(e)&&e.id&&e.collection&&_.contains(i,e.id)&&!_.isEmpty(e.collection)&&t.collection.push(e)}),t},removeTemplate:function(e,t){var i=d.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_template",{nonce:l.settings.nonce.save,tmpl_post_name:t}).done(function(e){i.resolve({success:!0}),l.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){i.resolve({success:!1}),l.errorLog("ajax sek_remove_template => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}),i},toggleSaveTmplUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderTmplUI({})).done(function(e){i.scheduleTmplSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.tmplDialogMode("save"),i.cachedElements.$body.addClass("sek-save-tmpl-ui-visible")},200)}):(t=d.Deferred(),i.cachedElements.$body.removeClass("sek-save-tmpl-ui-visible"),0<d("#nimble-top-tmpl-save-ui").length?_.delay(function(){i.tmplDialogMode=i.tmplDialogMode?i.tmplDialogMode:new l.Value,i.tmplDialogMode("hidden"),i.saveUIContainer.remove(),t.resolve()},250):t.resolve(),t.promise()).done(function(){i.tmplDialogVisible(!1)})},setSavedTmplCollection:function(e){var t=this,i=d.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedTemplates()?((t.templateCollectionPromise&&"pending"===t.templateCollectionPromise.state()?t.templateCollectionPromise:t.getSavedTmplCollection()).done(function(e){t.allSavedTemplates(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedTemplates())},getSavedTmplCollection:function(){var t=this;return t.templateCollectionPromise=d.Deferred(),wp.ajax.post("sek_get_all_saved_tmpl",{nonce:l.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?t.templateCollectionPromise.resolve(e):(t.templateCollectionPromise.resolve({}),_.isEmpty(e)||l.errare("control::getSavedTmplCollection => error => tmpl collection is invalid",e))}).fail(function(e){l.errorLog("ajax sek_get_all_saved_tmpl => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.templateCollectionPromise.resolve({})}),t.templateCollectionPromise},getApiTmplCollection:function(){var t=this,i=d.Deferred(),o={};return"_not_populated_"!==t.allApiTemplates()?i.resolve(t.allApiTemplates()):wp.ajax.post("sek_get_all_api_tmpl",{nonce:l.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?o=e:l.errare("control::getApiTmplCollection => error => tmpl collection is invalid",e),t.allApiTemplates(o),i.resolve(o)}).fail(function(e){l.errorLog("ajax sek_get_all_api_tmpl => error",e),l.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),i.resolve({})}),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(n,r){r.extend(CZRSeksPrototype,{getTmplJsonFromUserTmpl:function(e){var t=r.Deferred();return wp.ajax.post("sek_get_user_tmpl_json",{nonce:n.settings.nonce.save,tmpl_post_name:e}).done(function(e){t.resolve({success:!0,tmpl_json:e})}).fail(function(e){t.resolve({success:!1}),n.errorLog("ajax getTmplJsonFromUserTmpl => error",e),n.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>error when fetching the template</strong>","</span>"].join("")})}),t},getTmplJsonFromApi:function(e){var t=r.Deferred();return wp.ajax.post("sek_get_api_tmpl_json",{nonce:n.settings.nonce.save,api_tmpl_name:e}).done(function(e){t.resolve({success:!0,tmpl_json:e})}).fail(function(e){t.resolve({success:!1}),n.errorLog("ajax getTmplJsonFromApiTmpl => error",e),n.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>error when fetching the template</strong>","</span>"].join("")})}),t},get_gallery_tmpl_json_and_inject:function(t){var e,i=this,o=(t=r.extend({tmpl_name:"",tmpl_source:"user",tmpl_inject_mode:"replace"},t||{})).tmpl_name;!_.isEmpty(o)&&_.isString(o)||n.errare("::tmpl inject => error => invalid template name"),(e="api_tmpl"===t.tmpl_source?i.getTmplJsonFromApi(o):i.getTmplJsonFromUserTmpl(o)).done(function(e){e.success&&i.inject_tmpl_from_gallery({tmpl_name:o,template_data:e.tmpl_json,tmpl_inject_mode:t.tmpl_inject_mode})}),_.delay(function(){"pending"===e.state()&&n.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>","Template import failed","</strong>","</span>"].join("")})},3e4)},inject_tmpl_from_gallery:function(e){e=e||{};if(!(e=r.extend({tmpl_inject_mode:"replace"},e)).template_data)throw new Error("::inject_tmpl => missing remote template data");n.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),n.czr_sektions.isImportedContentEligibleForAPI({success:!0,data:e.template_data},e)?(e.template_data.data.collection=this.setIdsForImportedTmpl(e.template_data.data.collection),n.czr_sektions.doUpdateApiSettingAfter_TmplGalleryImport({success:!0,data:e.template_data},e)):n.infoLog("::inject_tmpl problem => !api.czr_sektions.isImportedContentEligibleForAPI",e)},doUpdateApiSettingAfter_TmplGalleryImport:function(e,t){if(t=t||{},n.czr_sektions.isImportedContentEligibleForAPI(e,t)){n.czr_sektions.updateAPISetting({action:"sek-inject-tmpl-from-gallery",scope:"local",injected_content:e.data,tmpl_inject_mode:t.tmpl_inject_mode}).done(function(){n.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),n.previewer.refresh(),n.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Template successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){n.errare("::doUpdateApiSettingAfter_TmplGalleryImport => error when firing ::updateAPISetting",e),n.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),n.previewer.refresh()}else n.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,e){jQuery.extend(CZRSeksPrototype,{getRevisionHistory:function(e){return wp.ajax.post("sek_get_revision_history",{nonce:r.settings.nonce.save,skope_id:e.is_local?r.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId})},setSingleRevision:function(i){var o=this,n=function(e,t){r.previewer.trigger("sek-notify",{notif_id:"restore-revision-error",type:t||"info",duration:1e4,message:['<span style="">',"<strong>",e||"","</strong>","</span>"].join("")})};wp.ajax.post("sek_get_single_revision",{nonce:r.settings.nonce.save,revision_post_id:i.revision_post_id}).done(function(e){var t=i.is_local?o.localSectionsSettingId():o.getGlobalSectionsSettingId();_.isEqual(r(t)(),e)?n(sektionsLocalizedData.i18n["This is the current version."],"info"):o.updateAPISetting({action:"sek-restore-revision",is_global_location:!i.is_local,revision_value:e}).done(function(){r.previewer.refresh()}).fail(function(e){r.errare("::setSingleRevision error when firing ::updateAPISetting",e),n(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}).fail(function(e){r.errare("::setSingleRevision ajax error",e),n(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}})}(wp.customize);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{setupSettingsToBeSaved:function(){var i,n=this,e={local:{collectionSettingId:n.localSectionsSettingId()},global:{collectionSettingId:n.getGlobalSectionsSettingId()}};_.each(e,function(e,t){if(i=c.czr_skopeBase.getSkopeProperty("sektions",t).db_values,_.isEmpty(e.collectionSettingId))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");if(!c.has(e.collectionSettingId)){c.CZR_Helpers.register({what:"setting",id:e.collectionSettingId,value:n.validateSettingValue(_.isObject(i)?i:n.getDefaultSektionSettingValue(t),t),transport:"postMessage",type:"option",track:!1,origin:"nimble"});c(e.collectionSettingId,function(o){o.bind(_.debounce(function(e,t,i){if(!_.isObject(i)||!0!==i.navigatingHistoryLogs)try{n.trackHistoryLog(o,i)}catch(e){c.errare("setupSettingsToBeSaved => trackHistoryLog",e)}},1e3))})}})},validateSettingValue:function(i,o){if(!_.isObject(i))return c.errare("::validateSettingValue => validation error => the setting should be an object",i),null;if(!_.isEmpty(o)&&_.contains(["local","global"],o)){var n={},r=!1,e=[],s=function(e){c.errare(e,i),sektionsLocalizedData.isDevMode&&c.previewer.trigger("sek-notify",{type:"error",duration:6e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")}),r=!0},a=function(t){if(!r)if(_.isUndefined(t)&&_.isEmpty(n)){if(t=l.extend(!0,{},i),_.isUndefined(t.id)||_.isUndefined(t.level)){if(_.isUndefined(t.collection))return void s("validation error => the root level is missing the collection of locations");if(!_.isEmpty(t.level)||!_.isEmpty(t.id))return void s('validation error => the root level should not have a "level" or an "id" property');_.each(t,function(e,t){switch(o){case"local":if(!_.contains(["collection","local_options","fonts"],t))return void s("validation error => unauthorized option group for local setting value => "+t);break;case"global":if(!_.contains(["collection","fonts"],t))return void s("validation error => unauthorized option group for global setting value => "+t)}}),_.each(i.collection,function(e){n=t,a(e)})}}else{if(_.isUndefined(t)||!_.isObject(t))return void s("validation error => a level is invalid");if(_.isEmpty(t.id)||!_.isString(t.id))return void s("validation error => a "+t.level+" level must have a valid id");if(_.contains(e,t.id))return void s("validation error => duplicated level id : "+t.id);if(e.push(t.id),_.isEmpty(t.level)||!_.isString(t.level))return void s("validation error => a "+t.level+" level must have a level property");if(!_.contains(["location","section","column","module"],t.level))return void s('validation error => the level "'+t.level+'" is not authorized');if("module"==t.level){if(!_.isUndefined(t.collection))return void s("validation error => a module can not have a collection property")}else if(_.isUndefined(t.collection))return void s("validation error => missing collection property for level => "+t.level+" "+t.id);switch(_.isUndefined(t.ver_ini)&&c.errare("validateSettingValue() => validation error => a "+t.level+' should have a version property : "ver_ini"'),t.level){case"location":if(!_.isEmpty(n.level))return void s("validation error => the parent of location "+t.id+" should have no level set");break;case"section":if(t.is_nested&&"column"!=n.level)return void s("validation error => the nested section "+t.id+" must be child of a column");if(!t.is_nested&&"location"!=n.level)return void s("validation error => the section "+t.id+" must be child of a location");break;case"column":if("section"!=n.level)return void s("validation error => the column "+t.id+" must be child of a section");break;case"module":if("column"!=n.level)return void s("validation error => the module "+t.id+" must be child of a column")}"module"!=t.level&&_.each(t.collection,function(e){n=l.extend(!0,{},t),_.isUndefined(e)?s("validation error => undefined level "):a(e)})}};return a(),r?null:i}c.errare("::validateSettingValue => invalid scope provided.",o)},resetCollectionSetting:function(e){if(_.isEmpty(e)||!_.contains(["local","global"],e))throw new Error("resetCollectionSetting => invalid scope provided.",e);return l.extend(!0,{},this.getDefaultSektionSettingValue(e))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,o){o.extend(CZRSeksPrototype,{reactToPreviewMsg:function(){var n=this,r={},s={},a=!0,e={"sek-add-section":{callback:function(e){return c.previewedDevice("desktop"),a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},r={action:"sek-add-section",id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),before_section:e.before_section,after_section:e.after_section,is_first_section:e.is_first_section},n.updateAPISetting(r)},complete:function(e){e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),c.previewer.trigger("sek-pick-content",{id:e.apiParams?e.apiParams.id:"",content_type:"section"}),c.previewer.send("sek-animate-to-level",{id:e.apiParams.id})}},"sek-add-column":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),action:"sek-add-column",in_sektion:e.in_sektion,autofocus:e.autofocus},n.updateAPISetting(r)},complete:function(e){!1!==e.apiParams.autofocus&&c.previewer.trigger("sek-pick-content",{})}},"sek-add-module":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),action:"sek-add-module",in_sektion:e.in_sektion,in_column:e.in_column,module_type:e.content_id,before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section},n.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)}),c.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_column,location_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-remove":{callback:function(e){switch(a=!0,s={},e.level){case"section":var t=n.getLevelModel(e.id);if("no_match"===t){c.errare("reactToPreviewMsg => sek-remove-section => no sektionToRemove matched");break}r={action:"sek-remove-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:t.is_nested};break;case"column":r={action:"sek-remove-column",id:e.id,in_sektion:e.in_sektion};break;case"module":r={action:"sek-remove-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;default:c.errare("::reactToPreviewMsg => sek-remove => missing level ",e)}return n.updateAPISetting(r)},complete:function(e){if(c.previewer.trigger("sek-pick-content",{}),n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)}),"sek-remove-section"===e.apiParams.action){var t=n.getLevelModel(e.apiParams.location);_.isEmpty(t.collection)&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location})}}},"sek-move":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-move-section",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),newOrder:e.newOrder,from_location:e.from_location,to_location:e.to_location};break;case"column":r={action:"sek-move-column",id:e.id,newOrder:e.newOrder,from_sektion:e.from_sektion,to_sektion:e.to_sektion};break;case"module":r={action:"sek-move-module",id:e.id,newOrder:e.newOrder,from_column:e.from_column,to_column:e.to_column,from_sektion:e.from_sektion,to_sektion:e.to_sektion}}return n.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-move-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),e.apiParams.from_location!=e.apiParams.to_location&&(c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.to_location}),c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.from_location}));break;case"sek-move-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-refresh-modules-in-column":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}}},"sek-move-section-up":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"up",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},n.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-up",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-move-section-down":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"down",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},n.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-duplicate":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-duplicate-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column)};break;case"column":r={action:"sek-duplicate-column",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;case"module":r={action:"sek-duplicate-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column}}return n.updateAPISetting(r)},complete:function(e){var t;switch(e.apiParams.action){case"sek-duplicate-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),t=e.apiParams.location,e.apiParams.is_nested&&c.previewer.refresh(),c.previewer.send("sek-animate-to-level",{id:e.apiParams.id});break;case"sek-duplicate-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_sektion;break;case"sek-duplicate-module":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_column}c.previewer.trigger("sek-refresh-stylesheet",{id:t,location_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-resize-columns":function(e){return a=!0,s={},r=e,n.updateAPISetting(r)},"sek-add-content-in-new-sektion":{callback:function(e){switch(a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},(r=e).action="sek-add-content-in-new-sektion",r.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),e.content_type){case"module":r.droppedModuleId=sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid();break;case"preset_section":c.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),c.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0})}return n.updateAPISetting(r)},complete:function(e){switch(e.apiParams.content_type){case"module":c.previewer.trigger("sek-edit-module",{level:"module",id:e.apiParams.droppedModuleId});break;case"preset_section":c.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)});var t=e.location_skope_id;_.isUndefined(t)&&(t=!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:c.czr_skopeBase.getSkopeProperty("skope_id")),c.previewer.trigger("sek-refresh-stylesheet",{location_skope_id:t,is_global_location:n.isGlobalLocation(e.apiParams)}),e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),e.apiParams.sektion_to_replace&&c.previewer.trigger("sek-remove",{id:e.apiParams.sektion_to_replace,location:e.apiParams.location,in_column:e.apiParams.in_column,level:"section"})}},"sek-add-preset-section-in-new-nested-sektion":{callback:function(e){return a=!1,s={},(r=e).action="sek-add-preset-section-in-new-nested-sektion",c.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),n.updateAPISetting(r)},complete:function(e){n.updateAPISetting({action:"sek-update-fonts",is_global_location:n.isGlobalLocation(e.apiParams)}),c.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_sektion,location_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")}),c.previewer.trigger("sek-refresh-level",{level:"section",id:e.apiParams.in_sektion})}},"sek-pick-content":function(e){return e=_.isObject(e)?e:{},c.czr_sektions.currentContentPickerType=c.czr_sektions.currentContentPickerType||new c.Value,_.isObject(e)&&e.id&&n.lastClickedTargetInPreview({id:e.id}),a=!0,r={},s={action:"sek-generate-draggable-candidates-picker-ui",content_type:(e=e||{}).content_type||"module",was_triggered:!_.has(e,"was_triggered")||e.was_triggered,focus:!_.has(e,"focus")||e.focus},n.generateUI(s)},"sek-edit-options":function(e){return a=!0,r={},_.isEmpty(e.id)?o.Deferred(function(){this.reject("missing id")}):(s={action:"sek-generate-level-options-ui",location:e.location,level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},n.generateUI(s))},"sek-edit-module":function(e){return a=!0,r={},s={action:"sek-generate-module-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},n.generateUI(s)},"sek-notify":function(t){a=!1;var i=t.notif_id||"sek-notify";return n.lastNimbleNotificationId&&c.notifications.remove(n.lastNimbleNotificationId),o.Deferred(function(){c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification(i,{type:t.type||"info",message:t.message,dismissible:!0})),n.lastNimbleNotificationId=i,_.delay(function(){c.notifications.remove(i)},t.duration||5e3)}),this.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-refresh-level":function(t){return a=!0,o.Deferred(function(e){r={action:"sek-refresh-level",level:t.level,id:t.id,original_action:t.original_action,moved_level_id:t.moved_level_id},s={},e.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-refresh-stylesheet":function(t){return a=!0,t=t||{},o.Deferred(function(e){r={id:t.id},s={},e.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-toggle-save-section-ui":function(t){return a=!1,n.idOfSectionToSave=t.id,n.saveSectionDialogVisible(!0),o.Deferred(function(e){r={},s={},e.resolve({is_global_location:n.isGlobalLocation(t)})})},"sek-reset-collection":{callback:function(e){return a=!1,s={},(r=e).action="sek-reset-collection",r.scope=e.scope,n.updateAPISetting(r)},complete:function(e){c.previewer.refresh(),c.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}}};_.each(e,function(i,o){c.previewer.bind(o,function(t){var e;if(_.isFunction(i))e=i;else{if(!_.isFunction(i.callback))return void c.errare("::reactToPreviewMsg => invalid callback for action "+o);e=i.callback}"sek-notify"!==o&&(n.templateGalleryExpanded(!1),n.tmplDialogVisible(!1));try{e(t).done(function(e){e=e||{},a?c.previewer.send(o,{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:c.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:r,uiParams:s,cloneId:!_.isEmpty(e.cloneId)&&e.cloneId,all_params:t}):c.previewer.trigger([o,"done"].join("_"),{apiParams:r,uiParams:s}),n.trigger([o,"done"].join("_"),t)}).fail(function(e){c.errare("reactToPreviewMsg => problem or error when running action "+o,e),!_.isEmpty(e)&&sektionsLocalizedData.isDevMode&&c.previewer.trigger("sek-notify",{type:"error",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")})})}catch(e){c.errare("reactToPreviewMsg => error when receiving "+o,e)}})}),_.each(e,function(t,i){c.previewer.bind([i,"done"].join("_"),function(e){if(_.isFunction(t.complete))try{t.complete(e)}catch(e){c.errare("reactToPreviewMsg done => error when receiving "+[i,"done"].join("_"),e)}})})},schedulePrintSectionJson:function(){var i=this;c.previewer.bind("sek-to-json",function(e){var t=o.extend(!0,{},i.getLevelModel(e.id));console.log(JSON.stringify(i.cleanIds(t)))})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(k,y){y.extend(CZRSeksPrototype,{generateUI:function(e){var t=this,i=y.Deferred();switch(_.isEmpty(e.action)&&i.reject("generateUI => missing action"),e.action){case"sek-generate-module-ui":try{i=t.generateUIforFrontModules(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-level-options-ui":try{i=t.generateUIforLevelOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-draggable-candidates-picker-ui":t.cleanRegistered();try{i=t.generateUIforDraggableContent(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}k.czr_sektions.currentContentPickerType(e.content_type||"module");break;case"sek-generate-local-skope-options-ui":t.cleanRegistered();try{i=t.generateUIforLocalSkopeOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-global-options-ui":t.cleanRegistered();try{i=t.generateUIforGlobalOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}}return"pending"==i.state()?i.resolve().promise():i.promise()},updateAPISettingAndExecutePreviewActions:function(n){if(!_.isEmpty(n.settingParams)&&_.has(n.settingParams,"to")){var r,s=this,e=n.settingParams.to,t=null,a=!1;if(!_.isEmpty(n.settingParams.args)&&_.has(n.settingParams.args,"moduleRegistrationParams")){var c=n.settingParams.args.moduleRegistrationParams.control,i=n.settingParams.args.moduleRegistrationParams.id,o=c.czr_Module(i);if(_.isEmpty(o)?k.errare("updateAPISettingAndExecutePreviewActions => missing parentModuleInstance",n):(t=o.module_type,a=o.isMultiItem()),!a&&_.isObject(e)?r=s.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!1}):(r=[],_.each(e,function(e){r.push(s.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!0}))})),_.isEmpty(n.defaultPreviewAction))k.errare("updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.",n);else{var l,d="refresh_stylesheet"===n.defaultPreviewAction,u="refresh_markup"===n.defaultPreviewAction,p="refresh_fonts"===n.defaultPreviewAction,m="refresh_preview"===n.defaultPreviewAction,f=n.settingParams.args.input_changed,g=function(){return l&&_.isString(l.refresh_markup)&&"true"!==l.refresh_markup&&"false"!==l.refresh_markup};_.isUndefined(f)||(l=s.getInputRegistrationParams(f,t),_.isUndefined(l.refresh_stylesheet)||(d=Boolean(l.refresh_stylesheet)),_.isUndefined(l.refresh_markup)||(u=g()?l.refresh_markup:Boolean(l.refresh_markup)),_.isUndefined(l.refresh_fonts)||(p=Boolean(l.refresh_fonts)),_.isUndefined(l.refresh_preview)||(m=Boolean(l.refresh_preview)));var h=function(){if(!0!==n.isGlobalOptions)return s.updateAPISetting({action:n.uiParams.action,id:n.uiParams.id,value:r,in_column:n.uiParams.in_column,in_sektion:n.uiParams.in_sektion,options_type:n.options_type,settingParams:n.settingParams}).done(function(e){var t;!0===d&&k.previewer.send("sek-refresh-stylesheet",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-stylesheet",id:n.uiParams.id,level:n.uiParams.level}}),a&&n.settingParams.args.inputRegistrationParams&&_.isFunction(n.settingParams.args.inputRegistrationParams.input_parent)&&(t=n.settingParams.args.inputRegistrationParams.input_parent.id);var i=function(){k.previewer.send("sek-refresh-level",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-level",id:n.uiParams.id,level:n.uiParams.level,changed_item_id:t,control_id:c.id,is_multi_items:a},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})};if(!0===u&&i(),g()){var o=n.settingParams.args.input_value;if(!_.isString(o))throw new Error("::updateAPISettingAndExecutePreviewActions => _doUpdateWithRequestedAction => refreshMarkupWhenNeededForInput => html content is not a string.");s.htmlIncludesElementsThatNeedAnAjaxRefresh(o)?i():k.previewer.send("sek-update-html-in-selector",{selector:l.refresh_markup,changed_item_id:t,is_multi_items:a,html:o,id:n.uiParams.id,location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-update-html-in-selector",id:n.uiParams.id,level:n.uiParams.level},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})}!0===m&&k.previewer.refresh()}).fail(function(e){k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated",e),k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated => params ",n)});if(_.isEmpty(n.options_type))k.errare("updateAPISettingAndExecutePreviewActions => error when updating the global options => missing options_type");else{var e=k(sektionsLocalizedData.optNameForGlobalOptions)(),t=y.extend(!0,{},_.isObject(e)?e:{}),i={};if(_.each(r||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(i[t]=e)}),t[n.options_type]=i,k(sektionsLocalizedData.optNameForGlobalOptions)(t),!1!==m&&k.previewer.refresh(),!0===p){var o=n.settingParams.args.input_value;if(!_.isString(o))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",o);s.updateGlobalGFonts(o)}!0===d&&k.previewer.send("sek-refresh-stylesheet",{local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),location_skope_id:sektionsLocalizedData.globalSkopeId})}};if(!0===p){var v=n.settingParams.args.input_value;if(!_.isString(v))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",v);!0===n.isGlobalOptions?h():s.updateAPISetting({action:"sek-update-fonts",font_family:v,is_global_location:s.isGlobalLocation(n.uiParams)}).always(function(){h().then(function(){s.updateAPISetting({action:"sek-update-fonts",is_global_location:s.isGlobalLocation(n.uiParams)})})})}else h()}}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated",n)}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated",n)},updateGlobalGFonts:function(e){var t=k(sektionsLocalizedData.optNameForGlobalOptions)(),i=y.extend(!0,{},_.isObject(t)?t:{}),o=this.sniffGlobalGFonts(i);!_.isEmpty(e)&&_.isString(e)&&-1<e.indexOf("gfont")&&!_.contains(o,e)&&o.push(e),i.fonts=o,k(sektionsLocalizedData.optNameForGlobalOptions)(i)},sniffGlobalGFonts:function(e){var i=[],o=function(e){_.each(e,function(e,t){"fonts"!==t&&(_.isString(t)&&-1<t.indexOf("font_family")&&-1<e.indexOf("gfont")&&!_.contains(i,e)&&i.push(e),(_.isArray(e)||_.isObject(e))&&o(e))})};return(_.isArray(e)||_.isObject(e))&&o(e),i},normalizeAndSanitizeSingleItemInputValues:function(n){var i,r={},o={},s=null,a=this;return _.each(n.item_value,function(e,t){var i,o;"title"!==t&&((n.is_multi_items||"id"!==t)&&(null!==n.parent_module_type&&"id"!==t&&"no_default_value_specified"===(s=a.getInputDefaultValue(t,n.parent_module_type))&&k.infoLog("::normalizeAndSanitizeSingleItemInputValues => missing default value for input "+t+" in module "+n.parent_module_type),i=e,o=s,(_.isBoolean(i)||_.isBoolean(o)?Boolean(i)===Boolean(o):_.isNumber(i)||_.isNumber(o)?Number(i)===Number(o):_.isString(i)||_.isString(o)?i+""==o+"":_.isObject(i)&&_.isObject(o)?_.isEqual(i,o):_.isArray(i)&&_.isArray(o)?JSON.stringify(i.sort())===JSON.stringify(o.sort()):i===o)||(_.isString(e)||_.isObject(e))&&_.isEmpty(e)||(r[t]=e)))}),_.each(r,function(e,t){switch(a.getInputType(t,n.parent_module_type)){case"text":case"textarea":case"check":case"gutencheck":case"select":case"radio":case"number":case"upload":case"upload_url":case"color":case"wp_color_alpha":case"wp_color":case"content_picker":case"detached_tinymce_editor":case"nimble_tinymce_editor":case"password":case"range":case"range_slider":case"hidden":case"h_alignment":case"h_text_alignment":case"spacing":case"bg_position":case"v_alignment":case"font_size":case"line_height":case"font_picker":default:i=e}o[t]=i}),o},isUIControlAlreadyRegistered:function(t){var e=_.filter(this.registered(),function(e){return e.id==t&&"control"===e.what}),i=!1;return _.isEmpty(e)?i=k.control.has(t):(i=!0,1<e.length&&k.errare("isUIControlAlreadyRegistered => why is this control registered more than once ? => "+t)),i},htmlIncludesElementsThatNeedAnAjaxRefresh:function(e){var t=e.match(/\[+([\w_-])+/g),i=e.match(/\{\{+([\w_-])+/g),o=e.match(/<script[\s\S]*?>[\s\S]*?<\/script>/gi),n=[],r=[];if(t)for(var s=0;s<t.length;s++){var a=t[s].replace(/^\[+/g,"");-1===n.indexOf(a)&&n.push(a)}if(i)for(var c=0;c<i.length;c++){var l=i[c].replace(/^\[+/g,"");-1===r.indexOf(l)&&r.push(l)}return!_.isEmpty(n)||!_.isEmpty(r)||!_.isEmpty(o)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(s,a){a.extend(CZRSeksPrototype,{generateUIforDraggableContent:function(r,e){var o=this,i={};a.extend(i,{sek_content_type_switcher_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+"_sek_content_type_switcher_ui",module_type:"sek_content_type_switcher_module",controlLabel:o.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),priority:10,settingValue:{content_type:r.content_type}},sek_module_picker_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+"_sek_draggable_modules_ui",module_type:"sek_module_picker_module",controlLabel:o.getRegisteredModuleProperty("sek_module_picker_module","name"),content_type:"module",priority:20,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'},sek_my_sections_sec_picker_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()+"_sek_draggable_sections_ui",module_type:"sek_my_sections_sec_picker_module",controlLabel:o.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),content_type:"section",expandAndFocusOnInit:!1,priority:10,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>',is_new:!0}}),_.each(["sek_intro_sec_picker_module","sek_features_sec_picker_module","sek_about_sec_picker_module","sek_contact_sec_picker_module","sek_team_sec_picker_module","sek_column_layouts_sec_picker_module","sek_header_sec_picker_module","sek_footer_sec_picker_module"],function(e,t){i[e]={settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()+"_sek_draggable_sections_ui",module_type:e,controlLabel:o.getRegisteredModuleProperty(e,"name"),content_type:"section",expandAndFocusOnInit:0===t,priority:30,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'}});var t=_.keys(i)[0],n=i[t].settingControlId;return o.isUIControlAlreadyRegistered(n)?s.control(n,function(t){t.focus({completeCallback:function(){var e=t.container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}})}):(_do_register_=function(){_.each(i,function(n,e){s.has(n.settingControlId)||(s(n.settingControlId,function(e){e.bind(function(e,t){s.errare("generateUIforDraggableContent => the setting() should not changed")})}),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:n.settingControlId,dirty:!1,value:n.settingValue||{},transport:"postMessage",type:"_nimble_ui_"})),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:o.SECTION_ID_FOR_CONTENT_PICKER,priority:n.priority||10,settings:{default:n.settingControlId},track:!1}).done(function(){s.control(n.settingControlId,function(e){e.content_type=n.content_type,!0===r.focus&&e.focus({completeCallback:function(){}});var t=e.container.find("label > .customize-control-title"),i=t.html();if(t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),n.is_new){var o=t.html();t.html(o+' <span class="sek-new-label">New!</span>')}_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),"section"===e.content_type?(e.container.attr("data-sek-expanded","false"),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&e.container.addClass("sek-expand-on-init")):e.container.attr("data-sek-accordion","no")})})}),s.trigger("nimble-modules-and-sections-controls-registered")},s.section(o.SECTION_ID_FOR_CONTENT_PICKER,function(e){_do_register_();var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.prepend('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),0<i.length&&i.find(".sek-level-option-icon").length<1&&i.find(".customize-action").after('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e,{expand_first_control:!1}),e.container.find(".customize-control.sek-expand-on-init").find("label > .customize-control-title").trigger("click")})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,u){u.extend(CZRSeksPrototype,{generateUIforFrontModules:function(r,e){var s=this;_.isEmpty(r.id)&&e.reject("generateUI => missing id");var i=s.getLevelProperty({property:"value",id:r.id}),t=s.getLevelProperty({property:"module_type",id:r.id}),o=s.getRegisteredModuleProperty(t,"name");_.isEmpty(t)&&e.reject("generateUI => module => invalid module_type");var n={};if(!0===s.getRegisteredModuleProperty(t,"is_father")){var a=s.getRegisteredModuleProperty(t,"children");if(_.isEmpty(a))throw new Error("::generateUIforFrontModules => a father module "+t+" is missing children modules ");_.each(a,function(e,t){n[t]={settingControlId:r.id+"__"+t,module_type:e,controlLabel:s.getRegisteredModuleProperty(e,"name")}})}else n.__no_option_group_to_be_updated_by_children_modules__={settingControlId:r.id,module_type:t,controlLabel:o};var c=_.keys(n)[0],l=n[c].settingControlId;return s.isUIControlAlreadyRegistered(l)?d.control(l).focus({completeCallback:function(){var e=d.control(l).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(s.cleanRegistered(),_do_register_=function(){_.each(n,function(o,n){if(!d.has(o.settingControlId)){var t=function(e,t,i){try{s.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_markup",uiParams:_.extend(r,{action:"sek-set-module-value"}),options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){d.errare("::generateUIforFrontModules => Error in updateAPISettingAndExecutePreviewActions",e)}};d(o.settingControlId,function(e){e.bind(_.debounce(t,s.SETTING_UPDATE_BUFFER))});var e=u.extend(!0,{},i);"__no_option_group_to_be_updated_by_children_modules__"!==n&&(e=!_.isEmpty(e)&&_.isObject(e)&&_.isObject(e[n])?e[n]:{}),d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:o.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",module_id:r.id,id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:r.id,priority:20,settings:{default:o.settingControlId}}).done(function(){}),d.control(o.settingControlId,function(e){d.control(o.settingControlId).focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=u("<div/>").html(t.html()).text();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false")})})},d.section(r.id,function(e){d.section(r.id).focus(),s.generateModuleOptionSwitcherUI(r.id,r.action),_do_register_(),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".customize-action").after('<i class="fas fa-pencil-alt sek-level-option-icon"></i>'),s.scheduleModuleAccordion.call(e,{expand_first_control:!0})}),d.CZR_Helpers.register({origin:"nimble",what:"section",id:r.id,title:sektionsLocalizedData.i18n["Content for"]+" "+o,panel:sektionsLocalizedData.sektionsPanelId,priority:1e3}).done(function(){})),e},generateModuleOptionSwitcherUI:function(e,t){var i=e+"__option_switcher";d.has(i)||(d(i,function(e){e.bind(function(e,t){d.errare("generateUIforDraggableContent => the setting() should not changed")})}),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"setting",id:i,dirty:!1,value:"",transport:"postMessage",type:"_nimble_ui_"})),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"control",module_id:e,id:i,label:"",type:"czr_module",module_type:"sek_mod_option_switcher_module",section:e,priority:10,settings:{default:i},has_accordion:!1,ui_action:t}).done(function(){d.control(i,function(e){e.deferred.embedded.done(function(){e.container.find(".customize-control-title").hide(),e.container.attr("data-sek-accordion","no")})})})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{generateUIforLevelOptions:function(s,e){var a=this,c=a.getLevelProperty({property:"options",id:s.id});c=_.isObject(c)?c:{};var t={};l.trigger("nb_setup_level_ui_registration_params",{params:s,modulesRegistrationParams:t}),d.extend(t,{bg:{settingControlId:s.id+"__bg_options",module_type:"sek_level_bg_module",controlLabel:sektionsLocalizedData.i18n["Background settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">gradient</i>'}}),"section"===s.level&&d.extend(t,{level_text:{settingControlId:s.id+"__text_options",module_type:"sek_level_text_module",controlLabel:sektionsLocalizedData.i18n["Text settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">text_format</i>'}}),d.extend(t,{border:{settingControlId:s.id+"__border_options",module_type:"sek_level_border_module",controlLabel:sektionsLocalizedData.i18n["Borders settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">rounded_corner</i>'},spacing:{settingControlId:s.id+"__spacing_options",module_type:"sek_level_spacing_module",controlLabel:sektionsLocalizedData.i18n["Padding and margin settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">center_focus_weak</i>'},anchor:{settingControlId:s.id+"__anchor_options",module_type:"sek_level_anchor_module",controlLabel:sektionsLocalizedData.i18n["Custom anchor ( CSS ID ) and CSS classes for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-anchor sek-level-option-icon"></i>'},visibility:{settingControlId:s.id+"__visibility_options",module_type:"sek_level_visibility_module",controlLabel:sektionsLocalizedData.i18n["Device visibility settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="far fa-eye sek-level-option-icon"></i>'},height:{settingControlId:s.id+"__height_options",module_type:"sek_level_height_module",controlLabel:sektionsLocalizedData.i18n["Height, vertical alignment, z-index for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-vertical sek-level-option-icon"></i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{animation:{settingControlId:s.id+"__animate_options",module_type:"sek_level_animation_module",controlLabel:sektionsLocalizedData.i18n["Animation settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">movie_filter</i>',isPro:!0}}),"section"===s.level&&(d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_section",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),d.extend(t,{breakpoint:{settingControlId:s.id+"__breakpoint_options",module_type:"sek_level_breakpoint_module",controlLabel:sektionsLocalizedData.i18n["Responsive settings : breakpoint, column direction"],icon:'<i class="material-icons sek-level-option-icon">devices</i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{sec_custom_css:{settingControlId:s.id+"__sec_custom_css",module_type:"sek_level_cust_css_section",controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>',isPro:!0}})),"column"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_column",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),"module"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_module",controlLabel:sektionsLocalizedData.i18n["Width and horizontal alignment for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}});var i=_.keys(t)[0],o=t[i].settingControlId;return a.isUIControlAlreadyRegistered(o)?l.control(o).focus({completeCallback:function(){var e=l.control(o).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(a.cleanRegistered(),_do_register_=function(){_.each(t,function(o,n){if(a.isUIControlAlreadyRegistered(o.settingControlId))l.section(l.control(o.settingControlId).section()).expanded(!0);else{if(!l.has(o.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:s,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){l.errare("::generateUIforLevelOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};l(o.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=c[n]||{},i=a.getModuleStartingValue(o.module_type);if("no_starting_value"!==i&&_.isObject(i)){var r=d.extend(!0,{},i);e=d.extend(r,e)}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:o.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}l.CZR_Helpers.register({origin:"nimble",level:s.level,level_id:s.id,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:s.id,priority:20,settings:{default:o.settingControlId}}).done(function(){}),l.control(o.settingControlId,function(e){!0===o.expandAndFocusOnInit&&e.focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),o.isPro&&!sektionsLocalizedData.isPro&&t.append(['<img class="sek-pro-icon-next-title" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_orange.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})}})},l.section(s.id,function(e){_do_register_(),"module"===s.level&&a.generateModuleOptionSwitcherUI(s.id,s.action),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.find(".customize-action").after('<i class="fas fa-sliders-h sek-level-option-icon"></i>'),a.scheduleModuleAccordion.call(e,{expand_first_control:!1})}),l.CZR_Helpers.register({origin:"nimble",what:"section",id:s.id,title:sektionsLocalizedData.i18n["Settings for the"]+" "+s.level,panel:sektionsLocalizedData.sektionsPanelId,priority:10}).done(function(){})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{getLocalSkopeOptionId:function(){var e=l.czr_skopeBase.getSkopeProperty("skope_id");return _.isEmpty(e)?(l.errare("czr_sektions::getLocalSkopeOptionId => empty skope_id "),""):sektionsLocalizedData.optPrefixForSektionsNotSaved+e+"__localSkopeOptions"},generateUIforLocalSkopeOptions:function(s,e){var a=this,i=a.getLocalSkopeOptionId();if(a.isUIControlAlreadyRegistered(i))return e;if(a.localOptionsRegistrationParams={},_.isUndefined(sektionsLocalizedData.localOptionsMap)||!_.isObject(sektionsLocalizedData.localOptionsMap))return l.errare("::generateUIforGlobalOptions => missing or invalid localOptionsMap"),e;!0===s.clean_settings&&a.cleanRegisteredLocalOptionSettings(),_.each(sektionsLocalizedData.localOptionsMap,function(e,t){switch(t){case"template":a.localOptionsRegistrationParams[t]={settingControlId:i+"__template",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page template"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">check_box_outline_blank</i>'};break;case"local_header_footer":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"widths":a.localOptionsRegistrationParams[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Inner and outer widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"custom_css":a.localOptionsRegistrationParams[t]={settingControlId:i+"__custom_css",module_type:e,controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>'};break;case"local_performances":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"local_reset":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections in this page"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"local_revisions":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of local sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"import_export":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;default:l.errare("::generateUIforLocalOptions => an option group could not be registered => "+e,t)}});var t=l(a.localSectionsSettingId())(),c=d.extend(!0,{},_.isObject(t.local_options)?t.local_options:{});return _do_register_=function(){_.each(a.localOptionsRegistrationParams,function(o,n){var e=a.getModuleStartingValue(o.module_type),t=_.isObject(c[n])?c[n]:{};if(!l.has(o.settingControlId)){var i=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_preview",uiParams:s,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){l.errare("::generateUIforLocalSkopeOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};if(l(o.settingControlId,function(e){e.bind(_.debounce(i,a.SETTING_UPDATE_BUFFER))}),"no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);t=d.extend(r,t)}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:o.settingControlId,dirty:!1,value:t,transport:"postMessage",type:"_nimble_ui_"})}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:a.SECTION_ID_FOR_LOCAL_OPTIONS,priority:10,settings:{default:o.settingControlId}}).done(function(){l.control(o.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{generateUIforGlobalOptions:function(s,e){var a=this,i=sektionsLocalizedData.optPrefixForSektionsNotSaved+sektionsLocalizedData.optNameForGlobalOptions;if(a.isUIControlAlreadyRegistered(i))return e;var o={};if(_.isUndefined(sektionsLocalizedData.globalOptionsMap)||!_.isObject(sektionsLocalizedData.globalOptionsMap))return l.errare("::generateUIforGlobalOptions => missing or invalid globalOptionsMap"),e;_.each(sektionsLocalizedData.globalOptionsMap,function(e,t){switch(t){case"global_text":o[t]={settingControlId:i+"__global_text",module_type:e,controlLabel:sektionsLocalizedData.i18n["Global text options for Nimble sections"],icon:'<i class="material-icons sek-level-option-icon">text_format</i>'};break;case"widths":o[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide inner and outer sections widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"breakpoint":o[t]={settingControlId:i+"__breakpoint",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide breakpoint for Nimble sections"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">devices</i>'};break;case"global_header_footer":o[t]={settingControlId:i+"__header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"performances":o[t]={settingControlId:i+"__performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"recaptcha":o[t]={settingControlId:i+"__recaptcha",module_type:e,controlLabel:sektionsLocalizedData.i18n["Protect your contact forms with Google reCAPTCHA"],icon:'<i class="material-icons sek-level-option-icon">security</i>'};break;case"global_revisions":o[t]={settingControlId:i+"__global_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of global sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"global_imp_exp":o[t]={settingControlId:i+"__global_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import global sections"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;case"global_reset":o[t]={settingControlId:i+"__global_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections displayed in global locations"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"beta_features":o[t]={settingControlId:i+"__beta_features",module_type:e,controlLabel:sektionsLocalizedData.i18n["Beta features"],icon:'<i class="material-icons sek-level-option-icon">widgets</i>'};break;default:l.errare("::generateUIforGlobalOptions => an option group could not be registered => "+e,t)}});var c=sektionsLocalizedData.globalOptionDBValues;return _do_register_=function(){_.each(o,function(o,n){if(!l.has(o.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({isGlobalOptions:!0,defaultPreviewAction:"refresh_preview",uiParams:s,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){l.errare("::generateUIforGlobalOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};l(o.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=a.getModuleStartingValue(o.module_type),i=_.isObject(c)&&!_.isEmpty(c[n])?c[n]:{};if("no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);i=d.extend(r,i)}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:o.settingControlId,dirty:!1,value:i,transport:"postMessage",type:"_nimble_ui_"})}l.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:a.SECTION_ID_FOR_GLOBAL_OPTIONS,priority:20,settings:{default:o.settingControlId},track:!1}).done(function(){l.control(o.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(m,f){f.extend(CZRSeksPrototype,{updateAPISetting:function(l){var d=this;(l=l||{}).is_global_location="global"===l.scope||d.isGlobalLocation(l);var u=l.is_global_location?d.getGlobalSectionsSettingId():d.localSectionsSettingId(),p=m(u)();d.updAPISetParams={params:l,promise:f.Deferred(),newSetValue:_.isObject(p)?f.extend(!0,{},p):d.getDefaultSektionSettingValue(l.is_global_location?"global":"local"),cloneId:"",sectionInjectPromise:"_not_injection_scenario_"};return m(u,function(e){!function(){switch(d.updAPISetParams.newSetValue.collection=_.isArray(d.updAPISetParams.newSetValue.collection)?d.updAPISetParams.newSetValue.collection:d.getDefaultSektionSettingValue(l.is_global_location?"global":"local").collection,l.action){case"sek-maybe-add-missing-locations":var t,i;d.activeLocations(),f.extend(!0,[],d.updAPISetParams.newSetValue.collection),_.each(d.activeLocations(),function(e){t=_.findWhere(d.updAPISetParams.newSetValue.collection,{id:e}),_.isUndefined(t)&&((i=f.extend(!0,{},sektionsLocalizedData.defaultLocationModel)).id=e,m.infoLog("=> adding missing location to api setting value",i),d.updAPISetParams.newSetValue.collection.push(i))});break;case"sek-add-section":d._updAPISet_sek_add_sektion();break;case"sek-duplicate-section":d._updAPISet_sek_duplicate_sektion();break;case"sek-remove-section":d._updAPISet_sek_remove_sektion();break;case"sek-move-section":d._updAPISet_sek_move_sektion();break;case"sek-move-section-up-down":d._updAPISet_sek_move_sektion_up_down();break;case"sek-add-column":d._updAPISet_sek_add_column();break;case"sek-remove-column":d._updAPISet_sek_remove_column();break;case"sek-duplicate-column":d._updAPISet_sek_duplicate_column();break;case"sek-resize-columns":d._updAPISet_sek_resize_column();break;case"sek-move-column":d._updAPISet_sek_move_column();break;case"sek-add-module":d._updAPISet_sek_add_module();break;case"sek-duplicate-module":d._updAPISet_sek_duplicate_module();break;case"sek-remove-module":d._updAPISet_sek_remove_module();break;case"sek-move-module":d._updAPISet_sek_move_module();break;case"sek-set-module-value":d._updAPISet_sek_set_module_value();break;case"sek-add-content-in-new-sektion":d._updAPISet_sek_add_content_in_new_sektion();break;case"sek-add-preset-section-in-new-nested-sektion":d._updAPISet_sek_add_preset_sektion_in_new_nested_sektion();break;case"sek-import-from-file":d._updAPISet_sek_import_from_file();break;case"sek-inject-tmpl-from-gallery":d._updAPISet_sek_inject_tmpl_from_gallery();break;case"sek-generate-level-options-ui":var e=d.getLevelModel(l.id,d.updAPISetParams.newSetValue.collection),o={};if("no_match"===e){m.errare("updateAPISetting => "+l.action+" => no parent sektion matched"),d.updAPISetParams.promise.reject("updateAPISetting => "+l.action+" => no parent sektion matched");break}var n=f.extend(!0,{},e.options||{});_.each(l.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(l.options_type)&&m.errare("updateAPISetting => "+l.action+" => missing options_type"),n[l.options_type]=o,e.options=n;break;case"sek-generate-local-skope-options-ui":o={};var r=f.extend(!0,{},_.isObject(d.updAPISetParams.newSetValue.local_options)?d.updAPISetParams.newSetValue.local_options:{});if(_.each(l.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(l.options_type)||!_.isString(l.options_type))m.errare("updateAPISetting => "+l.action+" => missing options_type");else{var s={};s[l.options_type]=o,d.updAPISetParams.newSetValue.local_options=f.extend(r,s)}break;case"sek-update-fonts":var a=d.sniffGFonts({is_global_location:l&&!0===l.is_global_location});!_.isEmpty(l.font_family)&&_.isString(l.font_family)&&-1<l.font_family.indexOf("gfont")&&!_.contains(a,l.font_family)&&a.push(l.font_family),d.updAPISetParams.newSetValue.fonts=a;break;case"sek-restore-revision":d.updAPISetParams.newSetValue=l.revision_value;break;case"sek-reset-collection":try{d.updAPISetParams.newSetValue=m.czr_sektions.resetCollectionSetting(l.scope)}catch(e){m.errare("sek-reset-collection => error when firing resetCollectionSetting()",e)}}if("pending"==d.updAPISetParams.promise.state()){var c=function(){var e=l.settingParams&&l.settingParams.from&&l.settingParams.to;e&&_.isEqual(l.settingParams.from,l.settingParams.to)?d.updAPISetParams.promise.reject("updateAPISetting => main sektion setting change => the new setting value is unchanged when firing action : "+l.action):!e&&_.isEqual(p,d.updAPISetParams.newSetValue)?d.updAPISetParams.promise.reject("updateAPISetting => the new setting value is unchanged when firing action : "+l.action):null!==d.validateSettingValue(d.updAPISetParams.newSetValue,l.is_global_location?"global":"local")?(m(u)(d.updAPISetParams.newSetValue,l),l.cloneId=d.updAPISetParams.cloneId,d.updAPISetParams.promise.resolve(l)):d.updAPISetParams.promise.reject("Validation problem for action "+l.action)};"_not_injection_scenario_"===d.updAPISetParams.sectionInjectPromise?(c(),"pending"===d.updAPISetParams.promise.state()&&m.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")):d.updAPISetParams.sectionInjectPromise.done(function(){c(),"pending"===d.updAPISetParams.promise.state()&&m.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")}).fail(function(e){m.errare("updateAPISetting => self.updAPISetParams.sectionInjectPromise failed",e)})}}()}),d.updAPISetParams.promise.promise()},resetColumnsWidthInSection:function(e){_.each(e.collection,function(e){e.options&&e.options.width&&e.options.width["custom-width"]&&(e.options.width=_.omit(e.options.width,"custom-width")),e.width=""})},_maybeFetchSectionsFromServer:function(){var e,t=f.Deferred();return _.isEmpty(m.sek_presetSections)?(_.isUndefined(m.sek_fetchingPresetSections)||"pending"!=m.sek_fetchingPresetSections.state()?(e=wp.ajax.post("sek_get_preset_sections",{nonce:m.settings.nonce.save}),m.sek_fetchingPresetSections=e):e=m.sek_fetchingPresetSections,e.done(function(e){m.sek_presetSections=e,t.resolve(m.sek_presetSections)}).fail(function(e){t.reject(e)})):t.resolve(m.sek_presetSections),t.promise()},getPresetSectionCollection:function(o){var n=this,r=f.Deferred();return o.is_user_section?wp.ajax.post("sek_get_user_section_json",{nonce:m.settings.nonce.save,section_post_name:o.presetSectionId}).done(function(e){if(!_.isObject(e)||_.isEmpty(e)||_.isUndefined(e.data))throw m.errare("getPresetSectionCollection => preset section type not found or empty : "+o.presetSectionId,e),new Error("getPresetSectionCollection => preset section type not found or empty");var t=f.extend({},!0,e.data);t.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),t.collection=n.setPresetOrUserSectionIds(t.collection),t.ver_ini=sektionsLocalizedData.nimbleVersion,t.collection=n.setPresetSectionVersion(t.collection),r.resolve(t)}).fail(function(e){r.reject(e)}):n._maybeFetchSectionsFromServer().fail(function(e){r.reject(e)}).done(function(e){var t=f.extend(!0,{},_.isObject(e)?e:{});if(_.isEmpty(t))throw new Error("getPresetSectionCollection => Invalid collection");if(_.isEmpty(t[o.presetSectionId]))throw new Error('getPresetSectionCollection => the preset section : "'+o.presetSectionId+'" has not been found in the collection');var i=t[o.presetSectionId];i.collection=n.setPresetOrUserSectionIds(i.collection),i.ver_ini=sektionsLocalizedData.nimbleVersion,i.collection=n.setPresetSectionVersion(i.collection),r.resolve(i)}),r.promise()},setPresetOrUserSectionIds:function(e){var t=this;return _.isArray(e)&&_.each(e,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),_.isArray(e.collection)&&t.setPresetOrUserSectionIds(e.collection)}),e},setPresetSectionVersion:function(e){var t=this;return _.each(e,function(e){e.ver_ini=sektionsLocalizedData.nimbleVersion,_.isArray(e.collection)&&t.setPresetSectionVersion(e.collection)}),e},preparePresetSectionForInjection:function(n){var i=this,o={},r=f.Deferred();i.maybeGenerateNewItemIdsForCrudModules(n);var s=function(e){return _.each(e,function(e,t){_.isObject(e)||_.isArray(e)?s(e):_.isString(e)&&-1!=e.indexOf("__img_url__")&&(_.has(o,e)||(o[e]=i.importAttachment(e.replace("__img_url__",""))))}),o},a=function(i,o){return _.each(i,function(e,t){_.isObject(e)||_.isArray(e)?a(e,o):_.isString(e)&&-1!=e.indexOf("__img_url__")&&_.has(o,e)&&_.isObject(o[e])&&(i[t]=o[e].id)}),n};return i.whenAllPromisesInParallel(s(n)).done(function(e){var t=a(n,e);r.resolve(t)}).fail(function(e){r.reject(e)}),r.promise()}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(y,b){b.extend(CZRSeksPrototype,{_updAPISet_sek_add_sektion:function(){var i,e,t,o,n=this;if(i=n.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.location))throw new Error("updateAPISetting => "+i.action+" => missing location");if(!0===i.is_nested)e=n.getLevelModel(i.in_column,n.updAPISetParams.newSetValue.collection),"no_match"==(t=n.getLevelModel(i.in_sektion,n.updAPISetParams.newSetValue.collection))?n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no grand parent sektion found"):!0===t.is_nested?(n.updAPISetParams.promise.reject(""),y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")})):"no_match"==e?(y.errare("updateAPISetting => "+i.action+" => no parent column matched"),n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched")):(e.collection=_.isArray(e.collection)?e.collection:[],e.collection.push({id:i.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion}));else if("no_match"==(o=n.getLevelModel(i.location,n.updAPISetParams.newSetValue.collection)))y.errare("updateAPISetting => "+i.action+" => no location matched"),n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no location matched");else{var r=0;o.collection=_.isArray(o.collection)?o.collection:[],_.each(o.collection,function(e,t){i.before_section===e.id&&(r=t),i.after_section===e.id&&(r=t+1)}),o.collection=_.isArray(o.collection)?o.collection:[],o.collection.splice(r,0,{id:i.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+n.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion})}},_updAPISet_sek_duplicate_sektion:function(){var t,e,i,o,n=this;if(t=n.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if(_.isEmpty(t.location))throw new Error("updateAPISetting => "+t.action+" => missing location");try{o=n.cloneLevel(t.id)}catch(e){return void y.errare("updateAPISetting => "+t.action,e)}n.maybeGenerateNewItemIdsForCrudModules(o);var r=n.getLevelPositionInCollection(t.id,n.updAPISetParams.newSetValue.collection);if(!0===t.is_nested){if("no_match"==(e=n.getLevelModel(t.in_column,n.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no parent column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[],e.collection.splice(parseInt(r+1,10),0,o)}else{if("no_match"==(i=n.getLevelModel(t.location,n.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.isArray(i.collection)?i.collection:[],i.collection.splice(parseInt(r+1,10),0,o)}n.updAPISetParams.cloneId=o.id},_updAPISet_sek_remove_sektion:function(){var t,e,i,o=this;if(!0===(t=o.updAPISetParams.params).is_nested)"no_match"!=(e=o.getLevelModel(t.in_column,o.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):y.errare("updateAPISetting => "+t.action+" => no parent column matched");else{if("no_match"==(i=o.getLevelModel(t.location,o.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.filter(i.collection,function(e){return e.id!=t.id})}},_updAPISet_sek_move_sektion:function(){var t,i,o,n=this;t=n.updAPISetParams.params;var e,r,s=n.getLevelModel(t.to_location,n.updAPISetParams.newSetValue.collection);if(_.isEmpty(s)||"no_match"==s)throw new Error("updateAPISetting => "+t.action+" => missing target location");if(t.from_location!=t.to_location){var a=n.getLevelModel(t.from_location,n.updAPISetParams.newSetValue.collection);if(_.isEmpty(a)||"no_match"==a)throw new Error("updateAPISetting => "+t.action+" => missing source location");a.collection=_.isArray(a.collection)?a.collection:[],e=n.getLevelModel(t.id,a.collection),r=b.extend(!0,{},e),a.collection=_.filter(a.collection,function(e){return e.id!=t.id})}s.collection=_.isArray(s.collection)?s.collection:[],i=b.extend(!0,[],s.collection),o=[],_.each(t.newOrder,function(e){if(t.from_location!=t.to_location&&e==r.id)o.push(r);else{if(sektionCandidate=n.getLevelModel(e,i),_.isEmpty(sektionCandidate)||"no_match"==sektionCandidate)throw new Error("updateAPISetting => "+t.action+" => missing section candidate");o.push(sektionCandidate)}}),s.collection=o},_updAPISet_sek_move_sektion_up_down:function(){var t,e,i,o,n=this;if(t=n.updAPISetParams.params,e=n.getLevelModel(t.is_nested?t.in_column:t.location,n.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target location");e.collection=_.isArray(e.collection)?e.collection:[],i=b.extend(!0,[],e.collection),o=b.extend(!0,[],e.collection);var r=_.findIndex(i,function(e){return e.id===t.id});if(-1===r)throw new Error("updateAPISetting => "+t.action+" => invalid index");var s,a,c=t.direction||"up",l=i.length===r+1,d=0===r,u=n.activeLocationsInfo(),p=_.isArray(u)?_.findWhere(u,{id:t.location}):{};s=_.isObject(p)&&p.is_global,a=_.isObject(p)&&p.is_header_footer;var m=[];_.isArray(u)&&_.each(n.activeLocationsInfo(),function(e){e.is_global||e.is_header_footer||m.push(e.id)});var f,g=_.findIndex(m,function(e){return e===t.location}),h=!t.is_nested&&!s&&!a,v=0===g,k=m.length===g+1;h&&l&&"up"!==c&&!k?(f=m[g+1],n.getLevelModel(f,n.updAPISetParams.newSetValue.collection).collection.unshift(i[r]),e.collection.pop(),t.new_location=f):h&&d&&"up"===c&&!v?(f=m[g-1],n.getLevelModel(f,n.updAPISetParams.newSetValue.collection).collection.push(i[r]),e.collection.shift(),t.new_location=f):"up"!==c&&i.length===r+1?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved lower."]+"</strong>","</span>"].join("")}):"up"===c&&0===r?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved higher."]+"</strong>","</span>"].join("")}):(o[r]=i["up"===c?r-1:r+1],o["up"===c?r-1:r+1]=i[r],e.collection=o)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,t){t.extend(CZRSeksPrototype,{_updAPISet_sek_add_content_in_new_sektion:function(){var r,s,a,c=this;r=c.updAPISetParams.params;var e,i=0;if("no_match"==(a=c.getLevelModel(r.location,c.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+r.action+" => no location matched"),void c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no location matched");switch(a.collection=_.isArray(a.collection)?a.collection:[],_.each(a.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),r.content_type){case"module":e=c.getModuleStartingValue(r.content_id),a.collection.splice(i,0,{id:r.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+c.guid(),level:"column",collection:[{id:r.droppedModuleId,level:"module",module_type:r.content_id,value:"no_starting_value"!==e?e:null,ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion});break;case"preset_section":c.updAPISetParams.sectionInjectPromise=t.Deferred();var o=function(e,i){var t=!1;if(!_.isEmpty(r.sektion_to_replace)){var o=c.getLevelModel(r.sektion_to_replace,c.updAPISetParams.newSetValue.collection);"no_match"===o&&(l.errare("updateAPISetting => "+r.action+" => no sektionToReplace matched"),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no sektionToReplace matched")),t=!0===o.is_nested}var n=sektionsLocalizedData.optPrefixForSektionsNotSaved+c.guid();r.collection_of_preset_section_id=r.collection_of_preset_section_id||[],r.collection_of_preset_section_id.push(n),t?("no_match"===(s=c.getLevelModel(r.in_column,c.updAPISetParams.newSetValue.collection))&&(l.errare("updateAPISetting => "+r.action+" => no parent column matched"),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no parent column matched")),s.collection=_.isArray(s.collection)?s.collection:[],_.each(s.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),s.collection.splice(i,0,{id:n,is_nested:!0,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})):a.collection.splice(i,0,{id:n,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})};c.getPresetSectionCollection({is_user_section:r.is_user_section,presetSectionId:r.content_id}).fail(function(e){l.errare("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()",e),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(l.errare("updateAPISetting => "+r.action+" => preset section type not found or empty : "+r.content_id,e),c.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => preset section type not found or empty")),t=e,c.preparePresetSectionForInjection(t).fail(function(e){c.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+r.action+" => "+e),c.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){"section"===e.collection[0].level?_.each(e.collection,function(e){o(e,i),i++}):o(e,i),c.updAPISetParams.sectionInjectPromise.resolve()})})}},_updAPISet_sek_add_preset_sektion_in_new_nested_sektion:function(){var o,n,e,r=this;if(o=r.updAPISetParams.params,"no_match"===(n=r.getLevelModel(o.in_column,r.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+o.action+" => no parent column matched"),void r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => no parent column matched");var i=0;if(n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){o.before_module_or_nested_section===e.id&&(i=t),o.after_module_or_nested_section===e.id&&(i=t+1)}),"no_match"!=(e=r.getLevelModel(o.in_sektion,r.updAPISetParams.newSetValue.collection))){if(!0===e.is_nested)return r.updAPISetParams.promise.reject(""),void l.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")});r.updAPISetParams.sectionInjectPromise=t.Deferred();r.getPresetSectionCollection({is_user_section:o.is_user_section,presetSectionId:o.content_id}).fail(function(){l.errare("updateAPISetting => "+o.action+" => Error with self.getPresetSectionCollection()",_er_),r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(l.errare("updateAPISetting => "+o.action+" => preset section type not found or empty : "+o.content_id,e),r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => preset section type not found or empty")),t=e,r.preparePresetSectionForInjection(t).fail(function(e){r.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+o.action+" => "+e),r.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){var t=function(e,t){t=t||0;var i=sektionsLocalizedData.optPrefixForSektionsNotSaved+r.guid();o.collection_of_preset_section_id=o.collection_of_preset_section_id||[],o.collection_of_preset_section_id.push(i),n.collection.splice(t,0,{id:i,level:"section",collection:e.collection,options:e.options||{},is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion})};"section"===e.collection[0].level?_.each(e.collection,function(e){t(e,i),i++}):t(e,i),r.updAPISetParams.sectionInjectPromise.resolve()})})}else r.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => no grand parent sektion found")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{_updAPISet_sek_add_column:function(){var e,t,i=this;if(e=i.updAPISetParams.params,_.isEmpty(e.id))throw new Error("updateAPISetting => "+e.action+" => missing id");if("no_match"==(t=i.getLevelModel(e.in_sektion,i.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+e.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => no parent sektion matched");t.collection=_.isArray(t.collection)?t.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(t.collection)?i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]):(i.resetColumnsWidthInSection(t),t.collection.push({id:e.id,level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}))},_updAPISet_sek_remove_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,"no_match"!=(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection))){if(1===_.size(e.collection))return void i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["A section must have at least one column."]);e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(e)}else l.errare("updateAPISetting => "+t.action+" => no parent sektion matched")},_updAPISet_sek_duplicate_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+t.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent sektion matched");if(e.collection=_.isArray(e.collection)?e.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(e.collection))i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);else{var o;try{o=i.cloneLevel(t.id)}catch(e){return void l.errare("updateAPISetting => "+t.action,e)}i.maybeGenerateNewItemIdsForCrudModules(o);var n=i.getLevelPositionInCollection(t.id,i.updAPISetParams.newSetValue.collection);i.updAPISetParams.cloneId=o.id,e.collection.splice(parseInt(n+1,10),0,o),i.resetColumnsWidthInSection(e)}},_updAPISet_sek_resize_column:function(){var n,o=this;if(!((n=o.updAPISetParams.params).col_number<2)){var t=o.getLevelModel(n.resized_column,o.updAPISetParams.newSetValue.collection),i=o.getLevelModel(n.sister_column,o.updAPISetParams.newSetValue.collection);if("no_match"==t)return l.errare("updateAPISetting => "+n.action+" => no resized column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => no resized column matched");var r=function(e,t){var i=d.extend(!0,{},e.options||{});return i.width=_.isObject(i.width)&&i.width["custom-width"]?i.width:{},i.width["custom-width"]=t,e.options=i,o.cachedElements.$body.find('[data-sek-width-range-column-id="'+e.id+'"]').val(t).trigger("input",{is_resize_column_trigger:!0}),t},e=r(t,parseFloat(n.resizedColumnWidthInPercent));e=parseFloat(e);var s=o.getLevelModel(n.in_sektion,o.updAPISetParams.newSetValue.collection),a=_.filter(s.collection,function(e){return e.id!=t.id&&e.id!=i.id}),c=parseFloat(e.toFixed(3));_.isEmpty(a)||_.each(a,function(e){var t,i,o;currentColWidth=(t=e,i="_not_set_",o=_.isObject(t.options)?t.options:{},!_.isEmpty(o)&&o.width&&o.width["custom-width"]&&(i=parseFloat(1*o.width["custom-width"])),i),("_not_set_"===currentColWidth||!_.isNumber(1*currentColWidth)||_.isEmpty(currentColWidth+"")||currentColWidth<1)&&(currentColWidth=r(e,parseFloat((100/n.col_number).toFixed(3)))),c=parseFloat((c+currentColWidth).toFixed(3))}),r(i,parseFloat((100-c).toFixed(3)))}},_updAPISet_sek_move_column:function(){var t,i=this;t=i.updAPISetParams.params;var e,o,n=i.getLevelModel(t.to_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(n)||"no_match"==n)throw new Error("updateAPISetting => "+t.action+" => missing target sektion");if(t.from_sektion!=t.to_sektion){var r=i.getLevelModel(t.from_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],e=i.getLevelModel(t.id,r.collection),o=d.extend(!0,{},e),r.collection=_.filter(r.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(r)}n.collection=_.isArray(n.collection)?n.collection:[],originalCollection=d.extend(!0,[],n.collection),reorderedCollection=[],_.each(t.newOrder,function(e){if(t.from_sektion!=t.to_sektion&&e==o.id)reorderedCollection.push(o);else{if(columnCandidate=i.getLevelModel(e,originalCollection),_.isEmpty(columnCandidate)||"no_match"==columnCandidate)throw new Error("updateAPISetting => moveColumn => missing columnCandidate");reorderedCollection.push(columnCandidate)}}),n.collection=reorderedCollection,i.resetColumnsWidthInSection(n)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{_updAPISet_sek_add_module:function(){var i,e,t,o,n=this;if(i=n.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.module_type))throw new Error("updateAPISetting => "+i.action+" => missing module_type");if("no_match"===(e=n.getLevelModel(i.in_column,n.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+i.action+" => no parent column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched");o=0,e.collection=_.isArray(e.collection)?e.collection:[],_.each(e.collection,function(e,t){i.before_module_or_nested_section===e.id&&(o=t),i.after_module_or_nested_section===e.id&&(o=t+1)});var r={id:i.id,level:"module",module_type:i.module_type,ver_ini:sektionsLocalizedData.nimbleVersion};"no_starting_value"!==(t=n.getModuleStartingValue(i.module_type))&&(r.value=t),e.collection.splice(o,0,r)},_updAPISet_sek_duplicate_module:function(){var t,e,i,o=this;if(t=o.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=o.getLevelModel(t.in_column,o.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+t.action+" => no parent column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[];try{i=o.cloneLevel(t.id)}catch(e){return c.errare("updateAPISetting => "+t.action,e),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => error when cloning the level")}o.maybeGenerateNewItemIdsForCrudModules(i);var n=o.getLevelPositionInCollection(t.id,o.updAPISetParams.newSetValue.collection);o.updAPISetParams.cloneId=i.id,e.collection.splice(parseInt(n+1,10),0,i)},_updAPISet_sek_remove_module:function(){var t,e;if(t=this.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");"no_match"!=(e=this.getLevelModel(t.in_column,this.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):c.errare("updateAPISetting => "+t.action+" => no parent column matched")},_updAPISet_sek_move_module:function(){var t,e,i,o,n=this;if(t=n.updAPISetParams.params,e=n.getLevelModel(t.to_column,n.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target column");if(t.from_column!=t.to_column){var r;if(r=n.getLevelModel(t.from_column,n.updAPISetParams.newSetValue.collection),_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],i=n.getLevelModel(t.id,n.updAPISetParams.newSetValue.collection),o=l.extend(!0,{},i),r.collection=_.filter(r.collection,function(e){return e.id!=t.id})}e.collection=_.isArray(e.collection)?e.collection:[],originalCollection=l.extend(!0,[],e.collection);var s=[];if(_.each(t.newOrder,function(e){if(t.from_column!=t.to_column&&e==o.id)s.push(o);else{if(moduleCandidate=n.getLevelModel(e,n.updAPISetParams.newSetValue.collection),_.isEmpty(moduleCandidate)||"no_match"==moduleCandidate)throw new Error("updateAPISetting => "+t.action+" => missing moduleCandidate");s.push(moduleCandidate)}}),s.length!=_.uniq(s).length)throw new Error("updateAPISetting => "+t.action+" => there are duplicated modules in column : "+e.id);e.collection=s},_updAPISet_sek_set_module_value:function(){var e,t,i=this;e=i.updAPISetParams.params,t=i.getLevelModel(e.id,i.updAPISetParams.newSetValue.collection);var o=e.settingParams.args.moduleRegistrationParams.control,n=e.settingParams.args.moduleRegistrationParams.id,r=o.czr_Module(n);_.isEmpty(r)?c.errare("updateAPISetting => missing parentModuleInstance",e):isMultiItemModule=r.isMultiItem();var s=isMultiItemModule?[]:{};if(_.each(e.value||(isMultiItemModule?[]:{}),function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(s[t]=e)}),"no_match"==t)return c.errare("updateAPISetting => "+e.action+" => no module matched",e),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => error no module matched");if(_.isEmpty(e.options_type))return c.errare("updateAPISetting => "+e.action+" => missing options_type"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => missing options_type");if("__no_option_group_to_be_updated_by_children_modules__"===e.options_type)t.value=s;else{var a=l.extend(!0,{},_.isEmpty(t.value)?{}:t.value);a[e.options_type]=s,t.value=a}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(m,f){f.extend(CZRSeksPrototype,{_updAPISet_sek_import_from_file:function(){var o,n=this;if(o=n.updAPISetParams.params,_.isUndefined(o.imported_content.data)||_.isUndefined(o.imported_content.metas))m.errare("updateAPISetting::sek-import-from-file => invalid imported content",imported_content);else{var i=_.isArray(o.imported_content.data.collection)?f.extend(!0,[],o.imported_content.data.collection):[];if(!0===o.assign_missing_locations){var t,e=o.imported_content.metas.active_locations,r=m.czr_sektions.activeLocations();_.each(r,function(e){n.isHeaderLocation(e)||n.isFooterLocation(e)||t.push(e)});var s=_.first(t);if(!_.isEmpty(s)&&!_.isEmpty(e)&&_.isArray(e)){var a=f(e).not(t).get(),c=n.getLevelModel(s,n.updAPISetParams.newSetValue.collection),l=n.getLevelModel(s,o.imported_content.data.collection),d=[];c.collection=_.isArray(c.collection)?c.collection:[],l.collection=_.isArray(l.collection)?l.collection:[],_.each(e,function(e){var t=n.getLevelModel(e,i);_.isEmpty(t.collection)||(d=_.union(d,t.collection))}),l.collection=d,o.imported_content.data.collection=_.filter(o.imported_content.data.collection,function(e){return!_.contains(a,e.id)})}}if(!0===o.keep_existing_sections){_.each(i,function(e){var t=n.getLevelModel(e.id,n.updAPISetParams.newSetValue.collection);if(!_.isEmpty(t.collection)){var i=n.getLevelModel(e.id,o.imported_content.data.collection);i.collection=_.union(t.collection,i.collection)}});var u=n.updAPISetParams.newSetValue.fonts,p=o.imported_content.data.fonts;u&&!_.isEmpty(u)&&_.isArray(u)&&(p=_.isArray(p)?p:[],o.imported_content.data.fonts=_.uniq(_.union(u,p)))}n.updAPISetParams.newSetValue=o.imported_content.data}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(z,w){w.extend(CZRSeksPrototype,{_updAPISet_sek_inject_tmpl_from_gallery:function(){var t,i=this;if(t=i.updAPISetParams.params,z.infoLog("api update params for sek-inject-tmpl-from-gallery",t),_.isUndefined(t.injected_content.data)||_.isUndefined(t.injected_content.metas))z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported content",injected_content);else{var o=function(e){return t.injected_content&&t.injected_content.metas&&e===t.injected_content.metas.tmpl_header_location},n=function(e){return t.injected_content&&t.injected_content.metas&&e===t.injected_content.metas.tmpl_footer_location},r=function(){var t=!1;return _.each(e,function(e){t||(o(e)||n(e))&&(t="no_match"!=(t=i.getLevelModel(e,s)))}),t&&!_.isEmpty(l.local_header_footer)},s=_.isArray(t.injected_content.data.collection)?w.extend(!0,[],t.injected_content.data.collection):[],e=t.injected_content.metas.tmpl_locations,a=[],c=i.updAPISetParams.newSetValue.collection;if(_.each(z.czr_sektions.activeLocations(),function(e){i.isGlobalLocationId(e)||a.push(e)}),_.isArray(e)&&!_.isEmpty(e)){var l=t.injected_content.data.local_options;l=w.extend(!0,{},_.isObject(l)?l:{});var d=t.injected_content.data.fonts;d=_.isArray(d)?w.extend(!0,[],d):[];var u,p,m,f,g=w.extend(!0,[],c),h=[],v="__not_set__";switch(_.each(s,function(e){o(e.id)||n(e.id)||_.isEmpty(e.collection)||(h=_.union(h,e.collection))}),t.tmpl_inject_mode){case"replace":if(f=!0,_.each(e,function(e){f&&(f=_.contains(a,e))}),f){var k,y;g=[],_.each(c,function(e){m=_.findWhere(s,{id:e.id})||{},_.isEmpty(m.collection)?i.isHeaderLocation(e.id)||i.isFooterLocation(e.id)?g.push(e):(k={collection:[],options:[]},y=w.extend(!0,{},e),y=w.extend(y,k),g.push(y)):g.push(m)})}else{if(l&&l.template&&"nimble_template"===l.template.local_template?v="loop_start":_.contains(a,"loop_start")?v="loop_start":_.each(a,function(e){i.isHeaderLocation(e)||i.isFooterLocation(e)||(v=e)}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}if("no_match"===(p=i.getLevelModel(v,g))){z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => target location id "+v);break}(p=w.extend(!0,{},p)).collection=h,g=[],r()&&_.each(e,function(e){if(o(e)||n(e)){if("no_match"===(m=i.getLevelModel(e,s)))return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id "+e+" not found in template collection");g.push(m)}}),_.each(a,function(e){v===e&&g.push(p),localLocModel=i.getLevelModel(e,c),"no_match"!==localLocModel?r()||(i.isHeaderLocation(e)||i.isFooterLocation(e))&&g.push(localLocModel):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id "+e+" not found in current setting collection")})}break;case"before":if(_.each(a,function(e){"__not_set__"==v&&("no_match"!==(u=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(u.collection)||(v=e,p=u):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}(p=w.extend(!0,{},p)).collection=_.union(h,p.collection),g=[],_.each(a,function(e){if(v===e)g.push(p);else{if("no_match"===u)return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e);g.push(i.getLevelModel(e,c))}});break;case"after":if(_.each(a.reverse(),function(e){"__not_set__"==v&&("no_match"!==(u=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(u.collection)||(v=e,p=u):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}(p=w.extend(!0,{},p)).collection=_.union(p.collection,h),g=[],_.each(a,function(e){if(v===e)g.push(p);else{if("no_match"===(u=i.getLevelModel(e,c)))return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => loc id not found"+e);g.push(u)}})}if(i.updAPISetParams.newSetValue.collection=g,!_.isEmpty(l)&&"replace"===t.tmpl_inject_mode){var b=i.updAPISetParams.newSetValue.local_options;b=w.extend(!0,{},_.isObject(b)?b:{}),i.updAPISetParams.newSetValue.local_options=_.extend(b,l)}if(_.isArray(d)&&!_.isEmpty(d))if("replace"!=t.tmpl_inject_mode){var I=i.updAPISetParams.newSetValue.fonts;I=w.extend(!0,[],_.isArray(I)?I:[]),i.updAPISetParams.newSetValue.fonts=_.uniq(_.union(d,I))}else i.updAPISetParams.newSetValue.fonts=d}else z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported template locations",t)}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(o,n){n.extend(CZRSeksPrototype,{cleanRegistered:function(t){var i=this,e=n.extend(!0,[],i.registered()||[]);o.trigger("sek-before-clean-registered"),e=_.filter(e,function(e){if("setting"!==e.what&&o[e.what].has(e.id)){if(!_.isEmpty(t)&&e.id!==t)return;_.isFunction(o[e.what](e.id).trigger)&&i.trigger("sek-ui-pre-removal",{what:e.what,id:e.id}),n.when(o[e.what](e.id).container.remove()).done(function(){o[e.what].remove(e.id),i.trigger("sek-ui-removed",{what:e.what,id:e.id})})}return"setting"===e.what}),i.registered(e)},cleanRegisteredLocalOptionSettings:function(){var t=this.getLocalSkopeOptionId(),e=n.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return e.id&&-1!==e.id.indexOf(t)&&o.has(e.id)&&o.remove(e.id),e.id&&-1===e.id.indexOf(t)}),this.registered(e)},cleanRegisteredLevelSettingsAfterHistoryNavigation:function(){var e=n.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return!_.isEmpty(e.level)&&"setting"===e.what&&o.has(e.id)&&o.remove(e.id),_.isEmpty(e.level)&&"setting"===e.what}),this.registered(e)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(u,p){p.extend(CZRSeksPrototype,{rootPanelFocus:function(){u.section.has(u.czr_activeSectionId())?u.section(u.czr_activeSectionId()).expanded(!1):u.section.each(function(e){e.expanded(!1)}),u.panel.each(function(e){e.expanded(!1)})},guid:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()},getGlobalSectionsSettingId:function(){return sektionsLocalizedData.settingIdForGlobalSections},getParentSectionFromColumnId:function(i,o){var s=this,a="no_match",c=function(i,e,o,n){if(_.isUndefined(e)){var t=u(o)(),r=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},s.getDefaultSektionSettingValue(n));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){var t;"no_match"==a&&("section"==e.level&&(t=_.findWhere(e.collection,{id:i})),_.isEmpty(t)?_.isArray(e.collection)&&c(i,e.collection,o,n):a=e)}),a};return _.isEmpty(o)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&c(i,o,e,t)}):c(i,o),a},isGlobalLocation:function(e){var t=!1;return e=e||{},_.has(e,"is_global_location")?t=e.is_global_location:_.has(e,"scope")?t="global"===e.scope:_.isEmpty(e.location)?_.isEmpty(e.in_sektion)?_.isEmpty(e.id)||(t=this.isChildOfAGlobalLocation(e.id)):t=this.isChildOfAGlobalLocation(e.in_sektion):t=this.isChildOfAGlobalLocation(e.location),t},isChildOfAGlobalLocation:function(e){var r=this,s=function(t,e){var i="no_match";if(_.isUndefined(e)){var o=u(r.getGlobalSectionsSettingId())(),n=_.isObject(o)?p.extend(!0,{},o):r.getDefaultSektionSettingValue("global");e=_.isArray(n.collection)?n.collection:[]}return _.each(e,function(e){"no_match"==i&&(t===e.id?i=e:_.isArray(e.collection)&&(i=s(t,e.collection)))}),i};return"no_match"!==s(e)},isGlobalLocationId:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_global},isHeaderLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_header},isFooterLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_footer},getLevelModel:function(i,o){var s=this,a="no_match",c=function(t,e,i,o){if(_.isUndefined(e)){var n=u(i)(),r=_.isObject(n)?p.extend(!0,{},n):p.extend(!0,{},s.getDefaultSektionSettingValue(o));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){"no_match"==a&&(t===e.id?a=e:_.isArray(e.collection)&&c(t,e.collection,i,o))}),a};return _.isEmpty(o)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&c(i,o,e,t)}):c(i,o),a},getLevelPositionInCollection:function(i,o){var s=this,a="no_match",c=function(i,e,o,n){if(_.isUndefined(e)){var t=u(o)(),r=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},s.getDefaultSektionSettingValue(n));e=_.isArray(r.collection)?r.collection:[]}_.each(e,function(e,t){"no_match"==a&&(i===e.id?a=t:_.isArray(e.collection)&&c(i,e.collection,o,n))})};return _.isEmpty(o)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&c(i,e,t,o)}):c(i,o),a},getLevelProperty:function(e){if(e=_.extend({id:"",property:""},e),_.isEmpty(e.id))u.errare("getLevelProperty => invalid id provided");else{var t=this.getLevelModel(e.id);if("no_match"!=t){if(_.isObject(t))return t[e.property];u.errare("getLevelProperty => invalid model for id : "+e.id,t)}else u.errare("getLevelProperty => no level model found for id : "+e.id)}},cloneLevel:function(e){var t=this,i=t.getLevelModel(e);if("no_match"==i)throw new Error("cloneLevel => no match for level id : "+e);var o=p.extend(!0,{},i),n=function(e){if(_.isEmpty(e.id))throw new Error("cloneLevel => missing level id");if(e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),!_.isEmpty(e.collection)){if(!_.isArray(e.collection))throw new Error("cloneLevel => the collection must be an array for level id : "+e.id);_.each(e.collection,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),n(e)})}return e};return n(o)},getDefaultItemModelFromRegisteredModuleData:function(e){if(!this.isModuleRegistered(e))return{};if(sektionsLocalizedData.registeredModules[e].is_father)return u.errare("getDefaultItemModelFromRegisteredModuleData => Father modules should be treated specifically"),{};var t=sektionsLocalizedData.registeredModules[e].tmpl["item-inputs"],i={id:"",title:""};return _.each(t,function(e,t){switch(t){case"tabs":_.each(e,function(e){_.each(e.inputs,function(e,t){i[t]=e.default||""})});break;default:i[t]=e.default||""}}),i},getRegisteredModuleProperty:function(e,t){return this.isModuleRegistered(e)?sektionsLocalizedData.registeredModules[e][t]:"not_set"},isModuleRegistered:function(e){return sektionsLocalizedData.registeredModules&&!_.isUndefined(sektionsLocalizedData.registeredModules[e])},isMultiItemsModule:function(e){return sektionsLocalizedData.registeredModules[e]&&!0===sektionsLocalizedData.registeredModules[e].is_crud},maybeGenerateNewItemIdsForCrudModules:function(t){var i=this;return(_.isArray(t)||_.isObject(t))&&_.each(t,function(e){_.isArray(t)&&_.isObject(e)&&e.id&&!_.has(e,"level")?-1===e.id.indexOf(sektionsLocalizedData.optPrefixForSektionsNotSaved)&&(e.id=i.guid()):(_.isArray(e)||_.isObject(e))&&i.maybeGenerateNewItemIdsForCrudModules(e)}),t},sniffGFonts:function(e){var n=this,r=[],s=function(i,o,e){if(_.isUndefined(e)){var t=u(i)();e=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},n.getDefaultSektionSettingValue(o))}_.each(e,function(e,t){_.isString(t)&&"_css"===t.substr(t.length-4)&&!0===n.inputIsAFontFamilyModifier(t)&&-1<e.indexOf("gfont")&&!_.contains(r,e)&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,o,e)})};return(e=e||{is_global_location:!1}).is_global_location?s(n.getGlobalSectionsSettingId(),"global"):s(n.localSectionsSettingId(),"local"),r},sniffAllFonts:function(){var n=this,r=[],s=function(i,o,e){if(_.isUndefined(e)){var t=u(i)();e=_.isObject(t)?p.extend(!0,{},t):p.extend(!0,{},n.getDefaultSektionSettingValue(o))}_.each(e,function(e,t){_.isString(t)&&_.isString(e)&&(-1<e.indexOf("[gfont]")||-1<e.indexOf("[cfont]"))&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,o,e)})};return _.each([{id:n.localSectionsSettingId(),scope:"local"},{id:n.getGlobalSectionsSettingId(),scope:"global"},{id:sektionsLocalizedData.optNameForGlobalOptions,scope:"global"}],function(e){s(e.id,e.scope)}),r},getInputDefaultValue:function(i,o,e){var n=this;if(n.cachedDefaultInputValues=n.cachedDefaultInputValues||{},n.cachedDefaultInputValues[o]=n.cachedDefaultInputValues[o]||{},_.has(n.cachedDefaultInputValues[o],i))return n.cachedDefaultInputValues[o][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))u.errare("getInputDefaultValue => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[o]))u.errare("getInputDefaultValue => missing "+o+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[o].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[o].tmpl);var r="no_default_value_specified";return _.each(e,function(e,t){"no_default_value_specified"===r&&(i!==t||_.isUndefined(e.default)||(r=e.default),"no_default_value_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=n.getInputDefaultValue(i,o,e)),"no_default_value_specified"!==r&&(n.cachedDefaultInputValues[o][i]=r))}),r}u.errare("getInputDefaultValue => Father modules should be treated specifically")}},getInputType:function(i,o,e){var n=this;if(n.cachedInputTypes=n.cachedInputTypes||{},n.cachedInputTypes[o]=n.cachedInputTypes[o]||{},_.has(n.cachedInputTypes[o],i))return n.cachedInputTypes[o][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))u.errare("getInputType => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[o]))u.errare("getInputType => missing "+o+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[o].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[o].tmpl);var r="no_input_type_specified";return _.each(e,function(e,t){"no_input_type_specified"===r&&(i!==t||_.isUndefined(e.input_type)||(r=e.input_type),"no_input_type_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=n.getInputType(i,o,e)),"no_input_type_specified"!==r&&(n.cachedInputTypes[o][i]=r))}),r}u.errare("getInputType => Father modules should be treated specifically")}},getInputRegistrationParams:function(i,o,e){var n=this;if(n.cachedInputRegistrationParams=n.cachedInputRegistrationParams||{},n.cachedInputRegistrationParams[o]=n.cachedInputRegistrationParams[o]||{},_.has(n.cachedInputRegistrationParams[o],i))return n.cachedInputRegistrationParams[o][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))u.errare("getInputRegistrationParams => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[o]))u.errare("getInputRegistrationParams => missing "+o+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[o].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[o].tmpl);var r={};return _.each(e,function(e,t){_.isEmpty(r)&&(i!==t||_.isUndefined(e.input_type)||(r=e),_.isEmpty(r)&&(_.isArray(e)||_.isObject(e))&&(r=n.getInputRegistrationParams(i,o,e)),_.isEmpty(r)||(n.cachedInputRegistrationParams[o][i]=r))}),r}u.errare("getInputRegistrationParams => Father modules should be treated specifically")}},inputIsAFontFamilyModifier:function(i,e){var o=this;if(o.cachedFontFamilyModifier=o.cachedFontFamilyModifier||{},_.has(o.cachedFontFamilyModifier,i))return o.cachedFontFamilyModifier[i];if(!_.isUndefined(sektionsLocalizedData.registeredModules)){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules);var n="not_set";return _.each(e,function(e,t){"not_set"===n&&(i!==t||_.isUndefined(e.input_type)||(n=!_.isUndefined(e.refresh_fonts)&&e.refresh_fonts),"not_set"===n&&(_.isArray(e)||_.isObject(e))&&(n=o.inputIsAFontFamilyModifier(i,e)),"not_set"!==n&&(o.cachedFontFamilyModifier[i]=n))}),n}u.errare("inputIsAFontFamilyModifier => missing sektionsLocalizedData.registeredModules")},getModuleStartingValue:function(e){var a=this;if(!sektionsLocalizedData.registeredModules)return u.errare("getModuleStartingValue => missing sektionsLocalizedData.registeredModules"),"no_starting_value";if(_.isUndefined(sektionsLocalizedData.registeredModules[e]))return u.errare("getModuleStartingValue => the module type "+e+" is not registered"),"no_starting_value";var t,i,o,c=function(e){return readyStartValues=[],_.each(e,function(e){if(_.isObject(e)){var t=p.extend(!0,{},e);t.id=u.czr_sektions.guid(),readyStartValues.push(t)}else u.errare("getModuleStartingValue => multi-item module => items should be objects for module "+mod_type)}),readyStartValues},l={},d=(t=e,sektionsLocalizedData.registeredModules[t]&&sektionsLocalizedData.registeredModules[t].starting_value?sektionsLocalizedData.registeredModules[t].starting_value:{});return o=e,sektionsLocalizedData.registeredModules[o]&&!0===sektionsLocalizedData.registeredModules[o].is_father?_.each((i=e,sektionsLocalizedData.registeredModules[i]&&sektionsLocalizedData.registeredModules[i].children?sektionsLocalizedData.registeredModules[i].children:{}),function(e,t){var i,o,n,r,s=(i=e,r=(n=d)[o=t]?n[o]:{},a.isMultiItemsModule(i)&&_.isArray(r)?c(r):r);_.isEmpty(s)||(l[t]=s)}):l=a.isMultiItemsModule(e)&&_.isArray(d)?c(d):d,_.isEmpty(l)?"no_starting_value":l},selectNextTabbableOrFocusable:function(e){var t=p(e),i=p(":focus"),o=0;if(1===i.length){var n=t.index(i);n+1<t.length&&(o=n+1)}t.eq(o).focus()},selectPrevTabbableOrFocusable:function(e){var t=p(e),i=p(":focus"),o=t.length-1;if(1===i.length){var n=t.index(i);0<n&&(o=n-1)}t.eq(o).focus()},setupSelectInput:function(e){var o=this,t=(o.input_parent,o.module,u.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type)),i={params:e=_.isEmpty(e)?t.choices:e};if(o.module.trigger("nimble-set-select-input-options",i),e=i.params,!_.isEmpty(e)&&_.isObject(e))switch(o.type){case"simpleselect":_.each(e,function(e,t){var i={value:t,html:e};t==o()?p.extend(i,{selected:"selected"}):"px"===t&&p.extend(i,{selected:"selected"}),p("select[data-czrtype]",o.container).append(p("<option>",i))}),p("select[data-czrtype]",o.container).selecter();break;case"multiselect":var n=o();n=_.isString(n)?[n]:n,n=_.isArray(n)?n:[],_.each(e,function(e,t){var i={value:t,html:e};_.contains(n,t)&&p.extend(i,{selected:"selected"}),p("select[data-czrtype]",o.container).append(p("<option>",i))}),p("select[data-czrtype]",o.container).czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),p("select[data-czrtype]",o.container).on("change",function(){0===p(this).find("option:selected").length&&o([])});break;default:u.errare("::setupSelectInput => invalid input type => "+o.type)}else u.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+o.id+" in module "+o.module.module_type)},maybeSetupDeviceSwitcherForInput:function(){var o=this;if(!o.previewedDevice){var e=['<span class="sek-input-device-switcher">','<i data-sek-device="desktop" class="sek-switcher preview-desktop active" title="'+sektionsLocalizedData.i18n["Settings on desktops"]+'"></i>','<i data-sek-device="tablet" class="sek-switcher preview-tablet" title="'+sektionsLocalizedData.i18n["Settings on tablets"]+'"></i>','<i data-sek-device="mobile" class="sek-switcher preview-mobile" title="'+sektionsLocalizedData.i18n["Settings on mobiles"]+'"></i>',"</span>"].join(" ");o.container.find(".customize-control-title").first().prepend(e),o.previewedDevice=new u.Value(u.previewedDevice()),syncWithPreviewedDevice=function(e){e.stopPropagation(),o.container.find("[data-sek-device]").removeClass("active"),p(this).addClass("active");var t,i="desktop";try{i=p(this).data("sek-device")}catch(e){u.errare("maybeSetupDeviceSwitcherForInput => error when binding sek-switcher",e)}try{u.previewedDevice(i)}catch(e){u.errare("maybeSetupDeviceSwitcherForInput => error when setting the previewed device",e)}o.previewedDevice(i),_.isUndefined(e.isTrigger)&&o.module&&o.module.control&&o.module.control.params.section&&(t=o.module.control.params.section,_.delay(function(){u.previewer.send("sek-animate-to-level",{id:t})},600))},o.container.on("click","[data-sek-device]",syncWithPreviewedDevice);var t=o.container.find('[data-sek-device="'+u.previewedDevice()+'"]');0<t.length&&t.trigger("click")}},scheduleModuleAccordion:function(e){e=e||{expand_first_control:!0};var i=this;if(!0!==i.container.data("sek-module-accordion-has-been-setup")&&(p(i.container).on("click",".customize-control label > .customize-control-title",function(e){e.stopPropagation();var t=p(this).closest(".customize-control");"no"!==t.attr("data-sek-accordion")&&(i.container.find(".customize-control").not(t).each(function(){p(this).attr("data-sek-accordion")||p(this).attr("data-sek-expanded","false")}),t.attr("data-sek-expanded","false"==t.attr("data-sek-expanded")?"true":"false"),t.trigger("true"==t.attr("data-sek-expanded")?"sek-accordion-expanded":"sek-accordion-collapsed"),!0===t.data("module_ready_on_custom_control_event_is_setup")?t.trigger("sek-accordion-expanded"):t.one("module_ready_on_custom_control_event_is_setup",function(){t.trigger("sek-accordion-expanded")}))}),i.container.data("sek-module-accordion-has-been-setup",!0),e.expand_first_control)){var t=_.filter(i.controls(),function(e){return!e.params||!e.params.sek_registration_params||!1!==e.params.sek_registration_params.has_accordion}),o=_.first(t);_.isObject(o)&&!_.isEmpty(o.id)&&u.control(o.id,function(e){e.container.one("items-collection-populated",function(){p(this).find("label > .customize-control-title").trigger("click")}),!0===e.container.data("module_ready_on_custom_control_event_is_setup")?e.container.trigger("sek-accordion-expanded"):e.container.one("module_ready_on_custom_control_event_is_setup",function(){e.container.trigger("sek-accordion-expanded")})})}},isPromise:function(e){return e&&"function"==typeof e.then&&String(p.Deferred().then)===String(e.then)},whenAllPromisesInParallel:function(e){var i=this,t=p.Deferred(),o=[],n=_.keys(e);return _.each(e,function(e,t){o.push(p.Deferred(function(t){(i.isPromise(e)?e:p.Deferred()).done(t.resolve).fail(function(e){t.reject(e)})}))}),p.when.apply(this,o).done(function(){var i={},e=Array.prototype.slice.call(arguments);_.each(e,function(e,t){i[n[t]]=e}),t.resolve(i)}).fail(t.reject),t},whenAllPromisesInSerie:function(t,i,o,n){i=i||0,o=o||{},n=n||p.Deferred();var r=this;if(_.isArray(t)){var e=t[i];(r.isPromise(e)?e:p.Deferred(function(e){e.resolve()})).always(function(e){o[i]=e,i+1==t.length?n.resolve(o):i+1<t.length&&r.whenAllPromisesInSerie(t,i+1,o,n)})}return n},importAttachment:function(t){return wp.ajax.post("sek_import_attachment",{img_url:t,nonce:u.settings.nonce.save}).fail(function(e){u.errare("sek_import_attachment ajax action failed for image "+t,e)})},cleanIds:function(e){e.id="";var t=this;return _.each(e.collection,function(e){e.id="",_.isArray(e.collection)&&t.cleanIds(e)}),e},getDefaultSektionSettingValue:function(e){return!_.isUndefined(e)&&_.contains(["local","global"],e)||u.errare("getDefaultSektionSettingValue => the skope should be set to local or global"),"global"===e?sektionsLocalizedData.defaultGlobalSektionSettingValue:sektionsLocalizedData.defaultLocalSektionSettingValue},scheduleVisibilityOfInputId:function(t,i){var o=this.input_parent;if(!_.isFunction(i)||_.isEmpty(t))throw new Error("::scheduleVisibilityOfInputId => error when firing for input id : "+this.id);if(!o.czr_Input.has(t))throw new Error("::scheduleVisibilityOfInputId => missing input id : "+t);o.czr_Input(t).visible(i()),this.bind(function(e){o.czr_Input(t).visible(i())})},hasCurrentPageNBSectionsNotHeaderFooter:function(){var e,t=this,i=!1,o=this.localSectionsSettingId(),n=u(o)();this.activeLocationsInfo();return n=_.isObject(n)?n:{},e=p.extend(!0,{},n),e=_.isEmpty(e.collection)?[]:e.collection,e=_.isArray(e)?e:[],_.each(e,function(e){i||_.isObject(e)&&"location"==e.level&&e.collection&&(t.isHeaderLocation(e.id)||t.isFooterLocation(e.id)||(i=!_.isEmpty(e.collection)))}),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,m){m.extend(CZRSeksPrototype,{setupDnd:function(){var t=this;t.bind("sek-refresh-dragzones",function(e){!0!="draggable"in document.createElement("span")&&c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){c.notifications.remove("drag-drop-support")},1e4)}),t.setupNimbleDragZones(e.input_container)}),c.previewer.bind("ready",function(){try{t.setupNimbleDropZones()}catch(e){c.errare("::setupDnd => error on self.setupNimbleDropZones()",e)}_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_intro_sec_picker_module"}))&&_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_module_picker_module"}))||t.rootPanelFocus()}),t.reactToDrop()},setupNimbleDragZones:function(e){var o=this,n=function(){c.notifications.add(new c.Notification("missing-injection-target",{type:"info",message:sektionsLocalizedData.i18n["You first need to click on a target ( with a + icon ) in the preview."],dismissible:!0})),_.delay(function(){c.notifications.remove("missing-injection-target")},3e4)};e.find('[draggable="true"]').each(function(){m(this).on("dragstart",function(e){(function(e){o.lastClickedTargetInPreview({}),e.originalEvent.dataTransfer.setData("sek-content-type",m(this).data("sek-content-type")),e.originalEvent.dataTransfer.setData("sek-eligible-for-module-dropzones",m(this).data("sek-eligible-for-module-dropzones")),e.originalEvent.dataTransfer.setData("sek-content-id",m(this).data("sek-content-id")),e.originalEvent.dataTransfer.setData("sek-section-type",m(this).data("sek-section-type")),e.originalEvent.dataTransfer.setData("sek-is-user-section",m(this).data("sek-is-user-section")),o.dndData={content_type:e.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===e.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:e.originalEvent.dataTransfer.getData("sek-content-id"),section_type:e.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===e.originalEvent.dataTransfer.getData("sek-is-user-section")};try{e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.clearData("browserSupport")}catch(e){c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){c.notifications.remove("drag-drop-support")},1e4)})}m(this).addClass("sek-dragged"),o.cachedElements.$body.addClass("sek-dragging"),c.previewer.send("sek-drag-start",{content_type:o.dndData.content_type,eligible_for_module_dropzones:o.dndData.eligible_for_module_dropzones})}).call(m(this),e)}).on("dragend",function(e){(function(e){o.cachedElements.$body.removeClass("sek-dragging"),m(this).removeClass("sek-dragged"),c.previewer.send("sek-drag-stop")}).call(m(this),e)}).on("dblclick",function(e){(function(e){var t,i=o.lastClickedTargetInPreview();!_.isEmpty(i)&&i.id?t=o.dnd_getDropZonesElements().find('[data-sek-id="'+i.id+'"]').find(".sek-module-drop-zone-for-first-module").first():n(),t&&0<t.length?(c.czr_sektions.trigger("sek-content-dropped",{drop_target_element:t,location:t.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:t.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:t.data("drop-zone-after-module-or-nested-section"),before_section:t.data("drop-zone-before-section"),after_section:t.data("drop-zone-after-section"),content_type:m(this).attr("data-sek-content-type"),content_id:m(this).attr("data-sek-content-id"),section_type:m(this).attr("data-sek-section-type"),is_user_section:"true"===m(this).attr("data-sek-is-user-section")}),o.lastClickedTargetInPreview({})):(n(),c.errare("Double click insertion => the target zone was not found"))}).call(m(this),e)})})},setupNimbleDropZones:function(){var t=this;if(this.$dropZones=this.dnd_getDropZonesElements(),this.preDropElement=m("<div>",{class:sektionsLocalizedData.preDropElementClass,html:""}),this.$dropZones.length<1)throw new Error("::setupNimbleDropZones => invalid Dom element");this.$dropZones.each(function(){var e=m(this);!0!==e.data("zone-droppable-setup")&&(t.enterOverTimer=null,e.on("dragenter dragover",sektionsLocalizedData.dropSelectors,function(e){_.isNull(t.enterOverTimer)&&(t.enterOverTimer=!0,_.delay(function(){t.currentMousePosition&&t.currentMousePosition+""==e.clientY+""+e.clientX?t.enterOverTimer=null:(t.currentMousePosition=e.clientY+""+e.clientX,t.dnd_toggleDragApproachClassesToDropZones(e))},100)),t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.stopPropagation(),t.dnd_OnEnterOver(m(this),e))}).on("dragleave drop",sektionsLocalizedData.dropSelectors,function(e){switch(e.type){case"dragleave":t.dnd_isOveringDropTarget(m(this),e)||t.dnd_cleanOnLeaveDrop(m(this),e);break;case"drop":this.$cachedDropZoneCandidates=null,t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.preventDefault(),t.dnd_onDrop(m(this),e),t.dnd_cleanOnLeaveDrop(m(this),e),c.previewer.send("sek-drag-stop"))}}).data("zone-droppable-setup",!0))})},dnd_isInTarget:function(e,t){var i=t.clientY,o=t.clientX,n=e[0].getBoundingClientRect(),r=o<=n.right&&n.left<=o;return i>=n.top&&n.bottom>=i&&r},dnd_toggleDragApproachClassesToDropZones:function(u){var p=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.$cachedDropZoneCandidates=_.isEmpty(this.$cachedDropZoneCandidates)?this.$dropZones.find(".sek-drop-zone"):this.$cachedDropZoneCandidates,this.distanceTable=[],this.$dropZones.find(".sek-drop-zone").each(function(){var e,t,i=u.clientY,o=u.clientX,n=m(this)[0].getBoundingClientRect(),r=Math.abs(i-(n.bottom-(n.bottom-n.top)/2)),s=(Math.abs(n.top-i),Math.abs(o-(n.right-(n.right-n.left)/2))),a=(n.right,n.left,r<50),c=s<50,l=o<=n.right&&n.left<=o,d=i>=n.top&&n.bottom>=i;p.distanceTable.push({el:m(this),dist:d&&l?0:(e=s,t=r,Math.sqrt(e*e+t*t))}),m(this).removeClass("sek-drag-is-in"),(a||d)&&(c||l)?(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).addClass("sek-drag-is-very-close")):(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).removeClass("sek-drag-is-very-close")),m(this).removeClass("sek-drag-is-in")});var t=_.min(_.pluck(p.distanceTable,"dist"));p.$dropTargetCandidate=null,_.each(p.distanceTable,function(e){_.isNull(p.$dropTargetCandidate)&&t===e.dist&&(p.$dropTargetCandidate=e.el)}),p.$dropTargetCandidate&&0<p.$dropTargetCandidate.length&&p.dnd_isInTarget(p.$dropTargetCandidate,u)&&p.$dropTargetCandidate.addClass("sek-drag-is-in"),p.enterOverTimer=null},dnd_getPreDropElementContent:function(e){var t,i,o=m(e.currentTarget);switch(this.dndData.content_type){case"module":t=sektionsLocalizedData.i18n["Insert here"],0<o.length&&("between-sections"!==o.data("sek-location")&&"in-empty-location"!==o.data("sek-location")||(t=sektionsLocalizedData.i18n["Insert in a new section"])),i='<div class="sek-module-placeholder-content"><p>'+t+"</p></div>";break;case"preset_section":i='<div class="sek-module-placeholder-content"><p>'+(t=sektionsLocalizedData.i18n["Insert a new section here"])+"</p></div>";break;default:c.errare("::dnd_getPreDropElementContent => invalid content type provided")}return i},dnd_getDropZonesElements:function(){return m(c.previewer.targetWindow().document)},dnd_canDrop:function(e){var t=this,i=(e=_.extend({targetEl:{},evt:{}},e||{})).targetEl;if(!_.isObject(i)||i.length<1)return!1;if(i.closest('[data-sek-level="location"]').length<1)return!1;var o=i.hasClass("sek-content-preset_section-drop-zone"),n=i.hasClass("sek-module-drop-zone-for-first-module"),r=!0===i.closest('[data-sek-level="location"]').data("sek-is-header-location"),s=!0===i.closest('[data-sek-level="location"]').data("sek-is-footer-location"),a="preset_section"===t.dndData.content_type&&"content"===t.dndData.section_type,c=function(e){m(".sek-no-drop-possible-message",i).length<1&&i.append(['<div class="sek-no-drop-possible-message">','<i class="material-icons">not_interested</i>',e,"</div>"].join(""))};return!!i.hasClass("sek-drop-zone")&&(!t.dndData.is_user_section&&(r||s)&&a?(c(r?sektionsLocalizedData.i18n["Header location only accepts modules and pre-built header sections"]:sektionsLocalizedData.i18n["Footer location only accepts modules and pre-built footer sections"]),!1):s&&"preset_section"===t.dndData.content_type&&"header"===t.dndData.section_type?(c(sektionsLocalizedData.i18n["You can't drop a header section in the footer location"]),!1):r&&"preset_section"===t.dndData.content_type&&"footer"===t.dndData.section_type?(c(sektionsLocalizedData.i18n["You can't drop a footer section in the header location"]),!1):"preset_section"===t.dndData.content_type&&!0===t.dndData.eligible_for_module_dropzones&&!o||("preset_section"===t.dndData.content_type&&o||"module"===t.dndData.content_type&&!o||"preset_section"===t.dndData.content_type&&n))},dnd_OnEnterOver:function(e,t){t.preventDefault(),!0!==e.data("is-drag-entered")&&(e.data("is-drag-entered",!0),e.addClass("sek-active-drop-zone"),this.$dropZones.addClass("sek-is-dragging"));try{this.dnd_mayBePrintPreDropElement(e,t)}catch(e){c.errare("Error when trying to insert the preDrop content",e)}},dnd_cleanOnLeaveDrop:function(e,t){var i=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.preDropElement.remove(),this.$dropZones.removeClass("sek-is-dragging"),m(sektionsLocalizedData.dropSelectors,this.$dropZones).each(function(){i.dnd_cleanSingleDropTarget(m(this))})},dnd_cleanSingleDropTarget:function(e){_.isEmpty(e)||e.length<1||(e.data("is-drag-entered",!1),e.data("preDrop-position",!1),e.removeClass("sek-active-drop-zone"),e.find(".sek-drop-zone").removeClass("sek-drag-is-close"),e.find(".sek-drop-zone").removeClass("sek-drag-is-approaching"),e.removeClass("sek-feed-me-seymore"),e.find(".sek-no-drop-possible-message").remove())},dnd_getPosition:function(e,t){var i=e[0].getBoundingClientRect(),o=i.height;return"before"===e.data("preDrop-position")?o+=this.preDropElement.outerHeight():"after"===e.data("preDrop-position")&&(o-=this.preDropElement.outerHeight()),0<t.originalEvent.clientY-i.top-o/2?"after":"before"},dnd_mayBePrintPreDropElement:function(e,t){var i=this,o=e.data("preDrop-position"),n=this.dnd_getPosition(e,t);if(o!==n&&!0!==i.isPrintingPreDrop){i.isPrintingPreDrop=!0,this.dnd_cleanSingleDropTarget(this.$currentPreDropTarget);var r="between-sections"===e.data("sek-location")||"in-empty-location"===e.data("sek-location");m.when(i.preDropElement.remove()).done(function(){e["before"===n?"prepend":"append"](i.preDropElement).find("."+sektionsLocalizedData.preDropElementClass).html(i.dnd_getPreDropElementContent(t)),e.find("."+sektionsLocalizedData.preDropElementClass).toggleClass("in-new-sektion",r),e.data("preDrop-position",n),e.addClass("sek-feed-me-seymore"),i.isPrintingPreDrop=!1,i.$currentPreDropTarget=e})}},dnd_isOveringDropTarget:function(e,t){var i=e[0].getBoundingClientRect(),o=t.clientX,n=t.clientY,r=i.left,s=i.right,a=i.top,c=i.bottom;return r<=o&&o-r<=s-r&&(a<=n&&n-a<=c-a)},dnd_onDrop:function(e,t){t.stopPropagation();this.dnd_getPosition(e,t),e.index();c.czr_sektions.trigger("sek-content-dropped",{drop_target_element:e,location:e.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:e.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:e.data("drop-zone-after-module-or-nested-section"),before_section:e.data("drop-zone-before-section"),after_section:e.data("drop-zone-after-section"),content_type:t.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===t.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:t.originalEvent.dataTransfer.getData("sek-content-id"),section_type:t.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===t.originalEvent.dataTransfer.getData("sek-is-user-section")})},reactToDrop:function(){this.bind("sek-content-dropped",function(e){try{!function(e){if(!_.isObject(e))throw new Error("Invalid params provided");if(e.drop_target_element.length<1)throw new Error("Invalid drop_target_element");var t,i=e.drop_target_element,o="content-in-column";switch(i.data("sek-location")){case"between-sections":o="content-in-a-section-to-create";break;case"in-empty-location":e.is_first_section=!0,e.send_to_preview=!1,o="content-in-empty-location";break;case"between-columns":o="content-in-new-column"}"preset_section"===e.content_type&&(i.hasClass("sek-module-drop-zone-for-first-module")?1<(t=i.closest('div[data-sek-level="section"]')).find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length?(o="preset-section-in-a-nested-section-to-create",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),e.in_sektion=t.data("sek-id")):(e.sektion_to_replace=t.data("sek-id"),e.after_section=e.sektion_to_replace,e.in_column=t.closest('[data-sek-level="column"]').data("sek-id"),o="content-in-a-section-to-replace"):("between-sections"===i.data("sek-location")&&(o="content-in-a-section-to-create"),"between-modules-and-nested-sections"===i.data("sek-location")&&e.eligible_for_module_dropzones&&(o="preset-section-eligible-for-module-dropzones-in-new-nested-sektion",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),t=i.closest('div[data-sek-level="section"]'),e.in_sektion=t.data("sek-id"))));switch(o){case"content-in-column":var n=i.closest("div[data-sek-level]");if(n.length<1)throw new Error("No valid level dom element found");var r=n.data("sek-level"),s=n.data("sek-id");if(_.isEmpty(r)||_.isEmpty(s))throw new Error("No valid level id found");c.previewer.trigger("sek-add-module",{level:r,id:s,in_column:i.closest('div[data-sek-level="column"]').data("sek-id"),in_sektion:i.closest('div[data-sek-level="section"]').data("sek-id"),before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section,content_type:e.content_type,content_id:e.content_id});break;case"content-in-a-section-to-create":case"content-in-a-section-to-replace":case"content-in-empty-location":c.previewer.trigger("sek-add-content-in-new-sektion",e);break;case"preset-section-in-a-nested-section-to-create":c.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",e);break;case"preset-section-eligible-for-module-dropzones-in-new-nested-sektion":var a=m.extend(!0,{},e);a=m.extend(a,{before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section}),c.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",a);break;default:c.errare("sek control panel => ::reactToDrop => invalid drop case : "+o)}}(e)}catch(e){c.errare("error when reactToDrop",e)}})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{setupTinyMceEditor:function(){var o=this;l.sekEditorExpanded=new l.Value(!1),o.editorEventsListenerSetup=!1,o.$editorPane=d("#czr-customize-content_editor-pane"),o.$editorDragbar=d("#czr-customize-content_editor-dragbar"),o.$preview=d("#customize-preview"),o.$collapseSidebar=d(".collapse-sidebar"),o.attachResizeEventsToEditor();d("#customize-theme-controls").on("click",'[data-czr-action="open-tinymce-editor"]',function(){var e=d(this).data("czr-control-id"),t=d(this).data("czr-input-id");_.isEmpty(e)||_.isEmpty(t)?l.errare("toggle-tinymce-editor => missing input or control id"):l.sekEditorExpanded(!0)}),l.sekEditorExpanded.bind(function(e,t,i){!function(){l.sekTinyMceEditor=tinyMCE.get(sektionsLocalizedData.idOfDetachedTinyMceTextArea);var e=function(){!1===o.editorEventsListenerSetup&&(o.editorEventsListenerSetup=!0,o.trigger("sek-tiny-mce-editor-bound-and-instantiated"))};l.sekTinyMceEditor&&(l.sekTinyMceEditor.initialized?e():l.sekTinyMceEditor.on("init",function(){e()}))}(),e&&l.sekTinyMceEditor&&l.sekTinyMceEditor.focus(),d(document.body).toggleClass("czr-customize-content_editor-pane-open",e),o.cachedElements.$window[e?"on":"off"]("resize",function(){l.sekEditorExpanded()&&_.delay(function(){o.czrResizeEditor(window.innerHeight-o.$editorPane.height())},50)}),e?(o.czrResizeEditor(window.innerHeight-o.$editorPane.height()),_.delay(function(){o.cachedElements.$window.trigger("resize")},100)):(o.$preview.css("bottom",""),o.$collapseSidebar.css("bottom",""))}),d("#czr-customize-content_editor-pane").on("click",'[data-czr-action="close-tinymce-editor"]',function(){l.sekEditorExpanded(!1)}),d("#customize-controls").on("click",function(e){"open-tinymce-editor"!=d(e.target).data("czr-action")&&l.sekEditorExpanded(!1,{context:"clicked anywhere"})}),d(document).on("keydown",_.throttle(function(e){27===e.keyCode&&l.sekEditorExpanded(!1)},50)),o.bind("sek-tiny-mce-editor-bound-and-instantiated",function(){var e=d(l.sekTinyMceEditor.iframeElement).contents().get(0);d(e).on("keydown",_.throttle(function(e){27===e.keyCode&&l.sekEditorExpanded(!1)},50))}),_.each(["sek-click-on-inactive-zone","sek-add-section","sek-add-column","sek-add-module","sek-remove","sek-move","sek-duplicate","sek-resize-columns","sek-add-content-in-new-sektion","sek-pick-content","sek-edit-options","sek-edit-module","sek-notify"],function(e){"sek-edit-module"!=e?l.previewer.bind(e,function(){l.sekEditorExpanded(!1)}):l.previewer.bind(e,function(e){l.sekEditorExpanded("czr_tiny_mce_editor_module"===e.module_type)})})},attachResizeEventsToEditor:function(){var t=this;d("#czr-customize-content_editor-pane").on("mousedown mouseup",function(e){if(("mousedown"!==e.type||"czr-customize-content_editor-dragbar"===d(e.target).attr("id")||d(e.target).hasClass("czr-resize-handle"))&&l.sekEditorExpanded())switch(e.type){case"mousedown":d(document).on("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea,function(e){e.preventDefault(),d(document.body).addClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","none"),t.czrResizeEditor(e.pageY)});break;case"mouseup":d(document).off("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea),d(document.body).removeClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","")}})},czrResizeEditor:function(e){var t,i=this,o=window.innerHeight,n=(window.innerWidth,{}),r=d("#czr-customize-content_editor_ifr"),s=d("#wp-czr-customize-content_editor-tools"),a=i.$editorPane.find(".mce-toolbar-grp"),c=i.$editorPane.find(".mce-statusbar");l.sekEditorExpanded()&&(_.isNaN(e)||(t=o-e),n.height=t,n.components=s.outerHeight()+a.outerHeight()+c.outerHeight(),t<40&&(n.height=40),o-1<t&&(n.height=o-1),o<i.$editorPane.outerHeight()&&(n.height=o),i.$preview.css("bottom",n.height),i.$editorPane.css("height",n.height),r.css("height",n.height-n.components))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,a){a.extend(CZRSeksPrototype,{export_template:function(e){e=e||{},e=a.extend({scope:"local"},e);var i=[],t={sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()};_.each(t,function(e,t){i.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),wp.ajax.post("sek_pre_export_checks",{nonce:d.settings.nonce.save,sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()}).done(function(){a(window).off("beforeunload"),window.location.href=[sektionsLocalizedData.customizerURL,"?",i.join("&")].join(""),a(window).on("beforeunload")}).fail(function(e){d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Export failed"],encodeURIComponent(e)].join(" "),"</strong>","</span>"].join("")})})},import_template_from_file:function(i){i=i||{};var e,t,o=(i=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},i)).input;if(_.isEmpty(o))throw new Error("::import_template => missing file_input param");if(_.isEmpty(i.file_input))throw new Error("::import_template => missing file_input param");if(i.file_input.length<1||_.isUndefined(i.file_input[0])||!i.file_input[0].files||_.isEmpty(i.file_input.val()))d.previewer.trigger("sek-notify",{notif_id:"missing-import-file",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Missing file"],"</strong>","</span>"].join("")});else{t=d.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type).scope,o.container.find(".sek-uploading").show(),d.notifications.remove("missing-import-file"),d.notifications.remove("import-success"),d.notifications.remove("import-failed"),d.notifications.remove("img-import-errors");var n=new FormData;if(n.append("file_candidate",i.file_input[0].files[0]),n.append("action","sek_get_manually_imported_file_content"),n.append("nonce",d.settings.nonce.save),_.contains(["local","global"],t)){if(n.append("skope",t),i.pre_import_check&&n.append("pre_import_check",i.pre_import_check),n.append("import_img",o.input_parent.czr_Input("import_img")()),o.container.find(".sek-uploading").show(),e=a.ajax({url:wp.ajax.settings.url,data:n,processData:!1,contentType:!1,type:"POST"}),i.pre_import_check)return a.Deferred(function(){var t=this;e.done(function(e){e.success||t.reject(e),d.czr_sektions.isImportedContentEligibleForAPI(e,i)||t.reject(e),t.resolve(e)}).fail(function(e){t.reject(e)})});d.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),_.delay(function(){"pending"===e.state()&&d.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>",sektionsLocalizedData.i18n['Import exceeds server response time, try to uncheck "import images" option.'],"</strong>","</span>"].join("")})},3e4),e.done(function(e){d.czr_sektions.isImportedContentEligibleForAPI(e,i)?(e.data.data.collection=d.czr_sektions.setIdsForImportedTmpl(e.data.data.collection),d.czr_sektions.doUpdateApiSettingAfter_FileImport(e,i)):d.infoLog("::import_template problem => !api.czr_sektions.isImportedContentEligibleForAPI",e,i)}).fail(function(e){d.errare("::import_template => ajax error",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Import failed, file problem"],"</strong>","</span>"].join("")})}).always(function(){d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(i)})}else d.errare("::import_template => invalid scope provided",t)}},pre_checks_from_file_import:function(e,t){if(t=t||{},(t=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},t)).is_file_import&&_.isEmpty(t.input))throw new Error("::pre_checks_from_file_import => missing file_input param");var i=d.czr_sektions.activeLocations(),o=a.extend(!0,[],_.isArray(e.data.metas.active_locations)?e.data.metas.active_locations:[]),n=t.input,r=d.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type);if(o=_.filter(o,function(e){return!_.contains(["nimble_local_header","nimble_local_footer"],e)}),_.isArray(o)&&_.isArray(i)){var s=a(o).not(i).get();_.isEmpty(s)?d.czr_sektions.import_template_from_file(t):(t.is_file_import&&(n.container.find('button[data-czr-action="sek-pre-import"]').hide(),"local"===r.scope?n.container.find(".czr-import-dialog.czr-local-import").slideToggle():n.container.find(".czr-import-dialog.czr-global-import").slideToggle()),d.infoLog("sek-pre-import => imported locations missing in current page.",s))}else d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Import failed"],"</strong>","</span>"].join("")}),t.is_file_import&&d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},setIdsForImportedTmpl:function(i){var o=this;return(_.isObject(i)||_.isArray(i))&&_.each(i,function(e,t){(_.isObject(e)||_.isArray(e))&&(i[t]=o.setIdsForImportedTmpl(e)),"id"!==t||!_.isString(e)||0!==e.indexOf("__rep__me__")&&0!==e.indexOf("__nimble__")||(i[t]=sektionsLocalizedData.optPrefixForSektionsNotSaved+d.czr_sektions.guid())}),i},isImportedContentEligibleForAPI:function(e,t){var i=!0,o=e.data,n=null;e.success||(n=[sektionsLocalizedData.i18n["Import failed"],o].join(" : ")),_.isNull(n)&&!_.isObject(o)&&(n=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var r=o.data,s=o.metas,a=o.img_errors;_.isNull(n)&&!_.isObject(r)&&(n=sektionsLocalizedData.i18n["Import failed, invalid file content"]),_.isNull(n)&&!_.isObject(s)&&(n=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var c=d.czr_sektions.localSectionsSettingId();if(t.is_file_import){var l=t.input;c="local"===d.czr_sektions.getInputRegistrationParams(l.id,l.module.module_type).scope?c:d.czr_sektions.getGlobalSectionsSettingId()}return _.isNull(n)&&_.isEqual(d(c)(),r)&&(d.infoLog("::isImportedContentEligibleForAPI => Setting unchanged"),i=!1),_.isNull(n)||(d.errare("::isImportedContentEligibleForAPI => invalid data sent from server",o),d.errare("::isImportedContentEligibleForAPI => importErrorMsg",n),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",n,"</strong>","</span>"].join("")}),i=!1),_.isEmpty(a)||d.previewer.trigger("sek-notify",{notif_id:"img-import-errors",type:"info",duration:6e4,message:['<span style="color:#0075a2">',["<strong>"+sektionsLocalizedData.i18n["Some image(s) could not be imported"]+"</strong><br/>",'<span style="font-size:11px">'+a+"</span>"].join(" : "),"</span>"].join("")}),i},doUpdateApiSettingAfter_FileImport:function(e,t){if(t=t||{},d.czr_sektions.isImportedContentEligibleForAPI(e,t)||!t.is_file_import){var i="local",o=!1;if(t.is_file_import){var n=t.input,r=d.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type);i=r.scope,o="local"===r.scope&&n.input_parent.czr_Input("keep_existing_sections")()}d.czr_sektions.updateAPISetting({action:"sek-import-from-file",scope:i,imported_content:e.data,assign_missing_locations:t.assign_missing_locations,keep_existing_sections:o}).done(function(){"local"===i&&d.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),d.previewer.refresh(),d.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["File successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){d.errare("::doUpdateApiSettingAfter_FileImport => error when firing ::updateAPISetting",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),d.previewer.refresh()}else d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},doAlwaysAfterFileImportAndApiSettingUpdate:function(e){if(d.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0}),e=e||{},(e=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},e)).is_file_import){var t=e.input;t.container.find(".sek-uploading").hide(),e.file_input.val("").trigger("change"),t.container.find(".czr-import-dialog").hide(),t.container.find('button[data-czr-action="sek-pre-import"]').show()}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(n,d){d.extend(CZRSeksPrototype,{setupTemplateGallery:function(){var t=this;t.templateGalleryExpanded=new n.Value(!1),t.tmplImportDialogVisible=new n.Value(!1),sektionsLocalizedData.isTemplateGalleryEnabled&&(t.templateGalleryExpanded.bind(function(e){t.cachedElements.$body.toggleClass("sek-template-gallery-expanded",e),e?(t.tmplDialogVisible(!1),t.levelTreeExpanded(!1),t.tmplImportDialogVisible(!1),d("#customize-preview iframe").css("z-index",1),t.renderOrRefreshTempGallery({tmpl_source:"api_tmpl"})):(d("#customize-preview iframe").css("z-index",""),n.trigger("nb-template-gallery-closed"))}),t.tmplImportDialogVisible.bind(function(e){t.cachedElements.$body.toggleClass("sek-tmpl-dialog-expanded",e),e&&(t.tmplDialogVisible(!1),t.levelTreeExpanded(!1),d("#customize-preview iframe").css("z-index",1))}),n.previewer.bind("ready",function(){t.templateGalleryExpanded(!1)}))},renderTmplGalleryUI:function(){if(0<d("#nimble-tmpl-gallery").length)return d("#nimble-tmpl-gallery");try{_tmpl=wp.template("nimble-top-tmpl-gallery")({})}catch(e){return n.errare("Error when parsing nimble-top-tmpl-gallery template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-tmpl-gallery")},renderOrRefreshTempGallery:function(t){t=d.extend({tmpl_source:"api_tmpl"},t||{});var i,o=this;d("#nimble-tmpl-gallery").length<1&&d.when(o.renderTmplGalleryUI({})).done(function(){o.setupTmplGalleryDOMEvents()}),d("#nimble-tmpl-gallery").find(".sek-tmpl-gallery-inner").html("");var n=function(e){return o.getTemplateGalleryHtml(e).done(function(e){(i=d("#nimble-tmpl-gallery")).find(".sek-tmpl-gallery-inner").html(e)}),o.getTemplateGalleryHtml(e)};n(t).done(function(e){_.isEmpty(e)&&"api_tmpl"===t.tmpl_source?("function"==typeof window.console.log&&console.log("Nimble Builder API problem => could not fetch templates"),n({tmpl_source:"user_tmpl"})):((i=d("#nimble-tmpl-gallery")).find("#sek-tmpl-source-switcher").show(),i.find("#sek-tmpl-source-switcher button").attr("aria-pressed","false").removeClass("is-selected"),i.find('[data-sek-tmpl-source="'+t.tmpl_source+'"]').attr("aria-pressed","true").addClass("is-selected"))})},getTemplateGalleryHtml:function(i){var o,n,r="",s=[sektionsLocalizedData.baseUrl,"/assets/admin/img/wire_frame.png","?ver=",sektionsLocalizedData.nimbleVersion].join(""),a=d.Deferred(),c=d("#nimble-tmpl-gallery").find(".czr-css-loader");c.show();return("user_tmpl"===i.tmpl_source?this.setSavedTmplCollection:this.getApiTmplCollection).call(this).done(function(e){setTimeout(function(){!function(e){if(_.isEmpty(e)&&"user_tmpl"===i.tmpl_source){var t=[sektionsLocalizedData.baseUrl,"/assets/admin/img/empty_tmpl_collection_notice.jpg","?ver=",sektionsLocalizedData.nimbleVersion].join("");r+='<div class="sek-tmpl-empty-collection">',r+="<p>"+sektionsLocalizedData.i18n["You did not save any template yet."]+"</p>",r+='<img src="'+t+'" />',r+="</div>"}else _.each(e,function(e,t){o=_.isEmpty(e.description)?[e.title,e.last_modified_date].join(" | "):[e.title,e.last_modified_date,e.description].join(" | "),n=_.isEmpty(e.thumb_url)?s:e.thumb_url,r+='<div class="sek-tmpl-item" data-sek-tmpl-item-id="'+t+'" data-sek-tmpl-item-source="'+i.tmpl_source+'">',r+='<div class="sek-tmpl-thumb" style="background-image:url('+n+')"></div>',r+='<div class="sek-tmpl-info" title="'+o+'">',r+='<h3 class="tmpl-title">'+e.title+"</h3>",r+='<p class="tmpl-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",r+='<p class="tmpl-desc">'+e.description+"</p>",r+='<i class="material-icons use-tmpl" title="'+sektionsLocalizedData.i18n["Use this template"]+'">add_circle_outline</i>',"user_tmpl"===i.tmpl_source&&(r+='<i class="material-icons edit-tmpl" title="'+sektionsLocalizedData.i18n["Edit this template"]+'">edit</i>',r+='<i class="material-icons remove-tmpl" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>'),"true"==e.is_pro_tmpl&&(r+='<div class="sek-is-pro"><img src="'+sektionsLocalizedData.czrAssetsPath+'sek/img/pro_orange.svg" alt="Pro feature"/></div>'),r+="</div>",r+="</div>"});0<c.length?c.hide({duration:100,complete:function(){a.resolve(r)}}):a.resolve(r)}(e)},0)}).fail(function(){console.log("tmpl collection promise failed",i),a.resolve("")}),a.promise()},setupTmplGalleryDOMEvents:function(){var l=d("#nimble-tmpl-gallery"),o=this;l.on("click",".sek-tmpl-item .use-tmpl",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).closest(".sek-tmpl-item").data("sek-tmpl-item-id"),i=d(this).closest(".sek-tmpl-item").data("sek-tmpl-item-source");_.isEmpty(t)?n.errare("::setupTmplGalleryDOMEvents => error => invalid template id"):o.hasCurrentPageNBSectionsNotHeaderFooter()?(o._tmplNameWhileImportDialog=t,o._tmplSourceWhileImportDialog=i,o.tmplImportDialogVisible(!0)):(n.czr_sektions.get_gallery_tmpl_json_and_inject({tmpl_name:t,tmpl_source:i}),o.templateGalleryExpanded(!1))}).on("click",".sek-tmpl-gal-import-dialog .sek-ui-button",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).data("sek-tmpl-inject-mode");_.contains(["replace","before","after"],t)?(n.czr_sektions.get_gallery_tmpl_json_and_inject({tmpl_name:o._tmplNameWhileImportDialog,tmpl_source:o._tmplSourceWhileImportDialog,tmpl_inject_mode:t}),o.templateGalleryExpanded(!1)):n.errare("::setupTmplGalleryDOMEvents => error => invalid import mode")}).on("propertychange change click keyup input paste",".sek-filter-tmpl",_.debounce(function(e){e.preventDefault();var t,i,o,n,r,s,a=d(this).val(),c=function(){l.removeClass("search-active"),l.find(".sek-tmpl-item").each(function(){d(this).removeClass("search-match")})};_.isString(a)?(a=a.trim().toLowerCase(),_.isEmpty(a.replace(/\s/g,""))?c():(l.addClass("search-active"),l.find(".sek-tmpl-item").each(function(){t=(d(this).find(".tmpl-title").html()+"").toLowerCase(),i=(d(this).find(".tmpl-desc").html()+"").toLowerCase(),o=(d(this).find(".tmpl-date").html()+"").toLowerCase(),n=-1!=t.indexOf(a),r=-1!=i.indexOf(a),s=-1!=o.indexOf(a),d(this).toggleClass("search-match",n||r||s)}))):c()},100)).on("click",".sek-tmpl-info .edit-tmpl",function(e){e.preventDefault();var t=function(e){o.tmplDialogMode("edit"),o.tmplDialogMode.unbind(t)};o.tmplToEdit=d(this).closest("[data-sek-tmpl-item-id]").data("sek-tmpl-item-id"),o.tmplDialogMode.bind(t),o.tmplDialogVisible(!0)}).on("click",".sek-tmpl-info .remove-tmpl",function(e){e.preventDefault();var t=function(e){o.tmplDialogMode("remove"),o.tmplDialogMode.unbind(t)};o.tmplToRemove=d(this).closest("[data-sek-tmpl-item-id]").data("sek-tmpl-item-id"),o.tmplDialogMode.bind(t),o.tmplDialogVisible(!0)}).on("click",".sek-close-dialog",function(e){e.preventDefault(),o.templateGalleryExpanded(!1)}).on("click","#sek-tmpl-source-switcher button",function(e){e.preventDefault(),d("#sek-tmpl-source-switcher button").removeClass("is-selected").attr("aria-pressed","false"),d(this).addClass("is-selected").attr("aria-pressed","true"),o.renderOrRefreshTempGallery({tmpl_source:d(this).data("sek-tmpl-source")})})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(t,e){jQuery.extend(CZRSeksPrototype,t.Events);var i=t.Class.extend(CZRSeksPrototype);try{t.czr_sektions=new i}catch(e){t.errare("api.czr_sektions => problem on instantiation",e)}}(wp.customize),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{content_type_switcher:function(e){var i,o=this,n=r.czr_sektions;if(!r.section.has(o.module.control.section()))throw new Error("api.czrInputMap.content_type_switcher => section not registered");i=r.section(o.module.control.section());var t=function(t){o.container.find('[data-sek-content-type="'+(t||"module")+'"]').trigger("click"),a.each(i.controls(),function(e){a.isUndefined(e.content_type)||e.active(t===e.content_type)})};r.czr_sektions.currentContentPickerType=r.czr_sektions.currentContentPickerType||new r.Value,r.bind("nimble-modules-and-sections-controls-registered",function(){t(r.czr_sektions.currentContentPickerType())}),r.czr_sektions.currentContentPickerType.bind(function(e){t(e)}),r.czr_sektions.currentContentPickerType(o()),o.container.on("click","[data-sek-content-type]",function(e){e.preventDefault();var t=s(this).data("sek-content-type");if(o.container.find("[data-sek-content-type]").attr("aria-pressed",!1),n.levelTreeExpanded(!1),n.tmplDialogVisible&&n.tmplDialogVisible(!1),n.saveSectionDialogVisible&&n.saveSectionDialogVisible(!1),"template"===t){var i=r.czr_sektions.templateGalleryExpanded();s(this).attr("aria-pressed",!i),r.czr_sektions.templateGalleryExpanded(!i)}else r.czr_sektions.templateGalleryExpanded(!1),s(this).attr("aria-pressed",!0),r.czr_sektions.currentContentPickerType(t)}),r.bind("nb-template-gallery-closed",function(){o.container.find('[data-sek-content-type="template"]').attr("aria-pressed",!1)}),t(r.czr_sektions.currentContentPickerType())}})}(wp.customize,jQuery,_),function(t,e,i){t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{module_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"module",input_container:this.container})},section_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:this.container})}})}(wp.customize,jQuery,_),function(s,a,c){s.czrInputMap=s.czrInputMap||{},a.extend(s.czrInputMap,{module_option_switcher:function(e){var t=this;if(!s.section.has(t.module.control.section()))throw new Error(t.input_type+" => section not registered");s.section(t.module.control.section());var i,o="",n=t.module.control.params.sek_registration_params;if(c.isUndefined(n))throw new Error(t.input_type+" => missing registration params");if(n&&n.module_id&&(o=n.module_id,i=n.ui_action),c.isEmpty(o))throw new Error(t.input_type+" => missing module id");t.container.on("click","[data-sek-option-type]",function(e){e.preventDefault(),t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),a(this).addClass("is-selected").attr("aria-pressed",!0),s.previewer.trigger("settings"===a(this).data("sek-option-type")?"sek-edit-options":"sek-edit-module",{id:o,level:"module"})});var r="sek-generate-level-options-ui"===i?"settings":"content";t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),t.container.find('[data-sek-option-type="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(l,d,u){l.czrInputMap=l.czrInputMap||{};var p=function(e){return u.contains(["px","em","%"],e)||(l.errare("error : invalid unit for input "+this.id,e),e="px"),e},_=function(i){var o=this;i.on("click",".sek-ui-button",function(e,t){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),d(this).addClass("is-selected").attr("aria-pressed",!0),o.css_unit(d(this).data("sek-unit"),t)}),i.find('.sek-ui-button[data-sek-unit="'+(o.initial_unit||"px")+'"]').addClass("is-selected").attr("aria-pressed",!0)},m=function(t,i){var o=this;t.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),t.find('input[type="number"]').each(function(){d(this).val("")}),o(i),d(".sek-unit-wrapper",t).find('[data-sek-unit="px"]').trigger("click")})};d.extend(l.czrInputMap,{spacing:function(e){var n=this,i=d(".sek-spacing-wrapper",n.container),t=l.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type),o=u.isEmpty(t)||u.isEmpty(t.default)?[]:t.default;if(i.on("input",'input[type="number"]',function(e){var t=d(this).closest("[data-sek-spacing]").data("sek-spacing"),i=d.extend(!0,{},u.isObject(n())?n():{}),o=d(this).val();u.isString(o)&&!u.isEmpty(o)||u.isNumber(o)?i[t]=o:i=u.omit(i,t),n(i)}),m.call(n,i,o),u.isObject(n())){u.each(n(),function(e,t){d('[data-sek-spacing="'+t+'"]',i).find('input[type="number"]').val(e)});var r="px";d(".sek-unit-wrapper .sek-ui-button",n.container).each(function(){var e=d(this).data("sek-unit");u.isEmpty(n())||u.isEmpty(n().unit)||e===n().unit&&(r=e)}),d(".sek-unit-wrapper",n.container).find('[data-sek-unit="'+p.call(n,r)+'"]').trigger("click")}var s=n();n.initial_unit="px",u.isEmpty(s)||(n.initial_unit=u.isEmpty(s.unit)?"px":s.unit),n.css_unit=new l.Value(p.call(n,n.initial_unit)),n.css_unit.bind(function(e){var t;e=u.isEmpty(e)?"px":e,(t=d.extend(!0,{},u.isObject(n())?n():{})).unit=e,n(t)}),_.call(n,i)}}),d.extend(l.czrInputMap,{spacingWithDeviceSwitcher:function(e){var r=this,s=d(".sek-spacing-wrapper",r.container),t=l.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=u.isEmpty(t)||u.isEmpty(t.default)?{}:t.default,c=function(e,t){var i=["mobile","tablet","desktop"];if(u.has(e,t))return e[t];var o=u.findIndex(i,function(e){return t===e});return!u.isEmpty(t)&&o<i.length?c(e,i[o+1]):{}},i=function(e){var t=d.extend(!0,{},u.isObject(r())?r():{}),i=d.extend(!0,{},a);t=u.isObject(t)?d.extend(i,t):i;var o=c(t,e);d("[data-sek-spacing]",s).each(function(){var e=d(this).data("sek-spacing"),t="";u.isEmpty(o)||u.isEmpty(o[e])||(t=o[e]),d(this).find('input[type="number"]').val(t)});var n="px";d(".sek-unit-wrapper .sek-ui-button",r.container).each(function(){var e=d(this).data("sek-unit");u.isEmpty(o)||u.isEmpty(o.unit)||e===o.unit&&(n=e)}),d(".sek-unit-wrapper",r.container).find('[data-sek-unit="'+p.call(r,n)+'"]').trigger("click",{previewed_device_switched:!0})};l.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r);var o=r();r.initial_unit="px",u.isEmpty(o)||u.isEmpty(o[r.previewedDevice()])||(r.initial_unit=u.isEmpty(o[r.previewedDevice()].unit)?"px":o[r.previewedDevice()].unit),r.css_unit=new l.Value(p.call(r,r.initial_unit)),s.on("input",'input[type="number"]',function(e){var t,i=d(this).closest("[data-sek-spacing]").data("sek-spacing"),o=d(this).val(),n=l.previewedDevice()||"desktop";(t=d.extend(!0,{},u.isObject(r())?r():{}))[n]=d.extend(!0,{},t[n]||{}),u.isString(o)&&!u.isEmpty(o)||u.isNumber(o)?t[n][i]=o:t[n]=u.omit(t[n],i),t[n].unit&&r.css_unit()==t[n].unit||(t[n].unit=r.css_unit()),r(t)}),m.call(r,s,a),r.previewedDevice.bind(function(e){try{i(e)}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}),r.css_unit.bind(function(e,t,i){if(!u.isObject(i)||!0!==i.previewed_device_switched){e=u.isEmpty(e)?"px":e;var o,n=r.previewedDevice()||"desktop";(o=d.extend(!0,{},u.isObject(r())?r():{}))[n]=d.extend(!0,{},o[n]||{}),o[n].unit=e,r(o)}}),_.call(r,s);try{i(l.previewedDevice())}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}})}(wp.customize,jQuery,_),function(o,a,c){o.czrInputMap=o.czrInputMap||{},a.extend(o.czrInputMap,{bg_position:function(e){var t=this;a(".sek-bg-pos-wrapper",t.container).on("change",'input[type="radio"]',function(e){t(a(this).val())}),c.isEmpty(t())||t.container.find('input[value="'+t()+'"]').attr("checked",!0).trigger("click")},bgPositionWithDeviceSwitcher:function(e){var n=this,t=o.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type),r=c.isEmpty(t)||c.isEmpty(t.default)?{}:t.default;o.czr_sektions.maybeSetupDeviceSwitcherForInput.call(n);var s=function(e,t){var i=["mobile","tablet","desktop"];if(c.has(e,t))return e[t];var o=c.findIndex(i,function(e){return t===e});return!c.isEmpty(t)&&o<i.length?s(e,i[o+1]):{}},i=function(e){var t=a.extend(!0,{},c.isObject(n())?n():{}),i=a.extend(!0,{},r);t=c.isObject(t)?a.extend(i,t):i;var o=s(t,e);n.container.find('input[value="'+o+'"]').attr("checked",!0).trigger("click",{previewed_device_switched:!0})};a(".sek-bg-pos-wrapper",n.container).on("change",'input[type="radio"]',function(e){var t,i=a(this).val();(t=a.extend(!0,{},c.isObject(n())?n():{}))[o.previewedDevice()||"desktop"]=i,n(t)}),n.previewedDevice.bind(function(e){try{i(e)}catch(e){o.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+n.id,e)}});try{i(o.previewedDevice())}catch(e){o.errare("Error when firing syncWithPreviewedDevice for input type bgPositionWithDeviceSwitcher for input id "+n.id,e)}}})}(wp.customize,jQuery,_),function(c,l,d){c.czrInputMap=c.czrInputMap||{};var e=function(e){var n=this,t=c.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type),r=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i="verticalAlignWithDeviceSwitcher"===n.type?".sek-v-align-wrapper":".sek-h-align-wrapper",s=l(i,n.container);c.czr_sektions.maybeSetupDeviceSwitcherForInput.call(n);var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var o=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&o<i.length?a(e,i[o+1]):{}},o=function(e){var t=l.extend(!0,{},d.isObject(n())?n():{}),i=l.extend(!0,{},r);t=d.isObject(t)?l.extend(i,t):i;var o=a(t,e);s.find(".selected").removeClass("selected"),s.find('div[data-sek-align="'+o+'"]').addClass("selected")};s.on("click","[data-sek-align]",function(e){var t;e.preventDefault(),(t=l.extend(!0,{},d.isObject(n())?n():{}))[c.previewedDevice()||"desktop"]=l(this).data("sek-align"),s.find(".selected").removeClass("selected"),l.when(l(this).addClass("selected")).done(function(){n(t)})}),n.previewedDevice.bind(function(e){try{o(e)}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type : "+n.type+" for input id "+n.id,e)}});try{o(c.previewedDevice())}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type : "+n.type+" for input id "+n.id,e)}};l.extend(c.czrInputMap,{horizTextAlignmentWithDeviceSwitcher:e,horizAlignmentWithDeviceSwitcher:e,verticalAlignWithDeviceSwitcher:e})}(wp.customize,jQuery,_),function(f,g,h){f.czrInputMap=f.czrInputMap||{},g.extend(f.czrInputMap,{font_picker:function(e){var p=this,_=p.input_parent,o=function(e,t){_();var o=g('select[data-czrtype="'+p.id+'"]',p.container);h.isNull(p())||h.isEmpty(p())?o.append('<option value="none" selected="selected">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"):o.append('<option value="none">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>");var i=[{title:sektionsLocalizedData.i18n["Web safe fonts"],type:"cfont",list:t.cfonts},{title:sektionsLocalizedData.i18n["Google fonts"],type:"gfont",list:t.gfonts}],n=f.czr_sektions.sniffAllFonts(),r=sektionsLocalizedData.alreadyUsedFonts,s=[],a=[];if(!h.isEmpty(r)&&h.isObject(r)&&h.each(r,function(e){a.push(e)}),h.isArray(n)&&h.each(n,function(e){a.push(e)}),!h.isEmpty(a)){var c={},l=[];a.forEach(function(e){c[e]=(c[e]||0)+1});var d=h.sortBy(c,function(e){return e});h.each(d,function(i){h.each(c,function(e,t){i!==e||h.contains(l,t)||l.unshift(t)})}),h.each(l,function(e){s.push({name:e})}),i.unshift({title:sektionsLocalizedData.i18n["Already used fonts"],type:null,list:s})}h.each(i,function(e){var t,r,s,i=g("<optgroup>",{label:e.title,html:(t=e.list,r=e.type,s="",h.each(t,function(e){var t,i,o=h.isString(e.name)?e.name:"Undefined Font Family",n=o.replace(/[+|:]/g," ");t=o,i=r,o=h.isEmpty(i)?t:h.isString(t)?["[",i,"]",t].join(""):"",n=n.replace("[cfont]","").replace("[gfont]",""),o==p()?s+='<option selected="selected" value="'+o+'">'+n+"</option>":s+='<option value="'+o+'">'+n+"</option>"}),s)});o.append(i)});var u={escapeMarkup:function(e){return e}};e&&g.extend(u,{resultsAdapter:e,closeOnSelect:!1}),o.czrSelect2(u),g(".czrSelect2-selection__rendered",p.container).css(m(p()))},m=function(e){if(!h.isString(e)||h.isEmpty(e))return{};var t,i,o,n=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return t=r(e),i=n[1]?n[1].replace(/[^0-9.]+/g,""):400,i=h.isNumber(i)?i:400,o=n[1]&&-1!=n[1].indexOf("italic")?"italic":"",{"font-family":"none"==t?"inherit":t.replace(/[+|:]/g," "),"font-weight":i||400,"font-style":o||"normal"}},r=function(e){if(!h.isString(e)||h.isEmpty(e))return e;var t=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return h.isString(t[0])?t[0].replace(/[+|:]/g," "):""};g.when(function(){var e,t=g.Deferred();h.isEmpty(f.sek_fontCollections)?(h.isUndefined(f.sek_fetchingFontCollection)||"pending"!=f.sek_fetchingFontCollection.state()?(e=f.CZR_Helpers.getModuleTmpl({tmpl:"font_list",module_type:"font_picker_input",module_id:p.module.id}),f.sek_fetchingFontCollection=e):e=f.sek_fetchingFontCollection,e.done(function(e){if("string"!=typeof e||"{"!==e[0])throw new Error("font_picker => server list is not JSON.parse-able");f.sek_fontCollections=JSON.parse(e),t.resolve(f.sek_fontCollections)}).fail(function(e){t.reject(e)})):t.resolve(f.sek_fontCollections);return t.promise()}()).done(function(t){var i;(i=g.Deferred(),void 0!==g.fn.czrSelect2&&void 0!==g.fn.czrSelect2.amd&&"function"==typeof g.fn.czrSelect2.amd.require?g.fn.czrSelect2.amd.require(["czrSelect2/results","czrSelect2/utils"],function(e,t){var o=function(e,t,i){o.__super__.constructor.call(this,e,t,i)};t.Extend(o,e),o.prototype.bind=function(e,t){var i=this;e.on("results:focus",function(e){"true"!=e.element.attr("aria-selected")&&i.trigger("select",{data:e.data})}),o.__super__.bind.call(this,e,t)},i.resolve(o)}):i.resolve(!1),i.promise()).done(function(e){o(e,t)})}).fail(function(e){f.errare("font_picker => fail response =>",e)})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{fa_icon_picker:function(){var o=this,n=!1,e=function(t){!0!==o.iconCollectionSet&&(s.when(s.Deferred(function(t){a.isEmpty(o.sek_faIconCollection)?r.CZR_Helpers.getModuleTmpl({tmpl:"icon_list",module_type:"fa_icon_picker_input",module_id:o.module.id}).done(function(e){if("string"!=typeof e||"["!==e[0])throw new Error("fa_icon_picker => server list is not JSON.parse-able");o.sek_faIconCollection=JSON.parse(e),t.resolve(o.sek_faIconCollection)}).fail(function(e){t.reject(e)}):t.resolve(o.sek_faIconCollection)})).done(function(e){!function(e){a.each(e,function(e){var t={value:e,html:r.CZR_Helpers.capitalize(e.substring(7))};t.value==o()&&(s.extend(t,{selected:"selected"}),n=!0),s("select[data-czrtype]",o.container).append(s("<option>",t))});var t,i=function(e){return e.id?s('<span class="'+e.element.value+'"></span><span class="social-name"> '+e.text+"</span>"):e.text};t=n?s("<option>"):s("<option>",{selected:"selected"}),s("select[data-czrtype]",o.container).prepend(t).czrSelect2({templateResult:i,templateSelection:i,placeholder:sektionsLocalizedData.i18n["Select an icon"],allowClear:!0})}(e),t&&!0===t.open_on_init&&a.delay(function(){try{s("select[data-czrtype]",o.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){r.errare("fa_icon_picker => fail response =>",e)}),o.iconCollectionSet=!0)};o.container.on("click",function(){e()}),a.delay(function(){e({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(u,p,_){u.czrInputMap=u.czrInputMap||{},p.extend(u.czrInputMap,{code_editor:function(e){var o=this,i=this.module.control,n=(o.input_parent(),!1),r=o.container.find("textarea"),s=o.container.find(".customize-control-title"),a=function(){return p.Deferred(function(t){var i=_.isEmpty(r.data("editor-code-type"))?"text/html":r.data("editor-code-type");u.czr_sektions.code_editor_params&&u.czr_sektions.code_editor_params[i]?t.resolve(u.czr_sektions.code_editor_params[i]):wp.ajax.post("sek_get_code_editor_params",{nonce:u.settings.nonce.save,code_type:i}).done(function(e){_.isObject(e)||u.errare(o.id+" => error => invalid code editor params sent by server",e),u.czr_sektions.code_editor_params={},u.czr_sektions.code_editor_params[i]=e,t.resolve(u.czr_sektions.code_editor_params[i])}).fail(function(e){t.reject(e)})})};o.isReady.done(function(){var t=function(e){_.isEmpty(this.editor)&&(_.isEmpty(this.module.control.container.attr("data-sek-expanded"))||"false"==this.module.control.container.attr("data-sek-expanded")||setTimeout(function(){if(n)try{c(n)}catch(e){u.errare("error in sek_control => code_editor() input",e),l()}else l();s.trigger("click")},10))};r.html(o()),p.when(a()).done(function(e){wp.codeEditor&&(_.isUndefined(e)||!1!==e)&&(n=e),t.call(o),o.module.control.container.on("sek-accordion-expanded",function(){t.call(o)})}).fail(function(e){u.errare(o.id+" => error when getting the editor params from server")})});var c=function(e){var t,i=!1;t=_.extend({},e,{onTabNext:CZRSeksPrototype.selectNextTabbableOrFocusable(":tabbable"),onTabPrevious:CZRSeksPrototype.selectPrevTabbableOrFocusable(":tabbable"),onUpdateErrorNotice:d}),o.editor=wp.codeEditor.initialize(r,t),p(o.editor.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-label":s.html(),"aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),s.on("click",function(e){e.stopPropagation(),o.editor.codemirror.focus()}),o.editor.codemirror.on("change",function(e){i=!0,r.val(e.getValue()).trigger("change"),i=!1}),o.editor.codemirror.setValue(o()),o.bind(o.id+":changed",function(e){i||o.editor.codemirror.setValue(e)}),o.editor.codemirror.on("keydown",function(e,t){27===t.keyCode&&t.stopPropagation()})},l=function(){var n=r[0];o.editor=n,r.on("blur",function(){r.data("next-tab-blurs",!1)}),r.on("keydown",function(e){var t,i,o;27!==e.keyCode?9!==e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||r.data("next-tab-blurs")||(t=n.selectionStart,i=n.selectionEnd,o=n.value,0<=t&&(n.value=o.substring(0,t).concat("\t",o.substring(i)),r.selectionStart=n.selectionEnd=t+1),e.stopPropagation(),e.preventDefault()):r.data("next-tab-blurs")||(r.data("next-tab-blurs",!0),e.stopPropagation())})},d=function(e){var t;i.setting.notifications.remove(o.id),0!==e.length&&(t=1===e.length?sektionsLocalizedData.i18n.codeEditorSingular.replace("%d","1").replace("%s",s.html()):sektionsLocalizedData.i18n.codeEditorPlural.replace("%d",String(e.length)).replace("%s",s.html()),i.setting.notifications.add(o.id,new u.Notification(o.id,{message:t,type:"warning"})))}}})}(wp.customize,jQuery,_),function(e,r,t){e.czrInputMap=e.czrInputMap||{},r.extend(e.czrInputMap,{range_simple:function(e){var t=this,i=r(".sek-range-with-unit-picker-wrapper",t.container),o=i.find('input[type="number"]'),n=i.find('input[type="range"]');n.on("input",function(e){o.val(r(this).val()).trigger("input")}),o.on("input",function(e){t(r(this).val()),n.val(r(this).val())}),n.val(o.val()||0)},number_simple:function(e){var t=this;t.container.find('input[type="number"]').on("input",function(e){t(r(this).val())})}})}(wp.customize,jQuery,_),function(d,u,p){d.czrInputMap=d.czrInputMap||{},u.extend(d.czrInputMap,{range_simple_device_switcher:function(e){var s=this,t=u(".sek-range-with-unit-picker-wrapper",s.container),a=t.find('input[type="number"]'),r=t.find('input[type="range"]'),i=d.czr_sektions.getInputRegistrationParams(s.id,s.module.module_type),c=p.isEmpty(i)||p.isEmpty(i.default)?{}:i.default,l=function(e,t){var i=["mobile","tablet","desktop"];if(p.has(e,t))return e[t];var o=p.findIndex(i,function(e){return t===e});return!p.isEmpty(t)&&o<i.length?l(e,i[o+1]):u.extend(!0,{desktop:""},c).desktop},o=function(e){var t=s(),i={};i=u.extend(!0,{},c),p.isObject(t)?i=u.extend(!0,{},t):p.isString(t)&&!p.isEmpty(t)&&(i={desktop:t});var o,n=l(i,e),r=(o=n,p.isEmpty(o)||!p.isString(o)?"16":o.replace(/px|em|%/g,""));a.val(r).trigger("input",{previewed_device_switched:!0})};d.czr_sektions.maybeSetupDeviceSwitcherForInput.call(s),r.on("input",function(e){a.val(u(this).val()).trigger("input")}),a.on("input",function(e,t){var i,o=d.previewedDevice()||"desktop",n=u(this).val();(i=u.extend(!0,{},p.isObject(s())?s():{}))[o]=u.extend(!0,{},i[o]||{}),p.isString(n)&&!p.isEmpty(n)&&(i[o]=n),(p.isEmpty(t)||p.isObject(t)&&!0!==t.previewed_device_switched)&&s(i),r.val(u(this).val())}),s.previewedDevice.bind(function(e){try{o(e)}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}),r.val(a.val()||0);try{o(d.previewedDevice())}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}})}(wp.customize,jQuery,_),function(a,c,l){a.czrInputMap=a.czrInputMap||{},c.extend(a.czrInputMap,{range_with_unit_picker:function(e){var t=this,i=c(".sek-range-with-unit-picker-wrapper",t.container),o=i.find('input[type="number"]'),n=i.find('input[type="range"]'),r=i.find("input[data-czrtype]").data("sek-unit"),s=function(e){return l.contains(["px","em","%"],e)||(a.errare("error : invalid unit for input "+t.id,e),e="px"),e};t.css_unit=new a.Value(l.isEmpty(r)?"px":s(r)),t.css_unit.bind(function(e){e=l.isEmpty(e)?"px":e,i.find('input[type="number"]').trigger("input")}),n.on("input",function(e){o.val(c(this).val()).trigger("input")}),o.on("input",function(e){t(c(this).val()+s(t.css_unit())),n.val(c(this).val())}),n.val(o.val()||0),i.on("click",".sek-ui-button",function(e){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),c(this).addClass("is-selected").attr("aria-pressed",!0),i.find("input[data-czrtype]").data("sek-unit",c(this).data("sek-unit")),t.css_unit(c(this).data("sek-unit"))}),i.find('.sek-ui-button[data-sek-unit="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(a,_,m){a.czrInputMap=a.czrInputMap||{},_.extend(a.czrInputMap,{range_with_unit_picker_device_switcher:function(e){var c=this,l=_(".sek-range-with-unit-picker-wrapper",c.container),d=l.find('input[type="number"]'),r=l.find('input[type="range"]'),s=function(e){return m.contains(["px","em","%"],e)||(a.errare("range_with_unit_picker_device_switcher => error : invalid unit for input "+c.id,e),e="px"),e},t=a.czr_sektions.getInputRegistrationParams(c.id,c.module.module_type),u=m.isEmpty(t)||m.isEmpty(t.default)?{}:t.default,i=function(){return l.find("input[data-czrtype]").data("sek-unit")||"px"},p=function(e,t){var i=["mobile","tablet","desktop"];if(m.has(e,t))return e[t];var o=m.findIndex(i,function(e){return t===e});return!m.isEmpty(t)&&o<i.length?p(e,i[o+1]):_.extend(!0,{desktop:""},u).desktop},o=function(e){var t=c(),i={};i=_.extend(!0,{},u),m.isObject(t)?i=_.extend(!0,{},t):m.isString(t)&&!m.isEmpty(t)&&(i={desktop:t});var o,n,r=p(i,e),s=(n=r,m.isEmpty(n)||!m.isString(n)?"px":n.replace(/[0-9]|\.|,/g,"")),a=(o=r,m.isEmpty(o)||!m.isString(o)?"16":o.replace(/px|em|%/g,""));_(".sek-unit-wrapper",l).find('[data-sek-unit="'+s+'"]').trigger("click",{previewed_device_switched:!0}),l.find('.sek-ui-button[data-sek-unit="'+s+'"]').addClass("is-selected").attr("aria-pressed",!0),d.val(a).trigger("input",{previewed_device_switched:!0})};a.czr_sektions.maybeSetupDeviceSwitcherForInput.call(c),c.css_unit=new a.Value(m.isEmpty(i())?"px":s(i()));var n='<button type="button" class="button sek-reset-button sek-float-right">'+sektionsLocalizedData.i18n.Reset+"</button>";c.container.find(".customize-control-title").append(n),c.css_unit.bind(function(e,t,i){m.isObject(i)&&!0===i.previewed_device_switched||d.trigger("input")}),r.on("input",function(e){d.val(_(this).val()).trigger("input")}),d.on("input",function(e,t){var i,o=a.previewedDevice()||"desktop",n=_(this).val()+s(c.css_unit());(i=_.extend(!0,{},m.isObject(c())?c():{}))[o]=_.extend(!0,{},i[o]||{}),m.isString(n)&&!m.isEmpty(n)&&(i[o]=n),(m.isEmpty(t)||m.isObject(t)&&!0!==t.previewed_device_switched)&&c(i),r.val(_(this).val())}),l.on("click",".sek-ui-button",function(e,t){e.stopPropagation(),l.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),_(this).addClass("is-selected").attr("aria-pressed",!0),l.find("input[data-czrtype]").data("sek-unit",_(this).data("sek-unit")),c.css_unit(_(this).data("sek-unit"),t)}),c.previewedDevice.bind(function(e){try{o(e)}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+c.id,e)}}),c.container.on("click",".sek-reset-button",function(e){var t=a.previewedDevice(),i=_.extend(!0,{},m.isObject(c())?c():{});m.isEmpty(i[t])||(i=m.omit(i,t),c(i),o(a.previewedDevice()))}),r.val(d.val()||0);try{o(a.previewedDevice())}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+c.id,e)}}})}(wp.customize,jQuery,_),function(g,h,v){g.czrInputMap=g.czrInputMap||{},h.extend(g.czrInputMap,{borders:function(e){var a=this,c=h(".sek-borders",a.container),l=c.find('input[type="number"]'),d=c.find('input[type="range"]'),u=c.find(".sek-alpha-color-input"),p=function(e){return v.contains(["px","em","%"],e)||(g.errare("borders => error : invalid unit for input "+a.id,e),e="px"),e},_=function(e){return v.isEmpty(e)||!v.isString(e)?"16":e.replace(/px|em|%/g,"")},m=function(e){return v.isEmpty(e)||!v.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=g.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),f=v.isEmpty(t)||v.isEmpty(t.default)?{}:t.default;a.cssBorderTypes=["top","left","right","bottom"];var i,o,n=function(){var e=a(),t="px";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.wght)&&(t=p(m(e._all_.wght))),t},r=function(){var e=a(),t="#000000";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.col)&&(t=e._all_.col),t},s=function(e){if(!v.contains(v.union(a.cssBorderTypes,["_all_"]),e))throw new Error("Error in syncWithBorderType : the border type must be one of those values '_all_', 'top', 'left', 'right', 'bottom'");var t=a(),i={},o=h.extend(!0,{},f);v.isObject(t)?i=h.extend(!0,{},t):v.isString(t)&&(i={_all_:{wght:t}});var n,r,s=function(e,t){var i,o=h.extend(!0,{},f);if(!v.has(o,"_all_"))throw new Error("Error when firing getCurrentBorderTypeOrAllValue : the default value of the borders input must be php registered as an array formed : array( 'wght' => '1px', 'col' => '#000000' )");return i=v.isObject(e)&&v.has(e,"_all_")?v.extend(o._all_,e._all_):o._all_,v.has(e,t)&&v.isObject(e[t])?v.extend(i,e[t]):o._all_}(i=h.extend(o,i),e);if(v.isEmpty(s)||!v.isObject(s)||v.isEmpty(s.wght)||v.isEmpty(s.col))throw new Error("Error in syncWithBorderType : getCurrentBorderTypeOrAllValue must return an object formed : array( 'wght' => '1px', 'col' => '#000000' )");n=m(s.wght),r=_(s.wght),h(".sek-unit-wrapper",c).find('[data-sek-unit="'+n+'"]').trigger("click",{border_type_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+n+'"]').addClass("is-selected").attr("aria-pressed",!0),l.val(r).trigger("input",{border_type_switched:!0}),u.data("border_type_switched",!0),u.val(s.col).trigger("change"),u.data("border_type_switched",!1)};a.borderColor=new g.Value(v.isEmpty(r())?"#000000":r()),a.css_unit=new g.Value(v.isEmpty(n())?"px":p(n())),a.borderType=new g.Value("_all_"),l.val((i=a(),o=1,v.isObject(i)&&v.has(i,"_all_")&&v.isObject(i._all_)&&!v.isEmpty(i._all_.wght)&&(o=_(i._all_.wght)),o=parseInt(o,10),(!v.isNumber(o)||o<0)&&(g.errare("Error in borders input type for module : "+a.module.module_type+" the initial border width is invalid : "+o),o=1),o)),u.val(a.borderColor()),u.wpColorPicker({palettes:!0,width:1440<=window.innerWidth?271:251,change:function(e,t){h(this).val(t.color.toString()).trigger("colorpickerchange"),a.borderColor(t.color.toString(),{border_type_switched:!0===h(this).data("border_type_switched")})},clear:function(e,t){h(this).val("").trigger("colorpickerchange"),a.borderColor("")}}),a.css_unit.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_unit)&&l.trigger("input",i)}),a.borderColor.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_color)&&l.trigger("input",i)}),a.borderType.bind(function(e){try{s(e)}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}}),d.on("input",function(e){l.val(h(this).val()).trigger("input")}),l.on("input",function(e,t){var i,o=a.borderType()||"_all_",n=a.borderColor(),r=h(this).val()+p(a.css_unit()),s=h.extend(!0,{},f);(i=h.extend(!0,{},v.isObject(a())?a():s))[o]=h.extend(!0,{},i[o]||s[o]),v.isString(r)&&!v.isEmpty(r)&&(i[o].wght=r),i[o].col=n,(v.isEmpty(t)||v.isObject(t)&&!0!==t.border_type_switched)&&("_all_"===o&&v.each(a.cssBorderTypes,function(e){i=v.omit(i,e)}),a(i)),d.val(h(this).val())}),c.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),c.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",h(this).data("sek-unit")),a.css_unit(h(this).data("sek-unit"),t)}),c.on("click","[data-sek-border-type]",function(e,t){e.preventDefault(),c.find("[data-sek-border-type]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=h(this).data("sek-border-type")}catch(e){g.errare("borders input type => error when attaching click event",e)}a.borderType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.borderType()||"_all_",i=h.extend(!0,{},v.isObject(a())?a():{});v.isEmpty(i[t])||(i=v.omit(i,t),a(i),s(t))}),d.val(l.val()||0);try{s(a.borderType())}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}h('[data-sek-unit="'+a.css_unit()+'"]',c).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(m,f,g){m.czrInputMap=m.czrInputMap||{},f.extend(m.czrInputMap,{border_radius:function(e){var a=this,c=f(".sek-borders",a.container),l=c.find('input[type="number"]'),s=c.find('input[type="range"]'),d=function(e){return g.contains(["px","em","%"],e)||(m.errare("border_radius => error : invalid unit for input "+a.id,e),e="px"),e},u=function(e){return g.isEmpty(e)||!g.isString(e)?"16":e.replace(/px|em|%/g,"")},p=function(e){return g.isEmpty(e)||!g.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=m.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),_=g.isEmpty(t)||g.isEmpty(t.default)?{}:t.default;a.cssRadiusTypes=["top_left","top_right","bottom_right","bottom_left"];var i,o,n=function(){var e=a(),t="px";return g.isObject(e)&&g.has(e,"_all_")&&(t=d(p(e._all_))),t},r=function(e){if(!g.contains(["_all_","top_left","top_right","bottom_right","bottom_left"],e))throw new Error("Error in syncWithRadiusType : the radius type must be one of those values '_all_', 'top_left', 'top_right', 'bottom_right', 'bottom_left', => radius type => "+e);var t=a(),i={},o=f.extend(!0,{},_);g.isObject(t)?i=f.extend(!0,{},t):g.isString(t)&&(i={_all_:"0px"});var n,r,s=function(e,t){var i,o=f.extend(!0,{},_);if(!g.has(o,"_all_"))throw new Error("Error when firing getCurrentRadiusTypeOrAllValue : the default value of the border_radius input must be php registered as an array");return i=g.isObject(e)&&g.has(e,"_all_")?e._all_:o._all_,g.has(e,t)?e[t]:i}(i=f.extend(o,i),e);if(g.isEmpty(s)||!g.isString(s))throw new Error("Error in syncWithRadiusType : getCurrentRadiusTypeOrAllValue must return a string like 3em");n=p(s),r=u(s),f(".sek-unit-wrapper",c).find('[data-sek-unit="'+n+'"]').trigger("click",{radius_type_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+n+'"]').addClass("is-selected").attr("aria-pressed",!0),l.val(r).trigger("input",{radius_type_switched:!0})};a.css_unit=new m.Value(g.isEmpty(n())?"px":d(n())),a.radiusType=new m.Value("_all_"),l.val((i=a(),o=0,g.isObject(i)&&g.has(i,"_all_")&&(o=u(i._all_)),o=parseInt(o,10),(!g.isNumber(o)||o<0)&&(m.errare("Error in border_radius input type for module : "+a.module.module_type+" the initial radius is invalid : "+o),o=0),o)),a.css_unit.bind(function(e,t,i){(!g.isObject(i)||!0!==i.radius_type_switched&&!0!==i.initializing_the_unit)&&l.trigger("input",i)}),a.radiusType.bind(function(e){try{r(e)}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}}),s.on("input",function(e){l.val(f(this).val()).trigger("input")}),l.on("input",function(e,t){var i,o=a.radiusType()||"_all_",n=f(this).val()+d(a.css_unit()),r=f.extend(!0,{},_);(i=f.extend(!0,{},g.isObject(a())?a():r))[o]=f.extend(!0,{},i[o]||r[o]),g.isString(n)&&!g.isEmpty(n)&&(i[o]=n),(g.isEmpty(t)||g.isObject(t)&&!0!==t.radius_type_switched)&&("_all_"===o&&g.each(a.cssRadiusTypes,function(e){i=g.omit(i,e)}),a(i)),s.val(f(this).val())}),c.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),c.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",f(this).data("sek-unit")),a.css_unit(f(this).data("sek-unit"),t)}),c.on("click","[data-sek-radius-type]",function(e,t){e.preventDefault(),c.find("[data-sek-radius-type]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=f(this).data("sek-radius-type")}catch(e){m.errare("border_radius input type => error when attaching click event",e)}a.radiusType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.radiusType()||"_all_",i=f.extend(!0,{},g.isObject(a())?a():{});g.isEmpty(i[t])||(i=g.omit(i,t),a(i),r(t))}),s.val(l.val()||0);try{r(a.radiusType())}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}f('[data-sek-unit="'+a.css_unit()+'"]',c).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{buttons_choice:function(e){var o=this,n=s(".sek-button-choice-wrapper",o.container),t=n.find('input[type="number"]'),i=r.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type);a.isEmpty(i)||a.isEmpty(i.default)||i.default;t.val(o()),n.on("click","[data-sek-choice]",function(e,t){var i;e.stopPropagation(),n.find("[data-sek-choice]").removeClass("is-selected").attr("aria-pressed",!1),s(this).addClass("is-selected").attr("aria-pressed",!0);try{i=s(this).data("sek-choice")}catch(e){r.errare("buttons_choice input type => error when attaching click event",e)}o(i)}),s('[data-sek-choice="'+o()+'"]',n).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(o,n,r){o.czrInputMap=o.czrInputMap||{},n.extend(o.czrInputMap,{reset_button:function(e){this.container.on("click","[data-sek-reset-scope]",function(e,t){e.stopPropagation();var i=n(this).data("sek-reset-scope");!r.isEmpty(i)&&r.contains(["local","global"],i)?o.czr_sektions.updateAPISetting({action:"sek-reset-collection",scope:i}).done(function(e){o.previewer.refresh(),o.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}).fail(function(e){o.errare("reset_button input => error when firing ::updateAPISetting",e),o.previewer.trigger("sek-notify",{notif_id:"reset-failed",type:"error",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset failed"],"<br/>","<i>"+e+"</i>","</strong>","</span>"].join("")})}):o.errare("reset_button input => invalid scope provided.",i)})}})}(wp.customize,jQuery,_),function(i,r,s){i.czrInputMap=i.czrInputMap||{},r.extend(i.czrInputMap,{revision_history:function(e){var n=this;_selected_found=!1;var t=function(t){!0!==n.revisionHistorySet&&(r.when(r.Deferred(function(t){s.isEmpty(n.sek_revisionHistory)?i.czr_sektions.getRevisionHistory({is_local:"local_revisions"===n.id}).done(function(e){if(!s.isObject(e))throw new Error("_getRevisionHistory => server list is not a object");n.sek_revisionHistory=e,t.resolve(n.sek_revisionHistory)}).fail(function(e){t.reject(e)}):t.resolve(n.sek_revisionHistory)})).done(function(e){!function(e){if(!(0<n.container.find(".sek-revision-history").length))if(s.isEmpty(e))n.container.append(["<i>",sektionsLocalizedData.i18n["No revision history available for the moment."],"</i>"].join(""));else{n.container.append(r("<select/>",{class:"sek-revision-history",html:['<option value="_select_">'," -",sektionsLocalizedData.i18n.Select,"- ","</option>"].join("")}));var o=[];s.each(e,function(e,t){var i={value:t,html:e};i.value==n()&&(r.extend(i,{selected:"selected"}),_selected_found=!0),o.unshift(r("<option>",i))}),o[0].html([o[0].html(),sektionsLocalizedData.i18n["(currently published version)"]].join(" ")),s.each(o,function(e){r("select.sek-revision-history",n.container).append(e)}),r("select.sek-revision-history",n.container).selecter()}}(e),t&&!0===t.open_on_init&&s.delay(function(){try{r("select[data-czrtype]",n.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){i.errare("_getRevisionHistory => fail response =>",e)}),n.revisionHistorySet=!0)};n.container.on("change",".sek-revision-history",function(){var e=r(this).val();"_select_"!==e&&i.czr_sektions.setSingleRevision({revision_post_id:e,is_local:"local_revisions"===n.id})}),s.delay(function(){t({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(p,_,m){p.czrInputMap=p.czrInputMap||{},_.extend(p.czrInputMap,{nimble_tinymce_editor:function(){var t=this,e=t.container.find("textarea").first(),i=0<e.length?e.attr("id"):null,o=p.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type),n=sektionsLocalizedData.defaultToolbarBtns;if(m.isNull(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => missing textarea for module :"+t.module.id);if(tinyMCE.get(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => duplicate editor id.");var r,s,a=function(){return o&&o.editor_params&&!0===o.editor_params.autop},c={tinymce:{toolbar1:function(){var e=n.split(",");if(o.editor_params&&m.isArray(o.editor_params.excludedBtns)){var t=o.editor_params.excludedBtns;e=m.filter(e,function(e){return!m.contains(t,e)})}if(o.editor_params&&m.isString(o.editor_params.includedBtns)){var i=o.editor_params.includedBtns;m.isEmpty(i)||!m.isArray(sektionsLocalizedData[i])?p.errare("nimble_tinymce_editor input => invalid set of buttons provided",i):(i=sektionsLocalizedData[i],e=m.filter(e,function(e){return m.contains(i,e)}))}return e.join(",")}(),content_css:(r=wp.editor.getDefaultSettings(),s=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],r&&r.tinymce&&r.tinymce.content_css&&(s=m.union(r.tinymce.content_css.split(","),s)),s.join(",")),min_height:40,height:o.editor_params&&m.isNumber(o.editor_params.height)?o.editor_params.height:p.czr_sektions.TINYMCE_EDITOR_HEIGHT},quicktags:{buttons:"strong,em,link,code"},mediaButtons:!o.editor_params||!1!==o.editor_params.media_button};c.tinymce.wpautop=a(),a()||(c.tinymce.forced_root_block=""),wp.editor.initialize(i,c);var l=tinyMCE.get(i);if(!l)throw new Error("setupTinyMceEditor => missing editor instance for module :"+t.module.id);p.czrActiveWPEditors=p.czrActiveWPEditors||[];var d=_.extend(!0,[],p.czrActiveWPEditors);d.push(i),p.czrActiveWPEditors=d;var u=function(){e.html(t()),l.setContent(t())};l.initialized?u():l.on("init",u),l.on("input change keyup",function(e){t(l.getContent())})},detached_tinymce_editor:function(){var e,t=this,i=_("textarea#"+sektionsLocalizedData.idOfDetachedTinyMceTextArea),o=p.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type);if(!(0<i.length))throw new Error("api.czrInputMap::detached_tinymce_editor => missing textarea element");if(e=i.attr("id"),window.tinymce&&(mceInstance=window.tinymce.get(e),mceInstance&&mceInstance.remove()),!window.nimbleTinyMCEPreInit||!window.nimbleTinyMCEPreInit.mceInit||!window.nimbleTinyMCEPreInit.mceInit[e])throw new Error("setupDetachedTinyMceEditor => invalid nimbleTinyMCEPreInit global var");var n,r,s=nimbleTinyMCEPreInit.mceInit[e];s.content_css=(n=wp.editor.getDefaultSettings(),r=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],n&&n.tinymce&&n.tinymce.content_css&&(r=m.union(n.tinymce.content_css.split(","),r)),r.join(","));var a=t.input_parent,c=function(){var e=a();return m.isUndefined(e.autop)?o&&o.editor_params&&!0===o.editor_params.autop:e.autop};s.wpautop=c(),c()||(s.forced_root_block=""),s.toolbar1=sektionsLocalizedData.defaultToolbarBtns,s.toolbar2="",window.tinymce.init(s),window.QTags.getInstance(e);var l=tinyMCE.get(e);if(!l)throw new Error("setupDetachedTinyMceEditor => missing editor instance for module :"+t.module.id);var d=function(){var e=t();l.setContent(e),p.sekEditorExpanded(!0),_(window).trigger("resize")};l.initialized?d():l.on("init",d),l.on("input change keyup keydown click SetContent BeforeSetContent",function(e){t(c()?l.getContent():wp.editor.removep(l.getContent()))}),p.sekCurrentDetachedTinyMceInput=t,i.data("czr-bound-for-detached-editor")||(i.on("input",function(e,t){p.sekCurrentDetachedTinyMceInput(_(this).val())}),i.data("czr-bound-for-detached-editor",!0))}})}(wp.customize,jQuery,_),function(l,d,u){l.czrInputMap=l.czrInputMap||{},d.extend(l.czrInputMap,{import_export:function(){var r=this,t=r.container.find('button[data-czr-action="sek-pre-import"]'),s=r.container.find("input[name=sek-import-file]"),e=l.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=e.scope,c="local"===e.scope?l.czr_sektions.localSectionsSettingId():l.czr_sektions.getGlobalSectionsSettingId();u.contains(["local","global"],a)||l.errare("api.czrInputMap.import_export => invalid currentScope",a),s.on("change",function(e){t.toggleClass("disabled",u.isEmpty(d(this).val()))});r.container.on("click","[data-czr-action]",function(e){var i,t;switch(e.stopPropagation(),d(this).data("czr-action")){case"sek-export":if(i=!1,t=wp.customize.dirtyValues(),u.isEmpty(t)||u.each(t,function(e,t){i||(i=-1!==t.indexOf("nimble"))}),i){alert(sektionsLocalizedData.i18n["You need to publish before exporting."]);break}var o=l(c)(),n=!0;if(u.each(o.collection,function(e){n&&(u.isEmpty(e.collection)||(n=!1))}),n){alert(sektionsLocalizedData.i18n["Nothing to export."]);break}l.czr_sektions.export_template({scope:a});break;case"sek-pre-import":if(u.isEmpty(l.czr_sektions.activeLocations())){alert(sektionsLocalizedData.i18n["The current page has no available locations to import Nimble Builder sections."]);break}l.czr_sektions.import_template_from_file({pre_import_check:!0,input:r,file_input:s}).done(function(e){l.czr_sektions.pre_checks_from_file_import(e,{pre_import_check:!1,input:r,file_input:s})}).fail(function(e){l.errare("import_export_ input => pre_checks_from_file_import failed",e),l.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s}),l.czr_sektions.import_template_from_file({input:r,file_input:s})});break;case"sek-import-as-is":l.czr_sektions.import_template_from_file({input:r,file_input:s});break;case"sek-import-assign":l.czr_sektions.import_template_from_file({assign_missing_locations:!0,input:r,file_input:s});break;case"sek-cancel-import":l.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s})}})}})}(wp.customize,jQuery,_),function(c,l,d){c.czrInputMap=c.czrInputMap||{},l.extend(c.czrInputMap,{simpleselect:function(e){c.czr_sektions.setupSelectInput.call(this,e)},multiselect:function(e){c.czr_sektions.setupSelectInput.call(this,e)},simpleselectWithDeviceSwitcher:function(e){var r=this,t=(r.input_parent,r.module,c.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type)),n=l("select",r.container),s=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i={params:e=d.isEmpty(e)?t.choices:e};if(r.module.trigger("nimble-set-select-input-options",i),e=i.params,!d.isEmpty(e)&&d.isObject(e)){d.each(e,function(e,t){var i={value:t,html:e};t==r()?l.extend(i,{selected:"selected"}):"px"===t&&l.extend(i,{selected:"selected"}),n.append(l("<option>",i))});var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var o=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&o<i.length?a(e,i[o+1]):l.extend(!0,{desktop:""},s).desktop};c.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r),n.on("change",function(e,t){var i,o=c.previewedDevice()||"desktop",n=l(this).val();(i=l.extend(!0,{},d.isObject(r())?r():{}))[o]=l.extend(!0,{},i[o]||{}),d.isString(n)&&!d.isEmpty(n)&&(i[o]=n),(d.isEmpty(t)||d.isObject(t)&&!0!==t.previewed_device_switched)&&r(i)}),r.previewedDevice.bind(function(e){try{!function(e){var t=r(),i={};i=l.extend(!0,{},s),d.isObject(t)?i=l.extend(!0,{},t):d.isString(t)&&!d.isEmpty(t)&&(i={desktop:t});var o=a(i,e);n.val(o).trigger("change",{previewed_device_switched:!0})}(e)}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type "+r.type+" for input id "+r.id,e)}})}else c.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+r.id+" in module "+r.module.module_type)}})}(wp.customize,jQuery,_),function(a,c,l){a.czrInputMap=a.czrInputMap||{},c.extend(a.czrInputMap,{category_picker:function(e){var o=this,n=c("select[data-czrtype]",o.container),r=function(){var e=o();return e=l.isString(e)?[e]:e,l.isArray(e)?e:[]},t=function(t){!0!==o.catCollectionSet&&(c.when(c.Deferred(function(i){l.isEmpty(a.czr_sektions.post_categories)?wp.ajax.post("sek_get_post_categories",{nonce:a.settings.nonce.save}).done(function(e){l.isArray(e)||a.errare(o.id+" => error => invalid category collection sent by server");var t={};l.each(e,function(e){l.isEmpty(e.slug)||l.isEmpty(e.name)?i.reject("missing slug or name for at least one category"):t[e.slug]=e.name}),a.czr_sektions.post_categories=t,i.resolve(a.czr_sektions.post_categories)}).fail(function(e){i.reject(e)}):i.resolve(a.czr_sektions.post_categories)})).done(function(e){i(e),t&&!0===t.open_on_init&&l.delay(function(){try{n.czrSelect2("open")}catch(e){}},100)}).fail(function(e){a.errare(o.id+" => fail response when _getCategoryCollection()",e)}),o.catCollectionSet=!0)},i=function(e){l.each(e,function(e,t){var i={value:t,html:e};l.contains(r(),t)&&c.extend(i,{selected:"selected"}),n.append(c("<option>",i))}),n.czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),n.on("change",function(){0===c(this).find("option:selected").length&&o([])})},s={};l.each(r(),function(e){s[e]=(e+"").replace(/-/g," ")}),i(s),o.container.on("click",function(){!0!==o.catCollectionSet&&(n.czrSelect2("destroy"),c.when(n.find("option").remove()).done(function(){t({open_on_init:!0})}))})}})}(wp.customize,jQuery,_),function(r,s,e){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{grid_layout:function(e){var o=this,n=s(".sek-grid-layout-wrapper",o.container);n.find('input[type="hidden"]').val(o()),n.on("click","[data-sek-grid-layout]",function(e,t){var i;e.stopPropagation(),n.find("[data-sek-grid-layout]").removeClass("selected").attr("aria-pressed",!1),s(this).addClass("selected").attr("aria-pressed",!0);try{i=s(this).data("sek-grid-layout")}catch(e){r.errare(o.type+" => error when attaching click event",e)}o(i)}),s('[data-sek-grid-layout="'+o()+'"]',n).trigger("click")}})}(wp.customize,jQuery,_),function(i,e,t){i.czrInputMap=i.czrInputMap||{},e.extend(i.czrInputMap,{refresh_preview_button:function(e){this.container.on("click",".sek-refresh-button",function(e,t){e.stopPropagation(),i.previewer.refresh()})}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_content_type_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_content_type_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_module_picker_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_module_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_module_picker_module"))}})}(wp.customize,jQuery,_),function(t,e,i){t.czrModuleMap=t.czrModuleMap||{};var o=sektionsLocalizedData.presetSectionsModules;i.isArray(o)&&!i.isEmpty(o)?i.each(o,function(e){t.czrModuleMap[e]={crud:!1,name:t.czr_sektions.getRegisteredModuleProperty(e,"name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData(e))}}):t.errare("api.czrModuleMap => error when adding section modules")}(wp.customize,jQuery,_),function(a,o,c){var e={initialize:function(e,t){this.inputConstructor=a.CZRInput.extend({initialize:function(e,t){var i=this;a.CZRInput.prototype.initialize.call(i,e,t),i.isReady.then(function(){i.renderUserSavedSections(),i.attachDomEvents()})},getUserSavedSections:function(){var t=o.Deferred();return c.isEmpty(a.czr_sektions.userSavedSections)?a.czr_sektions.getSavedSectionCollection().done(function(e){t.resolve(e)}):t.resolve(a.czr_sektions.userSavedSections),t.promise()},renderUserSavedSections:function(){var n=this,r="",s=n.container.find(".sek-content-type-wrapper"),t=function(e){if(s.find(".sek-user-section-wrapper").remove(),c.isEmpty(e)){var t=[sektionsLocalizedData.baseUrl,"/assets/admin/img/save_section_notice.png","?ver=",sektionsLocalizedData.nimbleVersion].join(""),i="https://docs.presscustomizr.com/article/417-how-to-save-and-reuse-sections-with-nimble-builder";r=['<div class="sek-user-section-wrapper">','<img src="'+t+'" />','<br/><a href="'+i+'" target="_blank" rel="noreferrer nofollow">'+i+"</a>","</div>"].join(""),s.append(r),n.module.container.find(".czr-item-content .customize-control-title").html(sektionsLocalizedData.i18n["You did not save any section yet."])}else{var o="background: url("+[sektionsLocalizedData.baseUrl,"/assets/admin/img/nb_sec_pholder.png","?ver=",sektionsLocalizedData.nimbleVersion].join("")+") 50% 50% / cover no-repeat;";c.each(e,function(e,t){c.isEmpty(e.description)?_titleAttr=[e.title,e.last_modified_date].join(" | "):_titleAttr=[e.title,e.last_modified_date,e.description].join(" | "),r=['<div class="sek-user-section-wrapper">','<div draggable="true" data-sek-is-user-section="true" data-sek-section-type="content" data-sek-content-type="preset_section" data-sek-content-id="'+t+'" style="" title="'+e.title+'">','<div class="sek-sec-thumb" style="'+o+'"></div>','<div class="sek-overlay"></div>','<div class="sek-sec-info" title="'+_titleAttr+'">','<h3 class="sec-title">'+e.title+"</h3>",'<p class="sec-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",'<p class="sec-desc">'+e.description+"</p>",'<i class="material-icons edit-user-sec" title="'+sektionsLocalizedData.i18n["Edit this template"]+'">edit</i>','<i class="material-icons remove-user-sec" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>',"</div>","</div>","</div>"].join(""),s.append(r)})}s.find(".czr-css-loader").remove(),a.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:n.container})};s.append('<div class="czr-css-loader czr-mr-loader" style="display:block"><div></div><div></div><div></div></div>'),n.getUserSavedSections().done(function(e){t(e)}),a.czr_sektions.allSavedSections.bind(function(e){t(e)})},attachDomEvents:function(){this.container.on("click",".sek-sec-info .remove-user-sec",function(e){e.preventDefault();var t=a.czr_sektions;t.saveSectionDialogVisible(!1);var i=function(e){t.saveSectionDialogMode("remove"),t.saveSectionDialogMode.unbind(i)};t.userSectionToRemove=o(this).closest("[data-sek-content-id]").data("sek-content-id"),t.saveSectionDialogMode.bind(i),t.saveSectionDialogVisible(!0)}).on("click",".sek-sec-info .edit-user-sec",function(e){e.preventDefault();var t=a.czr_sektions;t.saveSectionDialogVisible(!1);var i=function(e){t.saveSectionDialogMode("edit"),t.saveSectionDialogMode.unbind(i)};t.userSectionToEdit=o(this).closest("[data-sek-content-id]").data("sek-content-id"),t.saveSectionDialogMode.bind(i),t.saveSectionDialogVisible(!0)})}}),a.CZRDynModule.prototype.initialize.call(this,e,t)}};a.czrModuleMap=a.czrModuleMap||{},o.extend(a.czrModuleMap,{sek_my_sections_sec_picker_module:{mthds:e,crud:!1,name:a.czr_sektions.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:a.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_my_sections_sec_picker_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_mod_option_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_mod_option_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_mod_option_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_anchor_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_anchor_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_anchor_module"))}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"bg-image":s.each(["bg-attachment","bg-scale","bg-repeat","bg-parallax","bg-parallax-force"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"bg-parallax-force":e=!s.isEmpty(i()+"")&&r.CZR_Helpers.isChecked(o.czr_Input("bg-parallax")());break;case"bg-scale":case"bg-repeat":e=!s.isEmpty(i()+"")&&!r.CZR_Helpers.isChecked(o.czr_Input("bg-parallax")());break;default:e=!s.isEmpty(i()+"")}return e})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-apply-overlay":s.each(["bg-color-overlay","bg-opacity-overlay"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return r.CZR_Helpers.isChecked(i())})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-parallax":s.each(["bg-parallax-force","bg-scale","bg-repeat"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"bg-parallax-force":e=!s.isEmpty(o.czr_Input("bg-image")()+"")&&r.CZR_Helpers.isChecked(i());break;case"bg-repeat":case"bg-scale":e=!s.isEmpty(o.czr_Input("bg-image")()+"")&&!r.CZR_Helpers.isChecked(i())}return e})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}}),i.bind(function(e){r.CZR_Helpers.isChecked(i())&&r.CZR_Helpers.isChecked(o.czr_Input("bg-attachment")())&&o.czr_Input("bg-attachment").container.find("input[type=checkbox]").trigger("click")});break;case"bg-attachment":i.bind(function(e){r.CZR_Helpers.isChecked(i())&&r.CZR_Helpers.isChecked(o.czr_Input("bg-parallax")())&&o.czr_Input("bg-parallax").container.find("input[type=checkbox]").trigger("click")});break;case"bg-use-video":s.each(["bg-video","bg-video-loop","bg-video-delay-start","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return r.CZR_Helpers.isChecked(i())})}catch(e){r.errare(n.id+" => error in setInputVisibilityDeps",e)}})}}),n.control&&n.control.params&&n.control.params.sek_registration_params&&(s.contains(["section","column"],n.control.params.sek_registration_params.level)||s.each(["bg-use-video","bg-video","bg-video-loop","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){o.czr_Input(e).visible(!1)}))}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{sek_level_bg_module:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("sek_level_bg_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:s.extend({id:"",title:""},r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_bg_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_text_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_text_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_text_module")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_border_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_border_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_border_module"))}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":n.each(["custom-breakpoint","apply-to-all"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_breakpoint_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_breakpoint_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_breakpoint_module"))}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":n.each(["custom-height","overflow_hidden"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_height_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_height_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_height_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_visibility_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_visibility_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_visibility_module"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"width-type":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"custom-width",function(){return"custom"===e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_module"))}})}(wp.customize,jQuery,_),function(d,u,p){var e={initialize:function(e,t){var i=this;i.inputConstructor=d.CZRInput.extend(i.CZRInputConstructor||{}),i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputConstructor:{range_simple:function(e){var t,i=this,o=u(".sek-range-with-unit-picker-wrapper",i.container),n=o.find('input[type="number"]'),r=o.find('input[type="range"]');try{t=i.module.control.params.sek_registration_params}catch(e){return void d.errare("Error when getting the module registration params",e)}if(p.isUndefined(t.level_id))d.errare("Error : missing column id",er);else if(i.columnId=t.level_id,i.columnModel=u.extend(!0,{},d.czr_sektions.getLevelModel(i.columnId)),i.parentSectionModel=d.czr_sektions.getParentSectionFromColumnId(i.columnId),"no_match"!=i.columnModel)if("no_match"!=i.parentSectionModel){i.colNb=p.size(i.parentSectionModel.collection),n.attr("data-sek-width-range-column-id",i.columnId),1===i.colNb?i.container.html(["<p>",sektionsLocalizedData.i18n["This is a single-column section with a width of 100%. You can act on the internal width of the parent section, or adjust padding and margin."]].join("")):i.container.show();var s,a=d.czr_sektions.getLevelModel(i.columnId),c="_not_set_";if("no_match"!=a){var l=a.options&&a.options.width&&a.options.width["custom-width"]&&p.isNumber(+a.options.width["custom-width"]);l?c=a.options.width["custom-width"]:!l&&a.width&&p.isNumber(+a.width)&&(c=a.width),s="_not_set_"!==c?c:"_not_set_"===i()?Math.floor(100/i.colNb):i(),s=1*+parseFloat(s).toFixed(3),(!p.isNumber(s)||100<s||s<0)&&(d.errare("Error => invalid column width",s),s=50),r.on("input",function(e,t){n.val(u(this).val()).trigger("input",t)}),n.on("input",p.debounce(function(e,t){r.val(u(this).val()),t&&t.is_init||i(+parseFloat(u(this).val()).toFixed(3))},300)),n.on("input",p.debounce(function(e,t){t&&(t.is_init||t.is_resize_column_trigger)||i.sayItToApi(u(this).val())},300)),r.val(s).trigger("input",{is_init:!0})}else d.errare("sek_level_width_column module => invalid column model")}else d.errare("sek_level_width_column module => invalid parent section model");else d.errare("sek_level_width_column module => invalid column model")},sayItToApi:function(e,t){var i=this,o=p.findIndex(i.parentSectionModel.collection,{id:i.columnId}),n=o+1==i.colNb?o-1:o+1,r=p.find(i.parentSectionModel.collection,function(e,t){return n===t});"no_match"===r&&d.errare("sek_level_width_column module => invalid sister column model"),d.previewer.trigger("sek-resize-columns",{action:"sek-resize-columns",level:"column",in_sektion:i.parentSectionModel.id,id:i.columnId,resized_column:i.columnId,sister_column:r.id,resizedColumnWidthInPercent:e,col_number:i.colNb})}}};d.czrModuleMap=d.czrModuleMap||{},u.extend(d.czrModuleMap,{sek_level_width_column:{mthds:e,crud:!1,name:d.czr_sektions.getRegisteredModuleProperty("sek_level_width_column","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:p.extend({id:"",title:""},d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_column"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_section:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_section","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_section"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_spacing_module:{mthds:"",crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_spacing_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_spacing_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_cust_css_section:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_cust_css_section","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_cust_css_section"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this.module;i.trigger("nb_setup_visibility_deps_for_animation_module",{item:this,module:e})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_animation_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_animation_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_animation_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_template:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_template","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_template"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_local_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_local_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_custom_css:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_custom_css","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_custom_css"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_header_footer"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_imp_exp"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"links_underline":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"links_underline_hover",function(){return!e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_text:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_text","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_text"))}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":n.each(["global-custom-breakpoint","apply-to-all"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_global_breakpoint:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_global_breakpoint","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_breakpoint"))}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_header_footer"))}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"enable":s.each(["public_key","private_key","badge","show_failure_message","failure_message","score"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"failure_message":e=i()&&o.czr_Input("show_failure_message")();break;default:e=i()}return e})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_failure_message":s.each(["failure_message"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&o.czr_Input("enable")()})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{sek_global_recaptcha:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("sek_global_recaptcha","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:s.extend({id:"",title:""},r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_recaptcha"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_imp_exp"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_beta_features:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_beta_features","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_beta_features"))}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,t=o.module;o.czr_Input.each(function(i){switch(i.id){case"img":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"img-size",function(){return!r.isEmpty(i()+"")&&r.isNumber(i())});break;case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!r.contains(["no-link","img-lightbox"],i())}return e})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"border-type":r.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"none"!==i()})}catch(e){n.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"use_custom_width":r.each(["custom_width"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_height":r.each(["custom_height"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_title_attr":r.each(["heading_title"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Image module => error in setInputVisibilityDeps",e)}})}}),n.trigger("nb_setup_visibility_deps_for_img_module",{item:o,module:t})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_image_main_settings_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_image_main_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_main_settings_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_image_borders_corners_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_image_borders_corners_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_borders_corners_child")}})}(wp.customize,jQuery,_),function(o,e,t){var i={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend(this.CZRTextEditorInputMths||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRTextEditorInputMths:{initialize:function(e,t){var i=this;"detached_tinymce_editor"==i.type&&i.isReady.then(function(){i.container.find('[data-czr-action="open-tinymce-editor"]').trigger("click")}),o.CZRInput.prototype.initialize.call(i,e,t)}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_tinymce_child:{mthds:i,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_tinymce_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_tinymce_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_html_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_html_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_html_module")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(i){switch(i.id){case"img-type":n.each(["img-id","img-size"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img-id":e="custom"===i();break;default:e="none"!==i()}return e})}catch(e){o.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"content-type":n.each(["content-custom-text"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"custom"===i()})}catch(e){o.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"btn-display":n.each(["btn-custom-text"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_featured_pages_module:{mthds:t,crud:o.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","is_crud"),hasPreItem:!1,refresh_on_add_item:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_featured_pages_module")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":s.each(["link-pick-url","link-custom-url","link-target"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":r.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"use_custom_color_on_hover":s.each(["color_hover"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_icon_settings_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_icon_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_settings_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_icon_spacing_border_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_icon_spacing_border_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_spacing_border_child")}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this;o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e=i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;case"link-pick-url":case"link-target":e=i()}return e})}catch(e){n.errare("Heading module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&!0===o.czr_Input("link-to")()})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_heading_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_heading_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_heading_spacing_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_heading_spacing_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_spacing_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_divider_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_divider_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_divider_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_spacer_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_spacer_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_spacer_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_map_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_map_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_map_module")}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRButtonItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"quote_design":o.each(["border_width_css","border_color_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"border-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}}),o.each(["icon_color_css","icon_size_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"quote-icon-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_quote_design_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_quote_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_design_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_quote_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_quote_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_quote_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_cite_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_cite_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_cite_child")}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this;o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"icon":n.czr_sektions.scheduleVisibilityOfInputId.call(i,"icon-side",function(){return!r.isEmpty(i())})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_btn_content_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_btn_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_content_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":n.each(["bg_color_hover"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":n.each(["push_effect"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"width-type":o.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-width",function(){return"custom"===t()}),n.each(["custom-width","h_inner_align_css"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"height-type":o.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-height",function(){return"custom"===t()})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_btn_design_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_btn_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_design_child")}})}(wp.customize,jQuery,_),function(n,e,r){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this.module;this.czr_Input.each(function(i){switch(i.id){case"layout":r.each(["columns","img_column_width","has_tablet_breakpoint","has_mobile_breakpoint"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"columns":e="grid"===i();break;case"has_tablet_breakpoint":case"has_mobile_breakpoint":case"img_column_width":e="list"===i()}return e})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"categories":r.each(["must_have_all_cats"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){var e=i();return r.isArray(e)&&1<e.length})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"display_pagination":r.each(["posts_per_page","post_number"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"posts_per_page"===e?i():!i()})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"custom_grid_spaces":r.each(["column_gap","row_gap"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_excerpt":r.each(["excerpt_length"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_post_grid_main_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_post_grid_main_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_main_child")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var o=this,n=o.module;o.czr_Input.each(function(i){switch(i.id){case"show_thumb":s.each(["img_size","img_has_custom_height","img_height","border_radius_css","use_post_thumb_placeholder"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img_height":e=i()&&o.czr_Input("img_has_custom_height")();break;default:e=i()}return e})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"img_has_custom_height":s.each(["img_height"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&o.czr_Input("show_thumb")()})}catch(e){r.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_post_grid_thumb_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_post_grid_thumb_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_thumb_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_metas_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_metas_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_metas_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_content_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_content_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_mobile_options:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_mobile_options","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_mobile_options")}})}(wp.customize,jQuery,_),function(i,e,o){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"show_name_field":o.each(["name_field_label","name_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_subject_field":o.each(["subject_field_label","subject_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_message_field":o.each(["message_field_label","message_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_privacy_field":o.each(["privacy_field_label","privacy_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,"link-custom-url",function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_simple_form_fields_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fields_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fields_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_simple_form_design_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_simple_form_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_design_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":n.each(["bg_color_hover"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"border-type":n.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":n.each(["push_effect"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_simple_form_button_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_simple_form_button_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_button_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_submission_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_submission_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_submission_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_font_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_font_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_font_child")}})}(wp.customize,jQuery,_),function(i,e,t){var o={initialize:function(e,t){this.bind("nimble-set-select-input-options",function(e){e.params=sektionsLocalizedData.registeredWidgetZones}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_widget_area_module:{mthds:o,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_widget_area_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_widget_area_module")}})}(wp.customize,jQuery,_),function(s,a,c){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=s.CZRItem.extend(i.CZRItemConstructor||{}),s.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return s.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&a.fn.sortable){var i=this;a("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){c.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!c.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){s.errorLog("item.setInputVisibilityDeps() : "+e)}}),s.CZRItem.prototype.ready.call(t)},_buildTitle:function(e,t,i){var o=this.module;return e=e||("string"==typeof t?s.CZR_Helpers.capitalize(t.replace("fa-","")):""),e=s.CZR_Helpers.truncate(e,20),'<div><span class="'+t+'" style="color:'+(i=i||o.defaultSocialColor)+'"></span> '+e+"</div>"},writeItemViewTitle:function(e){var t=this.module,i=e||this(),o=(i.icon?i.icon:"").replace("fa-","").replace("envelope","email").replace("far","").replace("fab","").replace("fas","");a("."+t.control.css_attr.item_title,this.container).html(this._buildTitle(o,i.icon,i.color_css))},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_color_on_hover":c.each(["social_color_hover"],function(e){try{s.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){s.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,o=c.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),o=c.without(o,c.findWhere(o,{id:t.id})),i.itemCollection.set(o),i.trigger("pre_item_api_remove",t());var n=a.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=s(i.control.id).transport||!c.has(e,"dom_event")||c.has(e.dom_event,"isTrigger")||s.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",n),i.control.trigger("item-removed",n);else{var r=function(){s.previewer.unbind("ready",r),i.trigger("item-removed",n)};s.previewer.bind("ready",r)}}}};s.czrModuleMap=s.czrModuleMap||{},a.extend(s.czrModuleMap,{czr_social_icons_settings_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:s.czr_sektions.getRegisteredModuleProperty("czr_social_icons_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:s.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_settings_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_social_icons_style_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_social_icons_style_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_style_child")}})}(wp.customize,jQuery,_),function(g,h,v){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=g.CZRItem.extend(i.CZRItemConstructor||{}),g.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return g.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&h.fn.sortable){var i=this;h("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){v.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","starting_value"),t=h.extend(!0,{},this.preItem());if(v.isObject(e)){var i=h.extend(!0,{},e);return h.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!v.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){g.errorLog("item.setInputVisibilityDeps() : "+e)}}),g.CZRItem.prototype.ready.call(t);var i=function(){g.previewer.send("sek-item-focus",{control_id:t.module.control.id,item_id:t.id,item_value:t()})};t.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),t.callbacks.add(i),t.bind("sek-request-item-focus-in-preview",i)},writeItemViewTitle:function(e,t){var i=this,o=i.module,n=e||i(),r="",s="",a="not_set",c=!v.isUndefined(t)&&v.isObject(t);if(!c||!t.input_changed||v.contains(["img","text_content"],t.input_changed)){if(v.isEmpty(n.title)){var l=v.findIndex(o.itemCollection(),function(e){return e.id===i.id});l=v.isUndefined(l)?1:l+1}else r=n.title;r=g.CZR_Helpers.truncate(r,15),n.img&&(s=n.img,v.isString(n.img)&&(s=-1!==n.img.indexOf("http")?n.img:parseInt(n.img,10)));var d=function(){return h.Deferred(function(){var e=this;v.isUndefined(s)||v.isEmpty(""+s)?e.resolve(""):v.isString(s)&&-1!==s.indexOf("http")?e.resolve(s):wp.media.attachment(s).fetch().always(function(){if(v.isObject(this)&&v.has(this,"attributes")&&v.has(this.attributes,"sizes")){var i=this.get("sizes");i&&v.isObject(i)&&v.each(["thumbnail","medium","large","full"],function(e,t){"not_set"===a&&i[e]&&v.isObject(i[e])&&i[e].url&&(a=i[e].url)}),e.resolve(a)}})}).promise()},u=h("."+o.control.css_attr.item_title,i.container).find(".sek-slide-title"),p=h("."+o.control.css_attr.item_title,i.container).find(".sek-slide-thumb"),_=n.text_content?n.text_content:"";_=(_=h("<div>").html(_).text()).substring(0,60),u.length<1?(h("."+o.control.css_attr.item_title,i.container).html(""),h("."+o.control.css_attr.item_title,i.container).append(h("<div/>",{class:"sek-slide-title",html:_}))):u.html(_);var m=c&&t.input_changed&&"img"===t.input_changed,f=function(e){return v.isEmpty(""+e)||"not_set"===e?"":'<img src="'+e+'" width="32" alt="'+r+'" />'};h("."+o.control.css_attr.item_title,i.container).css("padding","0 4px"),p.length<1?d().done(function(e){h("."+o.control.css_attr.item_title,i.container).prepend(h("<div/>",{class:"sek-slide-thumb",html:f(e)}))}):!m&&c||d().done(function(e){p.html(f(e))})}},setInputVisibilityDeps:function(){var o=this,t=o.module;o.czr_Input.each(function(i){switch(i.id){case"link-to":v.each(["link-pick-url","link-custom-url","link-target"],function(t){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==o.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!v.contains(["no-link"],i())}return e})}catch(e){g.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":g.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==o.czr_Input("link-to")()});break;case"apply-overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"enable_text":v.each(["text_content","font_family_css","font_size_css","line_height_css","color_css","h_alignment_css","v_alignment","spacing_css"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"apply_overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,o=v.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),o=v.without(o,v.findWhere(o,{id:t.id})),i.itemCollection.set(o),i.trigger("pre_item_api_remove",t());var n=h.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=g(i.control.id).transport||!v.has(e,"dom_event")||v.has(e.dom_event,"isTrigger")||g.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",n),i.control.trigger("item-removed",n);else{var r=function(){g.previewer.unbind("ready",r),i.trigger("item-removed",n)};g.previewer.bind("ready",r)}}}};g.czrModuleMap=g.czrModuleMap||{},h.extend(g.czrModuleMap,{czr_img_slider_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:g.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_collection_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=o.CZRItem.extend(i.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":n.each(["custom-height"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"autoplay":n.each(["autoplay_delay","pause_on_hover"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return o.CZR_Helpers.isChecked(t())})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_img_slider_opts_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_img_slider_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_opts_child")}})}(wp.customize,jQuery,_),function(d,u,p){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return d.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&u.fn.sortable){var i=this;u("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){p.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","starting_value"),t=u.extend(!0,{},this.preItem());if(p.isObject(e)){var i=u.extend(!0,{},e);return u.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var e=this;d.CZRItem.prototype.ready.call(e);var i=function(){d.previewer.send("sek-item-focus",{control_id:e.module.control.id,item_id:e.id,item_value:e()})};e.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),e.callbacks.add(i),e.bind("sek-request-item-focus-in-preview",i),e.module.bind("item-collection-sorted",function(){e.writeItemViewTitle(e(),{input_changed:"title_text"})})},writeItemViewTitle:function(e,t){var i=this,o=i.module,n=e||i(),r="";if(!(!p.isUndefined(t)&&p.isObject(t))||!t.input_changed||p.contains(["title_text"],t.input_changed)){if(p.isEmpty(n.title)){var s=p.findIndex(o.itemCollection(),function(e){return e.id===i.id});s=p.isUndefined(s)?1:s+1}else r=n.title;r=d.CZR_Helpers.truncate(r,25);var a=u("."+o.control.css_attr.item_title,i.container).find(".sek-accord-title"),c=n.title_text?n.title_text:"";c=u("<div>").html(c).text();var l=i.module.container.find(".czr-items-wrapper > li").index(i.container);c=(c=p.isEmpty(c)?sektionsLocalizedData.i18n["Accordion title"]+" #"+(+l+1):c).substring(0,60),a.length<1?(u("."+o.control.css_attr.item_title,i.container).html(""),u("."+o.control.css_attr.item_title,i.container).append(u("<div/>",{class:"sek-accord-title",html:c}))):a.html(c)}},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,o=p.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),o=p.without(o,p.findWhere(o,{id:t.id})),i.itemCollection.set(o),i.trigger("pre_item_api_remove",t());var n=u.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=d(i.control.id).transport||!p.has(e,"dom_event")||p.has(e.dom_event,"isTrigger")||d.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",n),i.control.trigger("item-removed",n);else{var r=function(){d.previewer.unbind("ready",r),i.trigger("item-removed",n)};d.previewer.bind("ready",r)}}}};d.czrModuleMap=d.czrModuleMap||{},u.extend(d.czrModuleMap,{czr_accordion_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_collection_child")}})}(wp.customize,jQuery,_),function(o,e,t){var i={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=o.CZRItem.extend(i.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){o.CZRItem.prototype.ready.call(this)}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_accordion_opts_child:{mthds:i,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_accordion_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_opts_child")}})}(wp.customize,jQuery,_),function(o,e,n){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRButtonItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_flex":n.each(["h_alignment_css"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_shortcode_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_shortcode_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_shortcode_module")}})}(wp.customize,jQuery,_);
|
assets/front/js/partials/menu-module.js
CHANGED
@@ -41,7 +41,14 @@
|
|
41 |
$( '.sek-nav .children, .sek-nav .sub-menu' ).addClass( ClassName.DROPDOWN );
|
42 |
$( '.sek-nav-wrap .page_item_has_children' ).addClass( ClassName.PARENTS );
|
43 |
$( '.sek-nav' + ' .' + ClassName.DROPDOWN + ' .' + ClassName.PARENTS ).addClass( ClassName.DROPDOWN_SUBMENU );
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
//Handle dropdown on hover via js
|
46 |
var dropdownMenuOnHover = function() {
|
47 |
var _dropdown_selector = Selector.HOVER_PARENT;
|
@@ -49,11 +56,15 @@
|
|
49 |
enableDropdownOnHover();
|
50 |
|
51 |
function _addOpenClass( evt ) {
|
|
|
52 |
var $_el = $(this),
|
53 |
$_child_dropdown = $_el.find( Selector.CHILD_DROPDOWN ).first();
|
|
|
54 |
// Jan 2021 : start of a fix for https://github.com/presscustomizr/nimble-builder/issues/772
|
55 |
if ( nb_.cachedElements.$body.hasClass('is-touch-device') ) {
|
56 |
-
|
|
|
|
|
57 |
evt.preventDefault();
|
58 |
}
|
59 |
}
|
41 |
$( '.sek-nav .children, .sek-nav .sub-menu' ).addClass( ClassName.DROPDOWN );
|
42 |
$( '.sek-nav-wrap .page_item_has_children' ).addClass( ClassName.PARENTS );
|
43 |
$( '.sek-nav' + ' .' + ClassName.DROPDOWN + ' .' + ClassName.PARENTS ).addClass( ClassName.DROPDOWN_SUBMENU );
|
44 |
+
|
45 |
+
// this is the element
|
46 |
+
var _isMobileMenu = function() {
|
47 |
+
if ( this.length && this.length > 0 ) {
|
48 |
+
return "yes" === this.closest('[data-sek-is-mobile-menu]').data('sek-is-mobile-menu');
|
49 |
+
}
|
50 |
+
return false;
|
51 |
+
};
|
52 |
//Handle dropdown on hover via js
|
53 |
var dropdownMenuOnHover = function() {
|
54 |
var _dropdown_selector = Selector.HOVER_PARENT;
|
56 |
enableDropdownOnHover();
|
57 |
|
58 |
function _addOpenClass( evt ) {
|
59 |
+
|
60 |
var $_el = $(this),
|
61 |
$_child_dropdown = $_el.find( Selector.CHILD_DROPDOWN ).first();
|
62 |
+
|
63 |
// Jan 2021 : start of a fix for https://github.com/presscustomizr/nimble-builder/issues/772
|
64 |
if ( nb_.cachedElements.$body.hasClass('is-touch-device') ) {
|
65 |
+
// When navigating the regular menu ( horizontal ) on a mobile device, typically a tablet in landscape orientation
|
66 |
+
// we want to prevent opening the link of a parent menu if the children are not displayed yet
|
67 |
+
if ( "true" != $_child_dropdown.attr('aria-expanded') && !_isMobileMenu.call($_child_dropdown) ) {
|
68 |
evt.preventDefault();
|
69 |
}
|
70 |
}
|
assets/front/js/partials/menu-module.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window,document,nb_.listenTo("nb-app-ready",function(){jQuery(function(r){var e,o,d,
|
1 |
+
window,document,nb_.listenTo("nb-app-ready",function(){jQuery(function(r){var e,o,i,d,l,c,h,s,u,n,a,m,t,p,f,g,k,E,_,v;a={PLACE_ME:"placeme"+(n="."+(u="sek.sekDropdown")),PLACE_ALL:"placeall"+n,SHOWN:"shown"+n,SHOW:"show"+n,HIDDEN:"hidden"+n,HIDE:"hide"+n,CLICK:"click"+n,TAP:"tap"+n},m="sek-dropdown-menu",t="sek-dropdown-submenu",p="show",f="menu-item-has-children",g="allow-pointer-events-on-scroll",k=".sek-nav-wrap",_=E=".sek-nav-wrap .menu-item-has-children",v="ul.sek-dropdown-menu",r(".sek-nav .children, .sek-nav .sub-menu").addClass(m),r(".sek-nav-wrap .page_item_has_children").addClass(f),r(".sek-nav ."+m+" ."+f).addClass(t),function(){var e=E;function s(e){var s=r(this),n=s.find(v).first();nb_.cachedElements.$body.hasClass("is-touch-device")&&("true"==n.attr("aria-expanded")||function(){return!!(this.length&&0<this.length)&&"yes"===this.closest("[data-sek-is-mobile-menu]").data("sek-is-mobile-menu")}.call(n)||e.preventDefault()),nb_.debounce(function(){if("static"==s.find("."+m).css("position"))return!1;var e=s.find(v).first();s.hasClass(p)||(nb_.cachedElements.$body.addClass(g),s.trigger(a.SHOW).addClass(p).trigger(a.SHOWN),0<e.length&&e[0].setAttribute("aria-expanded","true"))},30)()}function n(){var e=r(this),s=e.find(v).first();nb_.debounce(function(){e.find("ul li:hover").length<1&&!e.closest("ul").find("li:hover").is(e)&&(e.trigger(a.HIDE).removeClass(p).trigger(a.HIDDEN),e.closest(k).find("."+p).length<1&&nb_.cachedElements.$body.removeClass(g),0<s.length&&s[0].setAttribute("aria-expanded","false"))},30)()}nb_.cachedElements.$body.on("touchstart",function(){r(this).hasClass("is-touch-device")||r(this).addClass("is-touch-device")}),nb_.cachedElements.$body.on("mouseenter",e,s),nb_.cachedElements.$body.on("mouseleave",e,n),nb_.cachedElements.$body.on("click",e,s)}(),h="rtl"===r("html").attr("dir"),s=!1,nb_.cachedElements.$window.on("resize",function(){s||(s=!0,window.requestAnimationFrame(function(){r(_+"."+p).trigger(a.PLACE_ME),s=!1}))}),r(document).on(a.PLACE_ALL,function(){r(_).trigger(a.PLACE_ME)}).on(a.SHOWN+" "+a.PLACE_ME,_,function(e){e.stopPropagation(),function(e,s){if(s&&s.namespace&&u===s.namespace){var n,a,t,o,i,d,l=e.children("."+m);l.length&&(e.css("overflow","hidden"),l.css({zIndex:"-100",display:"block"}),a=e,t=h?{_DEFAULT:"left",_OPPOSITE:"right"}:{_DEFAULT:"right",_OPPOSITE:"left"},o={OPEN_PREFIX:"open-",DD_SUBMENU:"sek-dropdown-submenu",CARET_TITLE_FLIP:"sek-menu-link__row-reverse",DROPDOWN:"sek-dropdown-menu"},i=function(e,n,s){r.each(e,function(){var e=r(this),s=e.find("a").first();1==s.length&&s.toggleClass(o.CARET_TITLE_FLIP,n==t._OPPOSITE)})},d=function(e){var s=e==t._OPPOSITE?t._DEFAULT:t._OPPOSITE;n.removeClass(o.OPEN_PREFIX+s).addClass(o.OPEN_PREFIX+e),a.hasClass(o.DD_SUBMENU)&&(i(a,e,s),i(n.children("."+o.DD_SUBMENU),e,s))},(n=l).parent().closest("."+o.DROPDOWN).hasClass(o.OPEN_PREFIX+t._OPPOSITE)?d(t._OPPOSITE):d(t._DEFAULT),n.offset().left+n.width()>nb_.cachedElements.$window.width()?d("left"):n.offset().left<0&&d("right"),l.css({zIndex:"",display:""}),e.css("overflow",""))}}(r(this),e)}),o={SHOW:"show"+(e=".sek.sekCollapse"),SHOWN:"shown"+e,HIDE:"hide"+e,HIDDEN:"hidden"+e,CLICK_DATA_API:"click"+e+".data-api"},i="show",d="sek-collapse",l="sek-collapsing",c="sek-collapsed",r(document).on(o.CLICK_DATA_API,'[data-sek-toggle="sek-collapse"]',function(e){"A"===e.currentTarget.tagName&&e.preventDefault();var s=r(this),n=s.data("target");r(n).each(function(){var a=r(this),t=a.hasClass(i);a.stop()[t?"slideUp":"slideDown"]({duration:400,start:function(){a.addClass(l).trigger(t?o.HIDE:o.SHOW),t?s.addClass(c).attr("aria-expanded","false"):s.removeClass(c).attr("aria-expanded","true")},complete:function(){var e,s,n;n=t?(e=i,s=d,o.HIDDEN):(e=d,s=i,o.SHOWN),a.removeClass(l+" "+e).addClass(s).trigger(n),function(e){(e=e||r(this)).css({display:"",paddingTop:"",marginTop:"",paddingBottom:"",marginBottom:"",height:""})}(a)}})})}),r(document).on("mouseenter",".sek-nav-toggler",function(){r(this).addClass("hovering")}).on("mouseleave",".sek-nav-toggler",function(){r(this).removeClass("hovering")}).on("show.sek.sekCollapse hide.sek.sekCollapse",".sek-nav-collapse",function(){r('[data-target="#'+r(this).attr("id")+'"]').removeClass("hovering"),nb_.cachedElements.$window.trigger("scroll")});var b=function(){r('[data-sek-module-type="czr_menu_module"]').find('[data-sek-expand-below="yes"]').each(function(){if(!0!==r(this).data("sek-setup-menu-mobile-expanded-below-done")){var e=r(this).closest('[data-sek-module-type="czr_menu_module"]').clone(!0),s=r(".sek-nav-collapse",this).attr("id")+"-mobile";e.appendTo(r(this).closest(".sek-sektion-inner")).wrap('<div class="sek-col-base sek-mobile-menu-expanded-below" id="'+s+'-wrapper"></div>'),r(".sek-nav-collapse","#"+s+"-wrapper").attr("id",s),r(".sek-nav-wrap","#"+s+"-wrapper").attr("data-sek-is-mobile-menu","yes"),r(".sek-nav-toggler","#"+s+"-wrapper").detach(),r(".sek-nav-toggler",this).data("target","#"+s).attr("aria-controls",s),r(this).data("sek-setup-menu-mobile-expanded-below-done",!0)}})};b(),nb_.cachedElements.$body.on("sek-level-refreshed sek-modules-refreshed sek-columns-refreshed sek-section-added",function(e){r(".sek-mobile-menu-expanded-below").remove(),b()})})});
|
inc/admin/nimble-admin.php
CHANGED
@@ -84,7 +84,7 @@ function sek_register_dashboard_widgets() {
|
|
84 |
$wp_meta_boxes['dashboard']['normal']['core'] = array_merge( $nimble_widget, $dashboard );
|
85 |
}
|
86 |
function sek_nimble_dashboard_callback_fn() {
|
87 |
-
$post_data = sek_get_latest_posts_api_data(
|
88 |
$theme_name = sek_get_parent_theme_slug();
|
89 |
?>
|
90 |
<div class="nimble-db-wrapper">
|
@@ -141,7 +141,7 @@ function sek_nimble_dashboard_callback_fn() {
|
|
141 |
$theme_name = sek_get_parent_theme_slug();
|
142 |
|
143 |
if ( sek_is_presscustomizr_theme( $theme_name ) ) {
|
144 |
-
$start_msg = sek_start_msg_from_api( $theme_name
|
145 |
if ( !empty( $start_msg ) ) {
|
146 |
$start_msg_array = array(
|
147 |
'start_msg' => array(
|
84 |
$wp_meta_boxes['dashboard']['normal']['core'] = array_merge( $nimble_widget, $dashboard );
|
85 |
}
|
86 |
function sek_nimble_dashboard_callback_fn() {
|
87 |
+
$post_data = sek_get_latest_posts_api_data();
|
88 |
$theme_name = sek_get_parent_theme_slug();
|
89 |
?>
|
90 |
<div class="nimble-db-wrapper">
|
141 |
$theme_name = sek_get_parent_theme_slug();
|
142 |
|
143 |
if ( sek_is_presscustomizr_theme( $theme_name ) ) {
|
144 |
+
$start_msg = sek_start_msg_from_api( $theme_name );
|
145 |
if ( !empty( $start_msg ) ) {
|
146 |
$start_msg_array = array(
|
147 |
'start_msg' => array(
|
inc/sektions/ccat-constants-and-helper-functions.php
CHANGED
@@ -2880,13 +2880,12 @@ add_filter('sek_get_raw_section_registration_params', function( $collection ) {
|
|
2880 |
// /* ------------------------------------------------------------------------- *
|
2881 |
// * NIMBLE API
|
2882 |
// /* ------------------------------------------------------------------------- */
|
2883 |
-
if ( !defined( "NIMBLE_SECTIONS_LIBRARY_OPT_NAME" ) ) { define( "NIMBLE_SECTIONS_LIBRARY_OPT_NAME", 'nimble_api_prebuilt_sections_data' ); }
|
2884 |
-
if ( !defined( "
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
if ( !defined( "NIMBLE_DATA_API_URL_V2" ) ) { define( "NIMBLE_DATA_API_URL_V2", 'https://api.nimblebuilder.com/wp-json/nimble/v2/cravan' ); }
|
2890 |
|
2891 |
|
2892 |
// Nimble api returns a set of value structured as follow
|
@@ -2963,55 +2962,50 @@ function sek_get_nimble_api_data( $force_update = false ) {
|
|
2963 |
// }
|
2964 |
// unset( $info_data['library'] );
|
2965 |
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2966 |
|
2967 |
if ( isset( $info_data['latest_posts'] ) ) {
|
2968 |
-
update_option(
|
2969 |
unset( $info_data['latest_posts'] );
|
2970 |
}
|
2971 |
-
|
2972 |
set_transient( $api_data_transient_name, $info_data, 12 * HOUR_IN_SECONDS );
|
2973 |
}//if ( $force_update || false === $info_data ) {
|
2974 |
-
|
2975 |
return $info_data;
|
2976 |
}
|
2977 |
|
2978 |
|
2979 |
//////////////////////////////////////////////////
|
2980 |
-
///
|
2981 |
-
function
|
2982 |
-
//
|
2983 |
-
|
2984 |
-
// Those data are updated on plugin install, plugin update, theme switch
|
2985 |
-
// @see https://github.com/presscustomizr/nimble-builder/issues/441
|
2986 |
-
$sections_data = get_option( NIMBLE_SECTIONS_LIBRARY_OPT_NAME );
|
2987 |
-
if ( empty( $sections_data ) || !is_array( $sections_data ) || empty( $sections_data['registration_params'] ) ) {
|
2988 |
-
sek_get_nimble_api_data( true );//<= true for "force_update"
|
2989 |
-
$sections_data = get_option( NIMBLE_SECTIONS_LIBRARY_OPT_NAME );
|
2990 |
-
}
|
2991 |
-
|
2992 |
-
if ( empty( $sections_data ) || !is_array( $sections_data ) || empty( $sections_data['registration_params'] ) ) {
|
2993 |
-
sek_error_log( __FUNCTION__ . ' => error => no section registration params' );
|
2994 |
-
return array();
|
2995 |
-
}
|
2996 |
-
return $sections_data['registration_params'];
|
2997 |
-
}
|
2998 |
|
2999 |
-
function sek_get_preset_sections_api_data( $force_update = false ) {
|
3000 |
// To avoid a possible refresh, hence a reconnection to the api when opening the customizer
|
3001 |
// Let's use the data saved as options
|
3002 |
// Those data are updated on plugin install, plugin update( upgrader_process_complete ), theme switch
|
3003 |
// @see https://github.com/presscustomizr/nimble-builder/issues/441
|
3004 |
-
$
|
3005 |
-
if (
|
3006 |
sek_get_nimble_api_data( true );//<= true for "force_update"
|
3007 |
-
$
|
3008 |
}
|
3009 |
-
|
3010 |
-
if ( empty( $
|
3011 |
sek_error_log( __FUNCTION__ . ' => error => no json_collection' );
|
3012 |
return array();
|
3013 |
}
|
3014 |
-
|
|
|
|
|
3015 |
}
|
3016 |
|
3017 |
|
@@ -3019,8 +3013,11 @@ function sek_get_preset_sections_api_data( $force_update = false ) {
|
|
3019 |
/// LATESTS POSTS
|
3020 |
// @return array of posts
|
3021 |
function sek_get_latest_posts_api_data( $force_update = false ) {
|
|
|
|
|
|
|
3022 |
sek_get_nimble_api_data( $force_update );
|
3023 |
-
$latest_posts = get_option(
|
3024 |
if ( empty( $latest_posts ) ) {
|
3025 |
sek_error_log( __FUNCTION__ . ' => error => no latest_posts' );
|
3026 |
return array();
|
@@ -3030,6 +3027,9 @@ function sek_get_latest_posts_api_data( $force_update = false ) {
|
|
3030 |
|
3031 |
// @return html string
|
3032 |
function sek_start_msg_from_api( $theme_name, $force_update = false ) {
|
|
|
|
|
|
|
3033 |
$info_data = sek_get_nimble_api_data( $force_update );
|
3034 |
if ( !sek_is_presscustomizr_theme( $theme_name ) || !is_array( $info_data ) ) {
|
3035 |
return '';
|
@@ -3049,9 +3049,51 @@ add_action( 'upgrader_process_complete', '\Nimble\sek_refresh_nimble_api_data');
|
|
3049 |
function sek_refresh_nimble_api_data() {
|
3050 |
// Refresh data on theme switch
|
3051 |
// => so the posts and message are up to date
|
3052 |
-
sek_get_nimble_api_data(true);
|
3053 |
}
|
3054 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3055 |
?><?php
|
3056 |
// This file has been introduced on May 21st 2019 => back to the local data
|
3057 |
// after problem was reported when fetching data remotely : https://github.com/presscustomizr/nimble-builder/issues/445
|
@@ -4208,6 +4250,7 @@ function sek_update_saved_section_post( $section_data ) {
|
|
4208 |
|
4209 |
// the section post name is provided only when updating
|
4210 |
$is_update_case = !is_null($section_data['section_post_name']);
|
|
|
4211 |
|
4212 |
// $post_name_to_update will be used when user updates an existing section
|
4213 |
if ( !is_null($section_data['section_post_name']) ) {
|
@@ -4219,7 +4262,23 @@ function sek_update_saved_section_post( $section_data ) {
|
|
4219 |
// Update the post name now
|
4220 |
$section_data['section_post_name'] = $section_post_name;
|
4221 |
|
4222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4223 |
'post_title' => esc_attr( $section_data['metas']['title'] ),
|
4224 |
'post_name' => $section_post_name,
|
4225 |
'post_type' => NIMBLE_SECTION_CPT,
|
@@ -4227,17 +4286,13 @@ function sek_update_saved_section_post( $section_data ) {
|
|
4227 |
'post_content' => maybe_serialize( $section_data )
|
4228 |
);
|
4229 |
|
4230 |
-
|
4231 |
-
$section_post = null;
|
4232 |
-
if ( $is_update_case ) {
|
4233 |
-
$section_post = sek_get_saved_section_post( $section_post_name );
|
4234 |
-
}
|
4235 |
|
4236 |
-
if ( $
|
4237 |
-
$
|
4238 |
-
$r = wp_update_post( wp_slash( $
|
4239 |
} else {
|
4240 |
-
$r = wp_insert_post( wp_slash( $
|
4241 |
if ( !is_wp_error( $r ) ) {
|
4242 |
$post_id = $r;//$r is the post ID
|
4243 |
// Trigger creation of a revision. This should be removed once #30854 is resolved.
|
@@ -4421,6 +4476,29 @@ function sek_get_all_saved_templates() {
|
|
4421 |
}
|
4422 |
|
4423 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4424 |
|
4425 |
// Update the 'nimble_template' post
|
4426 |
// Inserts a 'nimble_template' post when one doesn't yet exist.
|
@@ -4466,6 +4544,7 @@ function sek_update_saved_tmpl_post( $tmpl_data ) {
|
|
4466 |
|
4467 |
// the template post name is provided only when updating
|
4468 |
$is_update_case = !is_null($tmpl_data['tmpl_post_name']);
|
|
|
4469 |
|
4470 |
// $post_name_to_update will be used when user updates an existing template
|
4471 |
if ( !is_null($tmpl_data['tmpl_post_name']) ) {
|
@@ -4479,7 +4558,23 @@ function sek_update_saved_tmpl_post( $tmpl_data ) {
|
|
4479 |
// Update the post name now
|
4480 |
$tmpl_data['tmpl_post_name'] = $tmpl_post_name;
|
4481 |
|
4482 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4483 |
'post_title' => esc_attr( $tmpl_data['metas']['title'] ),
|
4484 |
'post_name' => $tmpl_post_name,
|
4485 |
'post_type' => NIMBLE_TEMPLATE_CPT,
|
@@ -4487,20 +4582,15 @@ function sek_update_saved_tmpl_post( $tmpl_data ) {
|
|
4487 |
'post_content' => maybe_serialize( $tmpl_data )
|
4488 |
);
|
4489 |
|
4490 |
-
//sek_error_log('
|
4491 |
-
//
|
4492 |
-
$
|
4493 |
-
if ( $is_update_case ) {
|
4494 |
-
$tmpl_post = sek_get_saved_tmpl_post( $tmpl_post_name );
|
4495 |
-
}
|
4496 |
-
|
4497 |
-
//sek_error_log( __FUNCTION__ . ' => so $tmpl_data for skope ' . $tmpl_post_name, $tmpl_data );
|
4498 |
|
4499 |
-
if ( $
|
4500 |
-
$
|
4501 |
-
$r = wp_update_post( wp_slash( $
|
4502 |
} else {
|
4503 |
-
$r = wp_insert_post( wp_slash( $
|
4504 |
if ( !is_wp_error( $r ) ) {
|
4505 |
$post_id = $r;//$r is the post ID
|
4506 |
// Trigger creation of a revision. This should be removed once #30854 is resolved.
|
2880 |
// /* ------------------------------------------------------------------------- *
|
2881 |
// * NIMBLE API
|
2882 |
// /* ------------------------------------------------------------------------- */
|
2883 |
+
// if ( !defined( "NIMBLE_SECTIONS_LIBRARY_OPT_NAME" ) ) { define( "NIMBLE_SECTIONS_LIBRARY_OPT_NAME", 'nimble_api_prebuilt_sections_data' ); } <= DEPRECATED, Now uses local json
|
2884 |
+
if ( !defined( "NIMBLE_API_TMPL_LIB_OPT_NAME" ) ) { define( "NIMBLE_API_TMPL_LIB_OPT_NAME", 'nimble_api_tmpl_data' ); }
|
2885 |
+
if ( !defined( "NIMBLE_API_NEWS_OPT_NAME" ) ) { define( "NIMBLE_API_NEWS_OPT_NAME", 'nimble_api_news_data' ); }
|
2886 |
+
if ( !defined( "NIMBLE_DATA_API_URL_V2" ) ) { define( "NIMBLE_DATA_API_URL_V2",
|
2887 |
+
( defined('NIMBLE_FETCH_API_TMPL_LOCALLY') && NIMBLE_FETCH_API_TMPL_LOCALLY ) ? 'http://customizr-dev.test/wp-json/nimble/v2/cravan' : 'https://api.nimblebuilder.com/wp-json/nimble/v2/cravan'
|
2888 |
+
); }
|
|
|
2889 |
|
2890 |
|
2891 |
// Nimble api returns a set of value structured as follow
|
2962 |
// }
|
2963 |
// unset( $info_data['library'] );
|
2964 |
// }
|
2965 |
+
|
2966 |
+
if ( !empty( $info_data['lib'] ) ) {
|
2967 |
+
if ( !empty( $info_data['lib']['templates'] ) ) {
|
2968 |
+
//sek_error_log('UPDATE TMPL API DATA ?', $info_data['lib']['templates'] );
|
2969 |
+
update_option( NIMBLE_API_TMPL_LIB_OPT_NAME, maybe_serialize( $info_data['lib']['templates'] ), 'no' );
|
2970 |
+
}
|
2971 |
+
unset( $info_data['lib'] );
|
2972 |
+
}
|
2973 |
|
2974 |
if ( isset( $info_data['latest_posts'] ) ) {
|
2975 |
+
update_option( NIMBLE_API_NEWS_OPT_NAME, $info_data['latest_posts'], 'no' );
|
2976 |
unset( $info_data['latest_posts'] );
|
2977 |
}
|
2978 |
+
//sek_error_log('API DATA ?', $info_data );
|
2979 |
set_transient( $api_data_transient_name, $info_data, 12 * HOUR_IN_SECONDS );
|
2980 |
}//if ( $force_update || false === $info_data ) {
|
2981 |
+
|
2982 |
return $info_data;
|
2983 |
}
|
2984 |
|
2985 |
|
2986 |
//////////////////////////////////////////////////
|
2987 |
+
/// TEMPLATE DATA
|
2988 |
+
function sek_get_tmpl_api_data( $force_update = false ) {
|
2989 |
+
// set this constant in wp_config.php
|
2990 |
+
$force_update = ( defined( 'NIMBLE_FORCE_UPDATE_API_DATA') && NIMBLE_FORCE_UPDATE_API_DATA ) ? true : $force_update;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2991 |
|
|
|
2992 |
// To avoid a possible refresh, hence a reconnection to the api when opening the customizer
|
2993 |
// Let's use the data saved as options
|
2994 |
// Those data are updated on plugin install, plugin update( upgrader_process_complete ), theme switch
|
2995 |
// @see https://github.com/presscustomizr/nimble-builder/issues/441
|
2996 |
+
$tmpl_data = maybe_unserialize( get_option( NIMBLE_API_TMPL_LIB_OPT_NAME ) );
|
2997 |
+
if ( $force_update || empty( $tmpl_data ) || !is_array( $tmpl_data ) ) {
|
2998 |
sek_get_nimble_api_data( true );//<= true for "force_update"
|
2999 |
+
$tmpl_data = maybe_unserialize( get_option( NIMBLE_API_TMPL_LIB_OPT_NAME ) );
|
3000 |
}
|
3001 |
+
//sek_error_log('TMPL DATA ?', $tmpl_data);
|
3002 |
+
if ( empty( $tmpl_data ) || !is_array( $tmpl_data ) ) {
|
3003 |
sek_error_log( __FUNCTION__ . ' => error => no json_collection' );
|
3004 |
return array();
|
3005 |
}
|
3006 |
+
|
3007 |
+
//return [];
|
3008 |
+
return maybe_unserialize( $tmpl_data );
|
3009 |
}
|
3010 |
|
3011 |
|
3013 |
/// LATESTS POSTS
|
3014 |
// @return array of posts
|
3015 |
function sek_get_latest_posts_api_data( $force_update = false ) {
|
3016 |
+
// set this constant in wp_config.php
|
3017 |
+
$force_update = ( defined( 'NIMBLE_FORCE_UPDATE_API_DATA') && NIMBLE_FORCE_UPDATE_API_DATA ) ? true : $force_update;
|
3018 |
+
|
3019 |
sek_get_nimble_api_data( $force_update );
|
3020 |
+
$latest_posts = get_option( NIMBLE_API_NEWS_OPT_NAME );
|
3021 |
if ( empty( $latest_posts ) ) {
|
3022 |
sek_error_log( __FUNCTION__ . ' => error => no latest_posts' );
|
3023 |
return array();
|
3027 |
|
3028 |
// @return html string
|
3029 |
function sek_start_msg_from_api( $theme_name, $force_update = false ) {
|
3030 |
+
// set this constant in wp_config.php
|
3031 |
+
$force_update = ( defined( 'NIMBLE_FORCE_UPDATE_API_DATA') && NIMBLE_FORCE_UPDATE_API_DATA ) ? true : $force_update;
|
3032 |
+
|
3033 |
$info_data = sek_get_nimble_api_data( $force_update );
|
3034 |
if ( !sek_is_presscustomizr_theme( $theme_name ) || !is_array( $info_data ) ) {
|
3035 |
return '';
|
3049 |
function sek_refresh_nimble_api_data() {
|
3050 |
// Refresh data on theme switch
|
3051 |
// => so the posts and message are up to date
|
3052 |
+
sek_get_nimble_api_data($force_update = true);
|
3053 |
}
|
3054 |
|
3055 |
+
|
3056 |
+
//////////////////////////////////////////////////
|
3057 |
+
/// SECTIONS DATA
|
3058 |
+
/// DEPRECATED, NOW USING LOCAL DATA AND JSON
|
3059 |
+
// function sek_get_sections_registration_params_api_data( $force_update = false ) {
|
3060 |
+
// // To avoid a possible refresh, hence a reconnection to the api when opening the customizer
|
3061 |
+
// // Let's use the data saved as options
|
3062 |
+
// // Those data are updated on plugin install, plugin update, theme switch
|
3063 |
+
// // @see https://github.com/presscustomizr/nimble-builder/issues/441
|
3064 |
+
// $sections_data = get_option( NIMBLE_SECTIONS_LIBRARY_OPT_NAME );
|
3065 |
+
// if ( empty( $sections_data ) || !is_array( $sections_data ) || empty( $sections_data['registration_params'] ) ) {
|
3066 |
+
// sek_get_nimble_api_data( true );//<= true for "force_update"
|
3067 |
+
// $sections_data = get_option( NIMBLE_SECTIONS_LIBRARY_OPT_NAME );
|
3068 |
+
// }
|
3069 |
+
|
3070 |
+
// if ( empty( $sections_data ) || !is_array( $sections_data ) || empty( $sections_data['registration_params'] ) ) {
|
3071 |
+
// sek_error_log( __FUNCTION__ . ' => error => no section registration params' );
|
3072 |
+
// return array();
|
3073 |
+
// }
|
3074 |
+
// return $sections_data['registration_params'];
|
3075 |
+
// }
|
3076 |
+
|
3077 |
+
// function sek_get_preset_sections_api_data( $force_update = false ) {
|
3078 |
+
// // To avoid a possible refresh, hence a reconnection to the api when opening the customizer
|
3079 |
+
// // Let's use the data saved as options
|
3080 |
+
// // Those data are updated on plugin install, plugin update( upgrader_process_complete ), theme switch
|
3081 |
+
// // @see https://github.com/presscustomizr/nimble-builder/issues/441
|
3082 |
+
// $sections_data = get_option( NIMBLE_SECTIONS_LIBRARY_OPT_NAME );
|
3083 |
+
// if ( empty( $sections_data ) || !is_array( $sections_data ) || empty( $sections_data['json_collection'] ) ) {
|
3084 |
+
// sek_get_nimble_api_data( true );//<= true for "force_update"
|
3085 |
+
// $sections_data = get_option( NIMBLE_SECTIONS_LIBRARY_OPT_NAME );
|
3086 |
+
// }
|
3087 |
+
|
3088 |
+
// if ( empty( $sections_data ) || !is_array( $sections_data ) || empty( $sections_data['json_collection'] ) ) {
|
3089 |
+
// sek_error_log( __FUNCTION__ . ' => error => no json_collection' );
|
3090 |
+
// return array();
|
3091 |
+
// }
|
3092 |
+
// return $sections_data['json_collection'];
|
3093 |
+
// }
|
3094 |
+
|
3095 |
+
|
3096 |
+
|
3097 |
?><?php
|
3098 |
// This file has been introduced on May 21st 2019 => back to the local data
|
3099 |
// after problem was reported when fetching data remotely : https://github.com/presscustomizr/nimble-builder/issues/445
|
4250 |
|
4251 |
// the section post name is provided only when updating
|
4252 |
$is_update_case = !is_null($section_data['section_post_name']);
|
4253 |
+
$is_edit_metas_only_case = 'yes' === $section_data['edit_metas_only'];
|
4254 |
|
4255 |
// $post_name_to_update will be used when user updates an existing section
|
4256 |
if ( !is_null($section_data['section_post_name']) ) {
|
4262 |
// Update the post name now
|
4263 |
$section_data['section_post_name'] = $section_post_name;
|
4264 |
|
4265 |
+
// Update post if it already exists, otherwise create a new one.
|
4266 |
+
$current_section_post = null;
|
4267 |
+
if ( $is_update_case ) {
|
4268 |
+
// When this is an update case, we fetch the existing tmpl_post in order to later get its id
|
4269 |
+
$current_section_post = sek_get_saved_section_post( $section_post_name );
|
4270 |
+
|
4271 |
+
// if this is an update case + editing metas only, then we use the current content
|
4272 |
+
if ( $is_edit_metas_only_case && isset($current_section_post->post_content) ) {
|
4273 |
+
sek_error_log('IS EDIT METAS ONLY ?');
|
4274 |
+
$current_section_data = maybe_unserialize( $current_section_post->post_content );
|
4275 |
+
if ( is_array($current_section_data) && isset($current_section_data['data']) && is_array($current_section_data['data']) && !empty($current_section_data['data']) ) {
|
4276 |
+
$section_data['data'] = $current_section_data['data'];
|
4277 |
+
}
|
4278 |
+
}
|
4279 |
+
}
|
4280 |
+
|
4281 |
+
$new_or_updated_post_data = array(
|
4282 |
'post_title' => esc_attr( $section_data['metas']['title'] ),
|
4283 |
'post_name' => $section_post_name,
|
4284 |
'post_type' => NIMBLE_SECTION_CPT,
|
4286 |
'post_content' => maybe_serialize( $section_data )
|
4287 |
);
|
4288 |
|
4289 |
+
|
|
|
|
|
|
|
|
|
4290 |
|
4291 |
+
if ( $current_section_post && is_object($current_section_post) ) {
|
4292 |
+
$new_or_updated_post_data['ID'] = $current_section_post->ID;
|
4293 |
+
$r = wp_update_post( wp_slash( $new_or_updated_post_data ), true );
|
4294 |
} else {
|
4295 |
+
$r = wp_insert_post( wp_slash( $new_or_updated_post_data ), true );
|
4296 |
if ( !is_wp_error( $r ) ) {
|
4297 |
$post_id = $r;//$r is the post ID
|
4298 |
// Trigger creation of a revision. This should be removed once #30854 is resolved.
|
4476 |
}
|
4477 |
|
4478 |
|
4479 |
+
// invoked on 'wp_ajax_sek_get_all_api_tmpl'
|
4480 |
+
// @return an unserialized array of api templates
|
4481 |
+
function sek_get_all_api_templates() {
|
4482 |
+
$raw_tmpl = sek_get_tmpl_api_data();
|
4483 |
+
$collection = [];
|
4484 |
+
if( !is_array( $raw_tmpl) )
|
4485 |
+
return $collection;
|
4486 |
+
foreach ( $raw_tmpl as $tmpl_cpt_post_name => $tmpl_data ) {
|
4487 |
+
$metas = !is_array( $tmpl_data['metas'] ) ? [] : $tmpl_data['metas'];
|
4488 |
+
if ( empty($metas) )
|
4489 |
+
continue;
|
4490 |
+
|
4491 |
+
$collection[$tmpl_cpt_post_name] = [
|
4492 |
+
'title' => $metas['title'],
|
4493 |
+
'description' => $metas['description'],
|
4494 |
+
'last_modified_date' => mysql2date( 'Y-m-d', $metas['date'] ),
|
4495 |
+
'thumb_url' => !empty( $metas['thumb_url'] ) ? $metas['thumb_url'] : '',
|
4496 |
+
'is_pro_tmpl' => !empty( $metas['is_pro_tmpl'] ) ? $metas['is_pro_tmpl'] : false
|
4497 |
+
];
|
4498 |
+
}
|
4499 |
+
return $collection;
|
4500 |
+
}
|
4501 |
+
|
4502 |
|
4503 |
// Update the 'nimble_template' post
|
4504 |
// Inserts a 'nimble_template' post when one doesn't yet exist.
|
4544 |
|
4545 |
// the template post name is provided only when updating
|
4546 |
$is_update_case = !is_null($tmpl_data['tmpl_post_name']);
|
4547 |
+
$is_edit_metas_only_case = 'yes' === $tmpl_data['edit_metas_only'];
|
4548 |
|
4549 |
// $post_name_to_update will be used when user updates an existing template
|
4550 |
if ( !is_null($tmpl_data['tmpl_post_name']) ) {
|
4558 |
// Update the post name now
|
4559 |
$tmpl_data['tmpl_post_name'] = $tmpl_post_name;
|
4560 |
|
4561 |
+
//sek_error_log('serialized $tmpl_data??', maybe_serialize( $tmpl_data ) );
|
4562 |
+
// Update post if it already exists, otherwise create a new one.
|
4563 |
+
$current_tmpl_post = null;
|
4564 |
+
if ( $is_update_case ) {
|
4565 |
+
// When this is an update case, we fetch the existing tmpl_post in order to later get its id
|
4566 |
+
$current_tmpl_post = sek_get_saved_tmpl_post( $tmpl_post_name );
|
4567 |
+
|
4568 |
+
// if this is an update case + editing metas only, then we use the current content
|
4569 |
+
if ( $is_edit_metas_only_case && isset($current_tmpl_post->post_content) ) {
|
4570 |
+
$current_tmpl_data = maybe_unserialize( $current_tmpl_post->post_content );
|
4571 |
+
if ( is_array($current_tmpl_data) && isset($current_tmpl_data['data']) && is_array($current_tmpl_data['data']) && !empty($current_tmpl_data['data']) ) {
|
4572 |
+
$tmpl_data['data'] = $current_tmpl_data['data'];
|
4573 |
+
}
|
4574 |
+
}
|
4575 |
+
}
|
4576 |
+
|
4577 |
+
$new_or_updated_post_data = array(
|
4578 |
'post_title' => esc_attr( $tmpl_data['metas']['title'] ),
|
4579 |
'post_name' => $tmpl_post_name,
|
4580 |
'post_type' => NIMBLE_TEMPLATE_CPT,
|
4582 |
'post_content' => maybe_serialize( $tmpl_data )
|
4583 |
);
|
4584 |
|
4585 |
+
// sek_error_log( __FUNCTION__ . ' => so $is_edit_metas_only_case ' . $is_edit_metas_only_case );
|
4586 |
+
// sek_error_log( __FUNCTION__ . ' => so $tmpl_data for skope ' . $tmpl_post_name, $current_tmpl_data['data'] );
|
4587 |
+
$r = '';
|
|
|
|
|
|
|
|
|
|
|
4588 |
|
4589 |
+
if ( $current_tmpl_post && is_object($current_tmpl_post) ) {
|
4590 |
+
$new_or_updated_post_data['ID'] = $current_tmpl_post->ID;
|
4591 |
+
$r = wp_update_post( wp_slash( $new_or_updated_post_data ), true );
|
4592 |
} else {
|
4593 |
+
$r = wp_insert_post( wp_slash( $new_or_updated_post_data ), true );
|
4594 |
if ( !is_wp_error( $r ) ) {
|
4595 |
$post_id = $r;//$r is the post ID
|
4596 |
// Trigger creation of a revision. This should be removed once #30854 is resolved.
|
inc/sektions/ccat-czr-sektions.php
CHANGED
@@ -212,7 +212,8 @@ function sek_enqueue_controls_js_css() {
|
|
212 |
'isTemplateSaveEnabled' => defined( 'NIMBLE_TEMPLATE_SAVE_ENABLED' ) && NIMBLE_TEMPLATE_SAVE_ENABLED, //<= APRIL 2020 : for https://github.com/presscustomizr/nimble-builder/issues/655
|
213 |
|
214 |
// Dec 2020
|
215 |
-
|
|
|
216 |
)
|
217 |
)
|
218 |
);//wp_localize_script()
|
@@ -646,15 +647,17 @@ function nimble_add_i18n_localized_control_params( $params ) {
|
|
646 |
// Template gallery and save
|
647 |
'Last modified' => __('Last modified', 'nimble-builder'),
|
648 |
'Use this template' => __('Use this template', 'nimble-builder'),
|
|
|
649 |
'Remove this template' => __('Remove this template', 'nimble-builder'),
|
650 |
'A title is required' => __('A title is required', 'nimble-builder'),
|
651 |
'Template saved' => __('Template saved', 'nimble-builder'),
|
652 |
'Template removed' => __('Template removed', 'nimble-builder'),
|
653 |
'Error when processing templates' => __('Error when processing templates', 'nimble-builder'),
|
654 |
'Last modified' => __('Last modified', 'nimble-builder'),
|
|
|
655 |
|
656 |
// Section Save
|
657 |
-
|
658 |
//'Remove this element' => __('Remove this element', 'text_dom'),
|
659 |
//'Remove this element' => __('Remove this element', 'text_dom'),
|
660 |
//'Remove this element' => __('Remove this element', 'text_dom'),
|
@@ -844,6 +847,9 @@ function sek_print_nimble_customizer_tmpl() {
|
|
844 |
<button aria-pressed="false" data-section-mode-switcher="update" class="sek-ui-button" type="button" title="<?php _e('Update a section', 'nimble-builder'); ?>">
|
845 |
<i class="far fa-edit"></i> <?php _e('Update a section', 'nimble-builder'); ?>
|
846 |
</button>
|
|
|
|
|
|
|
847 |
<button aria-pressed="false" data-section-mode-switcher="remove" class="sek-ui-button" type="button" title="<?php _e('Remove section(s)', 'nimble-builder'); ?>">
|
848 |
<i class="fas fa-trash"></i> <?php _e('Remove section(s)', 'nimble-builder'); ?>
|
849 |
</button>
|
@@ -906,6 +912,9 @@ function sek_print_nimble_customizer_tmpl() {
|
|
906 |
<button aria-pressed="false" data-tmpl-mode-switcher="update" class="sek-ui-button" type="button" title="<?php _e('Update a template', 'nimble-builder'); ?>">
|
907 |
<i class="far fa-edit"></i> <?php _e('Update a template', 'nimble-builder'); ?>
|
908 |
</button>
|
|
|
|
|
|
|
909 |
<button aria-pressed="false" data-tmpl-mode-switcher="remove" class="sek-ui-button" type="button" title="<?php _e('Remove template(s)', 'nimble-builder'); ?>">
|
910 |
<i class="fas fa-trash"></i> <?php _e('Remove template(s)', 'nimble-builder'); ?>
|
911 |
</button>
|
@@ -958,24 +967,30 @@ function sek_print_nimble_customizer_tmpl() {
|
|
958 |
<div id="nimble-tmpl-gallery" class="czr-preview-notification" data-sek-tmpl-dialog-mode="hidden">
|
959 |
<div class="czr-css-loader czr-mr-loader" style="display:block"><div></div><div></div><div></div></div>
|
960 |
<div id="sek-gal-top-bar">
|
|
|
|
|
|
|
|
|
|
|
|
|
961 |
<input type="text" class="sek-filter-tmpl" placeholder="<?php _e('Filter templates', 'nimble-builder'); ?>">
|
962 |
<div class="sek-ui-button-group" role="group">
|
963 |
<button class="sek-ui-button sek-close-dialog" type="button" title="<?php _e('Close', 'nimble-builder'); ?>">
|
964 |
<i class="far fa-times-circle"></i> <?php _e('Close', 'nimble-builder'); ?>
|
965 |
</button>
|
966 |
</div>
|
967 |
-
<div class="sek-tmpl-gallery-inner"></div>
|
968 |
</div>
|
|
|
969 |
<div class="sek-tmpl-gal-import-dialog">
|
970 |
<p>This page has NB sections already. Select an import options.</p>
|
971 |
<div class="sek-ui-button-group" role="group">
|
972 |
-
<button class="sek-ui-button sek-tmpl-import-replace" type="button" title="<?php _e('Replace existing sections', 'nimble-builder'); ?>" data-sek-tmpl-
|
973 |
<?php _e('Replace existing sections', 'nimble-builder'); ?><span class="spinner"></span>
|
974 |
</button>
|
975 |
-
<button class="sek-ui-button sek-tmpl-import-before" type="button" title="<?php _e('Insert before existing sections', 'nimble-builder'); ?>" data-sek-tmpl-
|
976 |
<?php _e('Insert before existing sections', 'nimble-builder'); ?><span class="spinner"></span>
|
977 |
</button>
|
978 |
-
<button class="sek-ui-button sek-tmpl-import-after" type="button" title="<?php _e('Insert after existing sections', 'nimble-builder'); ?>" data-sek-tmpl-
|
979 |
<?php _e('Insert after existing sections', 'nimble-builder'); ?><span class="spinner"></span>
|
980 |
</button>
|
981 |
</div>
|
@@ -4555,98 +4570,13 @@ function sek_ajax_get_manually_imported_file_content() {
|
|
4555 |
|
4556 |
|
4557 |
|
4558 |
-
|
4559 |
-
|
4560 |
-
|
4561 |
-
|
4562 |
-
|
4563 |
-
|
4564 |
-
// fetch the content from a remotely fetched template file
|
4565 |
-
add_action( 'wp_ajax_sek_process_template_json', '\Nimble\sek_ajax_process_template_json' );
|
4566 |
-
function sek_ajax_process_template_json() {
|
4567 |
-
// sek_error_log(__FUNCTION__ . ' AJAX $_POST ?', $_POST );
|
4568 |
-
// sek_error_log(__FUNCTION__ . ' AJAX $_FILES ?', $_FILES );
|
4569 |
-
// sek_error_log(__FUNCTION__ . ' AJAX $_REQUEST ?', $_REQUEST );
|
4570 |
-
|
4571 |
-
$action = 'save-customize_' . get_stylesheet();
|
4572 |
-
if ( !check_ajax_referer( $action, 'nonce', false ) ) {
|
4573 |
-
wp_send_json_error( __FUNCTION__ . ' => check_ajax_referer_failed' );
|
4574 |
-
}
|
4575 |
-
if ( !is_user_logged_in() ) {
|
4576 |
-
wp_send_json_error( __FUNCTION__ . ' => user_unauthenticated' );
|
4577 |
-
}
|
4578 |
-
if ( !current_user_can( 'edit_theme_options' ) ) {
|
4579 |
-
wp_send_json_error( __FUNCTION__ . ' => user_cant_edit_theme_options' );
|
4580 |
-
}
|
4581 |
-
if ( !current_user_can( 'customize' ) ) {
|
4582 |
-
status_header( 403 );
|
4583 |
-
wp_send_json_error( __FUNCTION__ . ' => customize_not_allowed' );
|
4584 |
-
} else if ( !isset( $_SERVER['REQUEST_METHOD'] ) || 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
|
4585 |
-
status_header( 405 );
|
4586 |
-
wp_send_json_error( __FUNCTION__ . ' => bad_ajax_method' );
|
4587 |
-
}
|
4588 |
-
if ( !isset($_POST['template_data']) || empty( $_POST['template_data'] ) ) {
|
4589 |
-
wp_send_json_error( __FUNCTION__ . ' => missing_template_data' );
|
4590 |
-
}
|
4591 |
-
|
4592 |
-
//$raw_unserialized_data = @unserialize( $raw );
|
4593 |
-
$raw_unserialized_data = json_decode( wp_unslash( $_POST['template_data'] ), true );
|
4594 |
-
if ( !is_array( $raw_unserialized_data ) ) {
|
4595 |
-
wp_send_json_error( __FUNCTION__ . ' => invalid_template_data' );
|
4596 |
-
}
|
4597 |
-
|
4598 |
-
//sek_error_log( __FUNCTION__ . ' =>TEMPLATE DATA ? ?', $raw_unserialized_data );
|
4599 |
-
// VALIDATE IMPORTED CONTENT
|
4600 |
-
// data structure :
|
4601 |
-
// $raw_unserialized_data = array(
|
4602 |
-
// 'data' => $seks_data,
|
4603 |
-
// 'metas' => array(
|
4604 |
-
// 'skope_id' => $_REQUEST['skope_id'],
|
4605 |
-
// 'version' => NIMBLE_VERSION,
|
4606 |
-
// // is sent as a string : "__after_header,__before_main_wrapper,loop_start,__before_footer"
|
4607 |
-
// 'active_locations' => is_string( $_REQUEST['active_locations'] ) ? explode( ',', $_REQUEST['active_locations'] ) : array(),
|
4608 |
-
// 'date' => date("Y-m-d")
|
4609 |
-
// )
|
4610 |
-
// );
|
4611 |
-
// check import structure
|
4612 |
-
if ( !is_array( $raw_unserialized_data ) || empty( $raw_unserialized_data['data']) || !is_array( $raw_unserialized_data['data'] ) || empty( $raw_unserialized_data['metas'] ) || !is_array( $raw_unserialized_data['metas'] ) ) {
|
4613 |
-
wp_send_json_error( __FUNCTION__ . ' => invalid_import_content' );
|
4614 |
-
return;
|
4615 |
-
}
|
4616 |
-
// check version
|
4617 |
-
// => current Nimble Version must be at least import version
|
4618 |
-
if ( !empty( $raw_unserialized_data['metas']['version'] ) && version_compare( NIMBLE_VERSION, $raw_unserialized_data['metas']['version'], '<' ) ) {
|
4619 |
-
wp_send_json_error( __FUNCTION__ . ' => nimble_builder_needs_update' );
|
4620 |
-
return;
|
4621 |
-
}
|
4622 |
-
|
4623 |
-
//sek_error_log('IMPORT BEFORE FILTER ?', $raw_unserialized_data );
|
4624 |
-
|
4625 |
-
$imported_content = array(
|
4626 |
-
'data' => sek_maybe_import_imgs( $raw_unserialized_data['data'], $do_import_images = true ),
|
4627 |
-
'metas' => $raw_unserialized_data['metas'],
|
4628 |
-
// the image import errors won't block the import
|
4629 |
-
// they are used when notifying user in the customizer
|
4630 |
-
'img_errors' => !empty( Nimble_Manager()->img_import_errors ) ? implode(',', Nimble_Manager()->img_import_errors) : array()
|
4631 |
-
);
|
4632 |
-
|
4633 |
-
//sek_error_log( __FUNCTION__ . ' =>IMPORT BEFORE FILTER ?', $imported_content );
|
4634 |
-
// Send
|
4635 |
-
wp_send_json_success( $imported_content );
|
4636 |
-
}
|
4637 |
-
|
4638 |
-
|
4639 |
-
|
4640 |
-
|
4641 |
-
|
4642 |
-
|
4643 |
-
|
4644 |
-
|
4645 |
// IMPORT IMG HELPER
|
4646 |
// recursive
|
4647 |
//add_filter( 'nimble_pre_import', '\Nimble\sek_maybe_import_imgs' );
|
4648 |
function sek_maybe_import_imgs( $seks_data, $do_import_images = true ) {
|
4649 |
$new_seks_data = array();
|
|
|
|
|
4650 |
foreach ( $seks_data as $key => $value ) {
|
4651 |
if ( is_array($value) ) {
|
4652 |
$new_seks_data[$key] = sek_maybe_import_imgs( $value, $do_import_images );
|
@@ -4706,6 +4636,26 @@ function sek_ajax_get_all_saved_templates() {
|
|
4706 |
}
|
4707 |
}
|
4708 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4709 |
////////////////////////////////////////////////////////////////
|
4710 |
// TEMPLATE GET CONTENT + METAS
|
4711 |
// Fetches the json of a given user template
|
@@ -4741,6 +4691,10 @@ function sek_ajax_sek_get_user_tmpl_json() {
|
|
4741 |
// );
|
4742 |
if ( is_array( $tmpl_decoded ) && !empty( $tmpl_decoded['data'] ) && is_string( $tmpl_decoded['data'] ) ) {
|
4743 |
$tmpl_decoded['data'] = json_decode( wp_unslash( $tmpl_decoded['data'], true ) );
|
|
|
|
|
|
|
|
|
4744 |
}
|
4745 |
wp_send_json_success( $tmpl_decoded );
|
4746 |
} else {
|
@@ -4748,6 +4702,43 @@ function sek_ajax_sek_get_user_tmpl_json() {
|
|
4748 |
}
|
4749 |
}
|
4750 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4751 |
////////////////////////////////////////////////////////////////
|
4752 |
// TEMPLATE SAVE
|
4753 |
// introduced in april 2020 for https://github.com/presscustomizr/nimble-builder/issues/655
|
@@ -4756,14 +4747,16 @@ add_action( 'wp_ajax_sek_save_user_template', '\Nimble\sek_ajax_save_user_templa
|
|
4756 |
/////////////////////////////////////////////////////////////////
|
4757 |
// hook : wp_ajax_sek_save_user_template
|
4758 |
function sek_ajax_save_user_template() {
|
4759 |
-
//sek_error_log( __FUNCTION__ . ' ALORS
|
4760 |
|
4761 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
|
|
|
|
4762 |
// TMPL DATA => the nimble content
|
4763 |
-
if ( empty( $_POST['tmpl_data']) ) {
|
4764 |
wp_send_json_error( __FUNCTION__ . '_missing_template_data' );
|
4765 |
}
|
4766 |
-
if ( !is_string( $_POST['tmpl_data'] ) ) {
|
4767 |
wp_send_json_error( __FUNCTION__ . '_template_data_must_be_a_json_stringified' );
|
4768 |
}
|
4769 |
|
@@ -4782,10 +4775,14 @@ function sek_ajax_save_user_template() {
|
|
4782 |
wp_send_json_error( __FUNCTION__ . '_missing_tmpl_locations' );
|
4783 |
}
|
4784 |
|
4785 |
-
|
4786 |
-
|
4787 |
-
|
4788 |
-
|
|
|
|
|
|
|
|
|
4789 |
// make sure description and title are clean before DB
|
4790 |
$tmpl_title = wp_strip_all_tags( $_POST['tmpl_title'] );
|
4791 |
$tmpl_description = wp_strip_all_tags( $_POST['tmpl_description'] );
|
@@ -4794,7 +4791,7 @@ function sek_ajax_save_user_template() {
|
|
4794 |
|
4795 |
// sek_error_log('json decode ?', json_decode( wp_unslash( $_POST['sek_data'] ), true ) );
|
4796 |
$template_to_save = array(
|
4797 |
-
'data' => $tmpl_data,//<=
|
4798 |
'tmpl_post_name' => ( !empty( $_POST['tmpl_post_name'] ) && is_string( $_POST['tmpl_post_name'] ) ) ? $_POST['tmpl_post_name'] : null,
|
4799 |
'metas' => array(
|
4800 |
'title' => $tmpl_title,
|
@@ -4807,7 +4804,8 @@ function sek_ajax_save_user_template() {
|
|
4807 |
'tmpl_footer_location' => isset( $_POST['tmpl_footer_location'] ) ? $_POST['tmpl_footer_location'] : '',
|
4808 |
'date' => date("Y-m-d"),
|
4809 |
'theme' => sanitize_title_with_dashes( get_stylesheet() )
|
4810 |
-
)
|
|
|
4811 |
);
|
4812 |
|
4813 |
$saved_template_post = sek_update_saved_tmpl_post( $template_to_save );
|
@@ -4975,11 +4973,12 @@ add_action( 'wp_ajax_sek_save_user_section', '\Nimble\sek_ajax_save_user_section
|
|
4975 |
// hook : wp_ajax_sek_save_user_section
|
4976 |
function sek_ajax_save_user_section() {
|
4977 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
|
|
4978 |
// TMPL DATA => the nimble content
|
4979 |
-
if ( empty( $_POST['section_data']) ) {
|
4980 |
wp_send_json_error( __FUNCTION__ . '_missing_section_data' );
|
4981 |
}
|
4982 |
-
if ( !is_string( $_POST['section_data'] ) ) {
|
4983 |
wp_send_json_error( __FUNCTION__ . '_section_data_must_be_a_json_stringified' );
|
4984 |
}
|
4985 |
|
@@ -4998,10 +4997,13 @@ function sek_ajax_save_user_section() {
|
|
4998 |
// wp_send_json_error( __FUNCTION__ . '_missing_active_locations' );
|
4999 |
// }
|
5000 |
|
5001 |
-
|
5002 |
-
|
5003 |
-
|
5004 |
-
|
|
|
|
|
|
|
5005 |
|
5006 |
// make sure description and title are clean before DB
|
5007 |
$sec_title = wp_strip_all_tags( $_POST['section_title'] );
|
@@ -5020,7 +5022,8 @@ function sek_ajax_save_user_section() {
|
|
5020 |
//'active_locations' => is_array( $_POST['active_locations'] ) ? $_POST['active_locations'] : array(),
|
5021 |
'date' => date("Y-m-d"),
|
5022 |
'theme' => sanitize_title_with_dashes( get_stylesheet() )
|
5023 |
-
)
|
|
|
5024 |
);
|
5025 |
|
5026 |
$saved_section_post = sek_update_saved_section_post( $section_to_save );
|
212 |
'isTemplateSaveEnabled' => defined( 'NIMBLE_TEMPLATE_SAVE_ENABLED' ) && NIMBLE_TEMPLATE_SAVE_ENABLED, //<= APRIL 2020 : for https://github.com/presscustomizr/nimble-builder/issues/655
|
213 |
|
214 |
// Dec 2020
|
215 |
+
// When developing locally, allow a local template api request
|
216 |
+
'templateAPIUrl' => ( defined('NIMBLE_FETCH_API_TMPL_LOCALLY') && NIMBLE_FETCH_API_TMPL_LOCALLY ) ? 'http://customizr-dev.test/wp-json/nimble/v2/cravan' : 'https://api.nimblebuilder.com/wp-json/nimble/v2/cravan'
|
217 |
)
|
218 |
)
|
219 |
);//wp_localize_script()
|
647 |
// Template gallery and save
|
648 |
'Last modified' => __('Last modified', 'nimble-builder'),
|
649 |
'Use this template' => __('Use this template', 'nimble-builder'),
|
650 |
+
'Edit this template' => __('Edit this template', 'nimble-builder'),
|
651 |
'Remove this template' => __('Remove this template', 'nimble-builder'),
|
652 |
'A title is required' => __('A title is required', 'nimble-builder'),
|
653 |
'Template saved' => __('Template saved', 'nimble-builder'),
|
654 |
'Template removed' => __('Template removed', 'nimble-builder'),
|
655 |
'Error when processing templates' => __('Error when processing templates', 'nimble-builder'),
|
656 |
'Last modified' => __('Last modified', 'nimble-builder'),
|
657 |
+
'You did not save any template yet.' => __('You did not save any template yet.', 'nimble-builder'),
|
658 |
|
659 |
// Section Save
|
660 |
+
'You did not save any section yet.' => __('You did not save any section yet.', 'nimble-builder')
|
661 |
//'Remove this element' => __('Remove this element', 'text_dom'),
|
662 |
//'Remove this element' => __('Remove this element', 'text_dom'),
|
663 |
//'Remove this element' => __('Remove this element', 'text_dom'),
|
847 |
<button aria-pressed="false" data-section-mode-switcher="update" class="sek-ui-button" type="button" title="<?php _e('Update a section', 'nimble-builder'); ?>">
|
848 |
<i class="far fa-edit"></i> <?php _e('Update a section', 'nimble-builder'); ?>
|
849 |
</button>
|
850 |
+
<button aria-pressed="false" data-section-mode-switcher="edit" class="sek-ui-button" type="button" title="<?php _e('Edit a section', 'nimble-builder'); ?>">
|
851 |
+
<i class="far fa-edit"></i> <?php _e('Edit a section', 'nimble-builder'); ?>
|
852 |
+
</button>
|
853 |
<button aria-pressed="false" data-section-mode-switcher="remove" class="sek-ui-button" type="button" title="<?php _e('Remove section(s)', 'nimble-builder'); ?>">
|
854 |
<i class="fas fa-trash"></i> <?php _e('Remove section(s)', 'nimble-builder'); ?>
|
855 |
</button>
|
912 |
<button aria-pressed="false" data-tmpl-mode-switcher="update" class="sek-ui-button" type="button" title="<?php _e('Update a template', 'nimble-builder'); ?>">
|
913 |
<i class="far fa-edit"></i> <?php _e('Update a template', 'nimble-builder'); ?>
|
914 |
</button>
|
915 |
+
<button aria-pressed="false" data-tmpl-mode-switcher="edit" class="sek-ui-button" type="button" title="<?php _e('Edit a template', 'nimble-builder'); ?>">
|
916 |
+
<i class="far fa-edit"></i> <?php _e('Edit a template', 'nimble-builder'); ?>
|
917 |
+
</button>
|
918 |
<button aria-pressed="false" data-tmpl-mode-switcher="remove" class="sek-ui-button" type="button" title="<?php _e('Remove template(s)', 'nimble-builder'); ?>">
|
919 |
<i class="fas fa-trash"></i> <?php _e('Remove template(s)', 'nimble-builder'); ?>
|
920 |
</button>
|
967 |
<div id="nimble-tmpl-gallery" class="czr-preview-notification" data-sek-tmpl-dialog-mode="hidden">
|
968 |
<div class="czr-css-loader czr-mr-loader" style="display:block"><div></div><div></div><div></div></div>
|
969 |
<div id="sek-gal-top-bar">
|
970 |
+
<div id="sek-tmpl-source-switcher">
|
971 |
+
<div aria-label="" class="sek-ui-button-group" role="group">
|
972 |
+
<button type="button" aria-pressed="true" class="sek-ui-button is-selected" title="<?php _e('Nimble Builder templates', 'nimble-builder'); ?>" data-sek-tmpl-source="api_tmpl"><span><?php _e('Nimble Builder templates', 'nimble-builder'); ?></span></button>
|
973 |
+
<button type="button" aria-pressed="false" class="sek-ui-button" title="<?php _e('My templates', 'nimble-builder'); ?>" data-sek-tmpl-source="user_tmpl"><span><?php _e('My templates', 'nimble-builder'); ?></span></button>
|
974 |
+
</div>
|
975 |
+
</div>
|
976 |
<input type="text" class="sek-filter-tmpl" placeholder="<?php _e('Filter templates', 'nimble-builder'); ?>">
|
977 |
<div class="sek-ui-button-group" role="group">
|
978 |
<button class="sek-ui-button sek-close-dialog" type="button" title="<?php _e('Close', 'nimble-builder'); ?>">
|
979 |
<i class="far fa-times-circle"></i> <?php _e('Close', 'nimble-builder'); ?>
|
980 |
</button>
|
981 |
</div>
|
|
|
982 |
</div>
|
983 |
+
<div class="sek-tmpl-gallery-inner"></div>
|
984 |
<div class="sek-tmpl-gal-import-dialog">
|
985 |
<p>This page has NB sections already. Select an import options.</p>
|
986 |
<div class="sek-ui-button-group" role="group">
|
987 |
+
<button class="sek-ui-button sek-tmpl-import-replace" type="button" title="<?php _e('Replace existing sections', 'nimble-builder'); ?>" data-sek-tmpl-inject-mode="replace">
|
988 |
<?php _e('Replace existing sections', 'nimble-builder'); ?><span class="spinner"></span>
|
989 |
</button>
|
990 |
+
<button class="sek-ui-button sek-tmpl-import-before" type="button" title="<?php _e('Insert before existing sections', 'nimble-builder'); ?>" data-sek-tmpl-inject-mode="before">
|
991 |
<?php _e('Insert before existing sections', 'nimble-builder'); ?><span class="spinner"></span>
|
992 |
</button>
|
993 |
+
<button class="sek-ui-button sek-tmpl-import-after" type="button" title="<?php _e('Insert after existing sections', 'nimble-builder'); ?>" data-sek-tmpl-inject-mode="after">
|
994 |
<?php _e('Insert after existing sections', 'nimble-builder'); ?><span class="spinner"></span>
|
995 |
</button>
|
996 |
</div>
|
4570 |
|
4571 |
|
4572 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4573 |
// IMPORT IMG HELPER
|
4574 |
// recursive
|
4575 |
//add_filter( 'nimble_pre_import', '\Nimble\sek_maybe_import_imgs' );
|
4576 |
function sek_maybe_import_imgs( $seks_data, $do_import_images = true ) {
|
4577 |
$new_seks_data = array();
|
4578 |
+
// Reset img_import_errors
|
4579 |
+
Nimble_Manager()->img_import_errors = [];
|
4580 |
foreach ( $seks_data as $key => $value ) {
|
4581 |
if ( is_array($value) ) {
|
4582 |
$new_seks_data[$key] = sek_maybe_import_imgs( $value, $do_import_images );
|
4636 |
}
|
4637 |
}
|
4638 |
|
4639 |
+
////////////////////////////////////////////////////////////////
|
4640 |
+
// Fetches the api templates
|
4641 |
+
add_action( 'wp_ajax_sek_get_all_api_tmpl', '\Nimble\sek_ajax_get_all_api_templates' );
|
4642 |
+
// @hook wp_ajax_sek_get_user_saved_templates
|
4643 |
+
function sek_ajax_get_all_api_templates() {
|
4644 |
+
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4645 |
+
|
4646 |
+
$decoded_templates = sek_get_all_api_templates();
|
4647 |
+
|
4648 |
+
if ( is_array($decoded_templates) ) {
|
4649 |
+
wp_send_json_success( $decoded_templates );
|
4650 |
+
} else {
|
4651 |
+
if ( !empty( $decoded_templates ) ) {
|
4652 |
+
sek_error_log( __FUNCTION__ . ' error => invalid templates returned', $decoded_templates );
|
4653 |
+
wp_send_json_error( __FUNCTION__ . ' error => invalid templates returned' );
|
4654 |
+
}
|
4655 |
+
}
|
4656 |
+
}
|
4657 |
+
|
4658 |
+
|
4659 |
////////////////////////////////////////////////////////////////
|
4660 |
// TEMPLATE GET CONTENT + METAS
|
4661 |
// Fetches the json of a given user template
|
4691 |
// );
|
4692 |
if ( is_array( $tmpl_decoded ) && !empty( $tmpl_decoded['data'] ) && is_string( $tmpl_decoded['data'] ) ) {
|
4693 |
$tmpl_decoded['data'] = json_decode( wp_unslash( $tmpl_decoded['data'], true ) );
|
4694 |
+
$tmpl_decoded['data'] = sek_maybe_import_imgs( $tmpl_decoded['data'], $do_import_images = true );
|
4695 |
+
// the image import errors won't block the import
|
4696 |
+
// they are used when notifying user in the customizer
|
4697 |
+
$tmpl_decoded['img_errors'] = !empty( Nimble_Manager()->img_import_errors ) ? implode(',', Nimble_Manager()->img_import_errors) : array();
|
4698 |
}
|
4699 |
wp_send_json_success( $tmpl_decoded );
|
4700 |
} else {
|
4702 |
}
|
4703 |
}
|
4704 |
|
4705 |
+
|
4706 |
+
|
4707 |
+
add_action( 'wp_ajax_sek_get_api_tmpl_json', '\Nimble\sek_ajax_sek_get_api_tmpl_json' );
|
4708 |
+
// @hook wp_ajax_sek_get_user_saved_templates
|
4709 |
+
function sek_ajax_sek_get_api_tmpl_json() {
|
4710 |
+
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4711 |
+
|
4712 |
+
// We must have a tmpl_post_name
|
4713 |
+
if ( empty( $_POST['api_tmpl_name']) || !is_string( $_POST['api_tmpl_name'] ) ) {
|
4714 |
+
wp_send_json_error( __FUNCTION__ . '_missing_tmpl_post_name' );
|
4715 |
+
}
|
4716 |
+
$tmpl_name = $_POST['api_tmpl_name'];
|
4717 |
+
$raw_tmpl = sek_get_tmpl_api_data();// <= returns an unserialized array, in which the template['data'] is NOT a JSON, unlike for user saved templates
|
4718 |
+
if( !is_array( $raw_tmpl) || empty( $raw_tmpl ) ) {
|
4719 |
+
sek_error_log( __FUNCTION__ . ' problem => no api template collection available when getting template : ' . $tmpl_name );
|
4720 |
+
wp_send_json_error( __FUNCTION__ . '_empty_api_template_collection' );
|
4721 |
+
}
|
4722 |
+
//sek_error_log( __FUNCTION__ . ' api template collection', $raw_tmpl[$tmpl_name] );
|
4723 |
+
if ( empty( $raw_tmpl[$tmpl_name] ) ) {
|
4724 |
+
sek_error_log( __FUNCTION__ . ' problem => template not found in api template collection : ' . $tmpl_name );
|
4725 |
+
wp_send_json_error( __FUNCTION__ . '_api_template_not_found' );
|
4726 |
+
// Note that $raw_tmpl[$tmpl_name]['data'] is saved as a json
|
4727 |
+
} else if ( !isset($raw_tmpl[$tmpl_name]['data'] ) || empty( $raw_tmpl[$tmpl_name]['data'] ) ) {
|
4728 |
+
sek_error_log( __FUNCTION__ . ' problem => missing or invalid data property for template : ' . $tmpl_name, $raw_tmpl[$tmpl_name] );
|
4729 |
+
wp_send_json_error( __FUNCTION__ . '_missing_data_property' );
|
4730 |
+
} else {
|
4731 |
+
// $tmpl_decoded = $raw_tmpl[$tmpl_name];
|
4732 |
+
$tmpl_as_array = $raw_tmpl[$tmpl_name];
|
4733 |
+
$raw_tmpl[$tmpl_name]['data'] = sek_maybe_import_imgs( $raw_tmpl[$tmpl_name]['data'], $do_import_images = true );
|
4734 |
+
$raw_tmpl[$tmpl_name]['img_errors'] = !empty( Nimble_Manager()->img_import_errors ) ? implode(',', Nimble_Manager()->img_import_errors) : array();
|
4735 |
+
wp_send_json_success( $raw_tmpl[$tmpl_name] );
|
4736 |
+
}
|
4737 |
+
return [];
|
4738 |
+
}
|
4739 |
+
|
4740 |
+
|
4741 |
+
|
4742 |
////////////////////////////////////////////////////////////////
|
4743 |
// TEMPLATE SAVE
|
4744 |
// introduced in april 2020 for https://github.com/presscustomizr/nimble-builder/issues/655
|
4747 |
/////////////////////////////////////////////////////////////////
|
4748 |
// hook : wp_ajax_sek_save_user_template
|
4749 |
function sek_ajax_save_user_template() {
|
4750 |
+
//sek_error_log( __FUNCTION__ . ' ALORS ??', $_POST );
|
4751 |
|
4752 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4753 |
+
$is_edit_metas_only_case = isset( $_POST['edit_metas_only'] ) && 'yes' === $_POST['edit_metas_only'];
|
4754 |
+
|
4755 |
// TMPL DATA => the nimble content
|
4756 |
+
if ( !$is_edit_metas_only_case && empty( $_POST['tmpl_data']) ) {
|
4757 |
wp_send_json_error( __FUNCTION__ . '_missing_template_data' );
|
4758 |
}
|
4759 |
+
if ( !$is_edit_metas_only_case && !is_string( $_POST['tmpl_data'] ) ) {
|
4760 |
wp_send_json_error( __FUNCTION__ . '_template_data_must_be_a_json_stringified' );
|
4761 |
}
|
4762 |
|
4775 |
wp_send_json_error( __FUNCTION__ . '_missing_tmpl_locations' );
|
4776 |
}
|
4777 |
|
4778 |
+
if ( $is_edit_metas_only_case ) {
|
4779 |
+
$tmpl_data = [];
|
4780 |
+
} else {
|
4781 |
+
// clean level ids and replace them with a placeholder string
|
4782 |
+
$tmpl_data = json_decode( wp_unslash( $_POST['tmpl_data'] ), true );
|
4783 |
+
$tmpl_data = sek_template_save_clean_id( $tmpl_data );
|
4784 |
+
}
|
4785 |
+
|
4786 |
// make sure description and title are clean before DB
|
4787 |
$tmpl_title = wp_strip_all_tags( $_POST['tmpl_title'] );
|
4788 |
$tmpl_description = wp_strip_all_tags( $_POST['tmpl_description'] );
|
4791 |
|
4792 |
// sek_error_log('json decode ?', json_decode( wp_unslash( $_POST['sek_data'] ), true ) );
|
4793 |
$template_to_save = array(
|
4794 |
+
'data' => $tmpl_data,//<= array
|
4795 |
'tmpl_post_name' => ( !empty( $_POST['tmpl_post_name'] ) && is_string( $_POST['tmpl_post_name'] ) ) ? $_POST['tmpl_post_name'] : null,
|
4796 |
'metas' => array(
|
4797 |
'title' => $tmpl_title,
|
4804 |
'tmpl_footer_location' => isset( $_POST['tmpl_footer_location'] ) ? $_POST['tmpl_footer_location'] : '',
|
4805 |
'date' => date("Y-m-d"),
|
4806 |
'theme' => sanitize_title_with_dashes( get_stylesheet() )
|
4807 |
+
),
|
4808 |
+
'edit_metas_only' => $is_edit_metas_only_case ? 'yes' : 'no'
|
4809 |
);
|
4810 |
|
4811 |
$saved_template_post = sek_update_saved_tmpl_post( $template_to_save );
|
4973 |
// hook : wp_ajax_sek_save_user_section
|
4974 |
function sek_ajax_save_user_section() {
|
4975 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4976 |
+
$is_edit_metas_only_case = isset( $_POST['edit_metas_only'] ) && 'yes' === $_POST['edit_metas_only'];
|
4977 |
// TMPL DATA => the nimble content
|
4978 |
+
if ( !$is_edit_metas_only_case && empty( $_POST['section_data']) ) {
|
4979 |
wp_send_json_error( __FUNCTION__ . '_missing_section_data' );
|
4980 |
}
|
4981 |
+
if ( !$is_edit_metas_only_case && !is_string( $_POST['section_data'] ) ) {
|
4982 |
wp_send_json_error( __FUNCTION__ . '_section_data_must_be_a_json_stringified' );
|
4983 |
}
|
4984 |
|
4997 |
// wp_send_json_error( __FUNCTION__ . '_missing_active_locations' );
|
4998 |
// }
|
4999 |
|
5000 |
+
if ( $is_edit_metas_only_case ) {
|
5001 |
+
$seks_data = [];
|
5002 |
+
} else {
|
5003 |
+
// clean level ids and replace them with a placeholder string
|
5004 |
+
$seks_data = json_decode( wp_unslash( $_POST['section_data'] ), true );
|
5005 |
+
$seks_data = sek_section_save_clean_id( $seks_data );
|
5006 |
+
}
|
5007 |
|
5008 |
// make sure description and title are clean before DB
|
5009 |
$sec_title = wp_strip_all_tags( $_POST['section_title'] );
|
5022 |
//'active_locations' => is_array( $_POST['active_locations'] ) ? $_POST['active_locations'] : array(),
|
5023 |
'date' => date("Y-m-d"),
|
5024 |
'theme' => sanitize_title_with_dashes( get_stylesheet() )
|
5025 |
+
),
|
5026 |
+
'edit_metas_only' => $is_edit_metas_only_case ? 'yes' : 'no'
|
5027 |
);
|
5028 |
|
5029 |
$saved_section_post = sek_update_saved_section_post( $section_to_save );
|
nimble-builder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Nimble Page Builder
|
4 |
* Plugin URI: https://nimblebuilder.com
|
5 |
* Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
|
6 |
-
* Version: 2.1.
|
7 |
* Text Domain: nimble-builder
|
8 |
* Author: Press Customizr
|
9 |
* Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
|
@@ -16,7 +16,7 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
16 |
/* ------------------------------------------------------------------------- *
|
17 |
* CONSTANTS
|
18 |
/* ------------------------------------------------------------------------- */
|
19 |
-
$current_version = "2.1.
|
20 |
|
21 |
if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
|
22 |
if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
|
3 |
* Plugin Name: Nimble Page Builder
|
4 |
* Plugin URI: https://nimblebuilder.com
|
5 |
* Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
|
6 |
+
* Version: 2.1.33
|
7 |
* Text Domain: nimble-builder
|
8 |
* Author: Press Customizr
|
9 |
* Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
|
16 |
/* ------------------------------------------------------------------------- *
|
17 |
* CONSTANTS
|
18 |
/* ------------------------------------------------------------------------- */
|
19 |
+
$current_version = "2.1.33";
|
20 |
|
21 |
if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
|
22 |
if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: page builder, visual editor, customizer, drag and drop, header, footer, la
|
|
6 |
Requires at least: 4.7
|
7 |
Requires PHP: 5.4
|
8 |
Tested up to: 5.6
|
9 |
-
Stable tag: 2.1.
|
10 |
License: GPLv3
|
11 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
|
@@ -120,9 +120,13 @@ We have also published a detailed [troubleshooting guide for Nimble Builder](htt
|
|
120 |
If you can't troubleshoot your issue, please open a new thread in [Nimble Builder support forum](https://wordpress.org/support/plugin/nimble-builder/).
|
121 |
|
122 |
== Upgrade Notice ==
|
123 |
-
2.1.
|
124 |
|
125 |
== Changelog ==
|
|
|
|
|
|
|
|
|
126 |
= 2.1.32 January 12, 2021 =
|
127 |
* fixed : [form module] javascript may break after submitting the form when jQuery called too early
|
128 |
|
6 |
Requires at least: 4.7
|
7 |
Requires PHP: 5.4
|
8 |
Tested up to: 5.6
|
9 |
+
Stable tag: 2.1.33
|
10 |
License: GPLv3
|
11 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
|
120 |
If you can't troubleshoot your issue, please open a new thread in [Nimble Builder support forum](https://wordpress.org/support/plugin/nimble-builder/).
|
121 |
|
122 |
== Upgrade Notice ==
|
123 |
+
2.1.33 : [menu module] clicking on a sub menu item doesn't open the link. [user sections] edit icon to modify the title and description of the section.
|
124 |
|
125 |
== Changelog ==
|
126 |
+
= 2.1.33 January 21, 2021 =
|
127 |
+
* fixed : [menu module] clicking on a sub menu item doesn't open the link
|
128 |
+
* added : [user sections] edit icon to modify the title and description of the section
|
129 |
+
|
130 |
= 2.1.32 January 12, 2021 =
|
131 |
* fixed : [form module] javascript may break after submitting the form when jQuery called too early
|
132 |
|