Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/themify-builder/js/editor/themify-builder-app.min.js
Назад
var tb_app;(($,k,u,c,S,C)=>{"use strict";let l=null;const x=tb_app={breakpointsReverse:Object.keys(themifyBuilder.breakpoints).reverse(),isGSPage:S.body.classList.contains("gs_post"),mode:c!==u.self?"visual":"",activeBreakPoint:"desktop",inlineEditor:c!==u.self,activeModel:null,isDocked:!1,zoomMeta:!1,isPreview:!1,scrollTo:!1,is_builder_ready:null,isSafari:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Utils:{},jsModuleLoaded(){if(null===l){const e=new URL(S.currentScript.src),t=[k.loadJs(k.url+"js/admin/notification",!!u.TF_Notification)],i=["undomanager","gradient","lightbox","constructor","drag","drop","panel","action-bar","toolbar","gs","ticks"],s=(e.search="",e.pathname=e.pathname.replace(/themify-builder-app(\.min)?\.js/,""),e.toString()+"modules/");k.isTouch||i.unshift("right-click"),k.builder_url||(k.builder_url=e.toString().replace("js/editor/",""));for(let e=i.length-1;-1<e;--e)t.push(k.loadJs(s+i[e]));"visual"===x.mode&&t.push(k.loadJs("image-resize",!!u.ThemifyImageResize)),t[0].then(()=>{TF_Notification.init().then(e=>{"visual"===x.mode&&c.document.body.appendChild(e)})}),l=Promise.all(t).then(()=>{ThemifyConstructor.init()})}return l}},p=!!themifyBuilder.is_fullSection,d=(x.breakpointsReverse.push("desktop"),k.upload_url=themifyBuilder.upload_url,x.jsModuleLoaded(),{key:"tb_clipboard",set(e,t){const i={};i[e]=t,localStorage.setItem(this.key,JSON.stringify(i))},get(e){const t=JSON.parse(localStorage.getItem(this.key));return null!==t&&t[e]!==C&&t[e]}});x.template=e=>{const t=c._.memoize(t=>{let i,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return e=>(i=i||c._.template(S.tfId("tmpl-"+t).innerHTML,s))(e)});return t(e)},x.LocalFetch=(e,t,i)=>{if(e.nonce=themifyBuilder.nonce,!e.bid){const s=x.Builder!==C?x.Builder.get():C;e.bid=s!==C&&s.id!==C?s.id:themifyBuilder.post_ID,e.bid===C&&(e.bid="")}return k.trigger("tb_filter_fetch",e),k.fetch(e,t,i)},x.FormTemplates={key:"tb_form_templates_",data:null,prms:null,init(){return null===this.prms&&(this.prms=new Promise((t,e)=>{if(null!==this.data)t();else{const r=e=>{this.data=e,t()},i=this.get();if(!1!==i)r(i);else{let i={},s=Object.keys(themifyBuilder.modules).length+3,l={action:"tb_load_form_templates"},o=t=>{++t,l.page=t,x.LocalFetch(l).then(e=>{e&&(i=Object.assign(i,e),s>Object.keys(i).length?o(t):(r(i),this.set(i),i=o=s=l=t=null))}).catch(e)};o(0)}}})),this.prms},getItem(e){return e===C?this.data:this.data[e]},set(e){try{k.requestIdleCallback(()=>{localStorage.setItem(this.key,JSON.stringify({val:e,h:this.getHash()}))},-1,3e3)}catch(e){}},getHash(){return k.hash(k.v+Object.keys(themifyBuilder.modules)+(themifyBuilder.cache_data||""))},get(){if(!themifyBuilder.debug)try{let e=localStorage.getItem(this.key);if(e&&(e=JSON.parse(e)).h===this.getHash())return e.val}catch(e){}return!1}},x.FormTemplates.init(),x.getColClass=()=>({1:["col-full"],2:["col4-2","col4-2"],3:["col3-1","col3-1","col3-1"],4:["col4-1","col4-1","col4-1","col4-1"],5:["col5-1","col5-1","col5-1","col5-1","col5-1"],6:["col6-1","col6-1","col6-1","col6-1","col6-1","col6-1"],"1_2":["col3-1","col3-2"],"2_1":["col3-2","col3-1"],"1_3":["col4-1","col4-3"],"3_1":["col4-3","col4-1"],"1_1_2":["col4-1","col4-1","col4-2"],"1_2_1":["col4-1","col4-2","col4-1"],"2_1_1":["col4-2","col4-1","col4-1"]}),x.getColClassValues=()=>Array.from(new Set([].concat.apply([],Object.values(x.getColClass())))),x.Spinner={el:c.document.tfClass("tb_loader")[0],showLoader(l="show"){return new Promise(t=>{const i=this.el,s=i.classList;"spinhide"===l?(s.add("tf_hide"),s.remove("tf_opacity","tb_done","tb_error","tb_show"),t()):s.contains("tb_"+l)?t():(s.remove("tf_hide","tf_opacity","tb_done","tb_error","tb_show"),"show"!==l?("error"!==l&&(l="done"),s.add("tb_"+l),requestAnimationFrame(()=>{if(s.contains("tb_"+l)){const e=function(){s.remove("tb_"+l,"tf_opacity"),s.add("tf_hide"),this.tfOff("transitioncancel transitionend",e,{passive:!0,once:!0}),t()};i.tfOn("transitionend transitioncancel",e,{passive:!0,once:!0}),s.add("tf_opacity")}})):(s.add("tb_show"),t()))})}},x.Helper={correctBuilderData(s){if(!s||!Array.isArray(s)){const t=[];if(s)for(let e in s)t.push(s[e]);s=t}for(let e=s.length-1;-1<e;--e)if(s[e]){let i=s[e].cols;if(s[e].styling===C||s[e].styling&&!Array.isArray(s[e].styling)||(s[e].styling={}),i){if(!Array.isArray(i)){let t=[];for(let e in i)t.push(i[e]);i=s[e].cols=t}for(let e=i.length-1;-1<e;--e)i[e]?(i[e].styling===C||i[e].styling&&!Array.isArray(i[e].styling)||(i[e].styling={}),i[e].modules&&(i[e].modules=this.correctBuilderData(i[e].modules))):i.splice(e,1)}}else s.splice(e,1);return s},cloneDom(e,t){if(null===e)return e;if((e=e[0]!==C?e[0]:e).nodeType===Node.TEXT_NODE)return e.cloneNode(!0);const s=!0===t?e:e.cloneNode(!0);if("visual"===x.mode){const l=s.tfTag("video");if(0<l.length){for(let e=l.length-1;-1<e;--e)l[e].pause();for(let e=s.tfClass("big-video-wrap"),t=e.length-1;-1<t;--t)e[t]&&e[t].remove()}for(let e=s.tfClass("tb_dragger"),t=e.length-1;-1<t;--t)e[t].remove();for(let t=k.selectWithParent("[contenteditable]",s),i=t.length-1;-1<i;--i){t[i].setAttribute("contenteditable","false");let e=t[i].closest(".tb_editor_on");e&&e.classList.remove("tb_editor_on","tb_editor_clicked")}for(let e=k.selectWithParent("[draggable]",s),t=e.length-1;-1<t;--t)e[t].setAttribute("draggable","true")}for(let e=s.tfClass("tb_action_wrap"),t=e.length-1;-1<t;--t){while(null!==e[t].firstChild)e[t].lastChild.remove();e[t].removeAttribute("id"),e[t].removeAttribute("style"),e[t].classList.remove("tb_clicked")}const i=s.querySelectorAll(".tb_clicked,.tb_editor_on,.tb_element_clicked,.tb_selected_img,.tb_editor_clicked,.tb_hide_drag_col_right,.tb_hide_drag_left,.tb_hide_drag_right,.tb_drag_one_column,.tb_drag_side_column,.tb_draggable_item,.tb_column_drag_inner,.tb_active_action_bar,.compact-mode,.tf_dragger_negative");for(let e=i.length-1;-1<e;--e)i[e].classList.remove("tb_clicked","tb_element_clicked","tb_editor_on","tb_selected_img","tb_editor_clicked","tb_hide_drag_col_right","tb_hide_drag_left","tb_hide_drag_right","tb_drag_one_column","tb_drag_side_column","tb_draggable_item","tb_column_drag_inner","tb_active_action_bar","compact-mode","tf_dragger_negative");for(let e=s.querySelectorAll("[data-drag-w],[data-pos]"),t=e.length-1;-1<t;--t)e[t].removeAttribute("data-drag-w"),e[t].removeAttribute("data-pos");return s.classList.remove("tb_clicked","tb_selected_img","tb_element_clicked","tb_editor_on","tb_editor_clicked","tb_hide_drag_col_right","tb_hide_drag_left","tb_hide_drag_right","tb_drag_one_column","tb_drag_side_column","tb_draggable_item","tb_column_drag_inner","tb_active_action_bar","compact-mode","tf_dragger_negative"),s.removeAttribute("data-drag-w"),s.removeAttribute("data-pos"),s},cloneObject(t){if(Array.isArray(t)){let e=t.length;const i=new Array(e);while(e--)"object"==typeof t[e]?i[e]=ThemifyStyles.extend(!0,{},t[e]):Array.isArray(t[e])?i[e]=this.cloneObject(t[e]):i[e]=t[e];return i}return ThemifyStyles.extend(!0,{},t)},compareObject(t,i){if(!t||!i)return!0;{const e=(t.hasOwnProperty("length")?t:Object.keys(t)).length,s=(i.hasOwnProperty("length")?i:Object.keys(i)).length;if(e!==s)return!0;if(0<e)for(let e in t){if(i[e]===C)return!0;if(null!==t[e]&&"object"==typeof t[e]){if("object"!=typeof i[e]||this.compareObject(t[e],i[e]))return!0}else if(i[e]!=t[e]||"object"==typeof i[e]&&"object"!=typeof t[e])return!0}}return!1},isImageUrl(e){if(!e)return!1;const t=e.split("?")[0].split(".");return["jpg","jpeg","tiff","png","gif","bmp","svg","webp","apng"].includes(t[t.length-1])},loadJsZip(){return k.loadJs("https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js",!!u.JSZip,!1)},toRGBA(e){return ThemifyStyles.toRGBA(e)},getIcon(e,t){if(void 0!==themifyBuilder.fontello_prefix){const r=new RegExp(themifyBuilder.fontello_use_suffix?themifyBuilder.fontello_prefix+"$":"^"+themifyBuilder.fontello_prefix);if(r.test(e)){const n=S.createElement("i");return n.setAttribute("class",e),n}}e="tf-"+e.trim().replace(" ","-");const i="http://www.w3.org/2000/svg",s=S.createElementNS(i,"use"),l=S.createElementNS(i,"svg");let o="tf_fa "+e;return t&&(o+=" "+t),l.setAttribute("class",o),s.setAttributeNS(null,"href","#"+e),l.appendChild(s),l},getLottie(s,l){if(s.path&&s.seg){let e={path:s.path,seg:s.seg},t=S.createElement("tf-lottie"),i=S.createElement("template");return s.st&&(e.st=s.st),s.sp&&1!=s.sp&&(e.sp=s.sp),s.dir&&(e.dir=s.dir),s.fid&&(e.fid=s.fid),s.r&&"svg"!==s.r&&(e.r=s.r),1<s.count&&(e.count=s.count),l&&(e.sel=l),s.lp||(e={actions:e,loop:1}),i.innerHTML=JSON.stringify(e),t.appendChild(i),t}return S.createDocumentFragment()},getColor(e){let t=e.value;if(""!==t)if(null!==e.getAttribute("data-tfminicolors-initialized"))t=$(e).tfminicolors("rgbaString");else{const i=e.dataset.opacity;""!==i&&null!==i&&(t=ThemifyStyles.toRGBA(t+"_"+i))}return t},getBreakpointName(e){return x.ToolBar.el.querySelector(".breakpoint-"+e+" span").textContent},generateUniqueID(){return(Math.random().toString(36).substr(2,4)+(new Date).getUTCMilliseconds().toString()).substr(0,7)},clearElementId(t,i){for(let e in t){!0===i?t[e].element_id=this.generateUniqueID():delete t[e].element_id;let s=t[e].styling||t[e].mod_settings;if(s!==C){if(s.custom_css_id!==C&&""!==s.custom_css_id){let i=1;while(1){let e=s.custom_css_id,t=(1!==i&&(e+="-"+i.toString()),S.tfId(e));if(null===t||null===t.closest(".module_row")){s.custom_css_id=e;break}++i}}if(s.builder_content!==C){let e="string"==typeof s.builder_content?JSON.parse(s.builder_content):s.builder_content;this.clearElementId(e,!0),s.builder_content=e}}t[e].cols!==C?this.clearElementId(t[e].cols,i):t[e].modules!==C&&this.clearElementId(t[e].modules,i)}return t},clear(r,t){const n=!0===(t=t===C?Array.isArray(r):t)?[]:{},e=u.tbpDynamic||!1;for(let o in r)if("null"!==o&&null!==r[o]&&r[o]!==C&&"null"!==r[o]&&"undefined"!==r[o]&&r.hasOwnProperty(o))if(Array.isArray(r[o])){let e=this.clear(r[o],!0);0<e.length&&(!0===t?n.push(e):n[o]=e)}else if(o===e)if("{}"===r[o]||""===r[o])delete r[o],delete n[o];else{let t=r[o];for(let e in t="string"==typeof t?JSON.parse(t):t)t[e].repeatable===C&&(t[e].item===C?delete t[e]:r[e]!==C&&(delete r[e],delete n[e]));r[o]=n[o]=t}else if("object"==typeof r[o]){let i;if("breakpoint_mobile"===o||"breakpoint_tablet"===o||"breakpoint_tablet_landscape"===o){for(let t in i=r[o])if(i[t]===C||null===i[t]||""===i[t])delete i[t];else if(t.includes("_unit",2)){let e=t.replace("_unit","");i[e]!==C&&""!==i[e]||(delete i[t],""===i[e]&&delete i[e])}}else!r[o].element_id&&(r[o].cols&&Array.isArray(r[o].cols)||r[o].mod_name||r[o].modules&&Array.isArray(r[o].modules))&&(r[o].element_id=x.Helper.generateUniqueID()),i=this.clear(r[o]);i&&0<Object.keys(i).length?!0===t?n.push(i):n[o]=i:"sizes"===o&&(n[o]={})}else if(null!==r[o]&&r[o]!==C&&""!==r[o]&&"tb_default_color"!==r[o]&&"def"!==r[o]&&""!==o&&"pixels"!==r[o]&&"default"!==r[o]&&"|"!==r[o]&&!("hide_anchor"===o&&!r[o]||"show"===r[o]&&0===o.indexOf("visibility_")||"unstick_when_condition"===o&&"hits"===r[o]||"unstick_when_pos"===o&&"this"===r[o]||"unstick_when_element"===o&&"builder_end"===r[o]||("stick_at_pos_val_unit"===o||"unstick_when_pos_val_unit"===o)&&"px"===r[o]))if("custom_parallax_scroll_speed"!==o||r[o])if("unstick_when_check"!==r[o]&&("unstick_when_check"===o||"unstick_when_check_tl"===o||"unstick_when_check_t"===o||"unstick_when_check_m"===o)||"builder_end"===r[o]&&("unstick_when_element"===o||"unstick_when_element_tl"===o||"unstick_when_element_t"===o||"unstick_when_element_m"===o)||"stick_at_check"===o&&"stick_at_check"!==r[o]||!("-1"!=r[o]&&r[o]||"stick_at_check_tl"!==o&&"stick_at_check_t"!==o&&"stick_at_check_m"!==o)){let e="";"unstick_when_element_tl"===o||"stick_at_check_tl"===o||"unstick_when_check_tl"===o?e="_ti":"unstick_when_element_t"===o||"stick_at_check_t"===o||"unstick_when_check_t"===o?e="_t":"unstick_when_element_m"!==o&&"stick_at_check_m"!==o&&"unstick_when_check_m"!==o||(e="_m"),delete n["unstick_when_el_row_id"+e],delete n["unstick_when_el_mod_id"+e],delete n["unstick_when_condition"+e],delete r["unstick_when_el_row_id"+e],delete r["unstick_when_el_mod_id"+e],delete r["unstick_when_condition"+e],delete n["unstick_when_pos"+e],delete n["unstick_when_pos_val"+e],delete n["unstick_when_element"+e],delete n["unstick_when_pos_val_unit"+e],delete r["unstick_when_pos"+e],delete r["unstick_when_pos_val"+e],delete r["unstick_when_pos_val_unit"+e],delete r["unstick_when_element"+e],"stick_at_check"!==o&&"stick_at_check_tl"!==o&&"stick_at_check_t"!==o&&"stick_at_check_m"!==o||("stick_at_check"!==o&&"-1"!=r[o]||(delete r[o],delete n[o]),delete r["stick_at_position"+e],delete n["stick_at_position"+e])}else if("background_image-css"===o||o===C||null===o||""===o||!1===o||"stick_at_position"===o&&"top"===r[o]||"resp_no_bg"===o&&!1===r[o]||o===x.GS.key&&""===r[o].trim()||"background_gradient-css"===o||"cover_gradient-css"===o||"cover_gradient_hover-css"===o||"background_image-type_image"===o||"custom_parallax_scroll_reverse_reverse"===o||"|single"===r[o]||"|multiple"===r[o]||("custom_parallax_scroll_reverse"===o||"custom_parallax_scroll_fade"===o||"visibility_all"===o||"sticky_visibility"===o||"background_zoom"===o||"b_sh_inset"===o||"background_image-circle-radial"===o)&&!r[o])delete r[o],delete n[o];else{if("builder_content"===o)"string"==typeof r[o]&&(r[o]=JSON.parse(r[o])),r[o]=this.clear(r[o],!0);else{let l=[];if(0===o.indexOf("checkbox_")&&o.includes("_apply_all",6)){r[o]?n[o]=r[o]:l.push(o);let i=o.replace("_apply_all","").replace("checkbox_",""),s=["top","left","right","bottom"];for(let t=3;-1<t;--t){let e=i+"_"+s[t]+"_unit";"px"===r[e]?l.push(e):r[e]!==C&&null!==r[e]&&""!==r[e]&&(n[e]=r[e])}}else o.includes("gradient",3)?("180"==r[o]||"linear"===r[o]||r[o]===$.ThemifyGradient.default||!1===r[o]&&o.includes("-circle-radial",3))&&l.push(o):("px"===r[o]&&o.includes("_unit",2)&&!o.includes("frame_")||"%"===r[o]&&o.includes("_unit",2)&&o.includes("frame_")||"background_zoom"===o&&""===r[o]||"none"===r[o]&&o.includes("frame_layout")||"solid"===r[o]||!1===r[o]&&(o.includes("_user_role",3)||o.includes("_appearance",3))||!(r[o]&&"false"!==r[o]||"margin-top_opp_top"!==o&&"m_t_h_opp_top"!==o&&0!==o.indexOf("padding_opp_")&&0!==o.indexOf("margin_opp_")))&&l.push(o);if(0<l.length){for(let e=l.length-1;-1<e;--e)delete n[l[e]],delete r[l[e]];l.length=0,l=[];continue}}!0===t?n.push(r[o]):n[o]=r[o]}else delete n.custom_parallax_scroll_reverse,delete n.custom_parallax_scroll_fade,delete n[o],delete r.custom_parallax_scroll_reverse,delete r.custom_parallax_scroll_fade,delete r[o];return n},async codeMirror(e,t,i){try{(i=i||{}).isDarkMode=x.isDarked,await c.Themify.loadJs(k.url+"js/admin/modules/codemirror/codemirror",!!c.ThemifyCodeMiror);const s=new c.ThemifyCodeMiror(e,t,i);return await s.run(),s}catch(e){return null}}},x.Registry={items:new Map,events:new Map,add(e){return this.items.set(e.id,e),this},get(e){const t=this.items.get(e);return t!==C?t:null},remove(e,t){const i=this.get(e);return i&&(i.el.remove(),!0===t)&&(this.items.delete(e),this.events.delete(e)),this},destroy(){for(let[e,t]of this.items)t.el.remove();return this.items.clear(),this.events.clear(),this},on(e,t,i){if(i!==C){const s=this.events.get(e)||{};s[t]===C&&(s[t]=[]),s[t].push(i),this.events.set(e,s)}return this},off(e,t,i){const s=this.events.get(e);if(s!==C)if(t){if(s[t]!==C){if(i){for(let e=s[t].length-1;-1<e;--e)s[t][e]===i&&s[t].splice(e,1);0===s[t].length&&delete s[t]}else delete s[t];this.events.set(e,s)}}else this.events.delete(e);return this},trigger(e,s,...l){const o=this.events.get(e),r=[];if(o!==C&&o[s]!==C){let i="string"==typeof e?this.get(e):e;i=i||e;for(let t=o[s].length-1;-1<t;--t){let e=o[s][t].apply(i,l);e!==C&&e instanceof Promise&&r.push(e)}}return Promise.all(r).catch(()=>{})}},x.Base=class{constructor(e){this.fields=Object.assign({},this.defaults(),e)}initialize(){let e=this.fields.element_id;e&&!x.Registry.items.has(e)||(this.fields.element_id=e=x.Helper.generateUniqueID()),this.id=e,this.el=S.createElement("div"),"module"!==this.type&&this.el.appendChild(S.tfId("tmpl-builder_"+this.type+"_item").content.cloneNode(!0)),this.setHtmlAttributes(),x.Registry.add(this),x.Registry.on(this.id,"edit",this.edit).on(this.id,"save",this.save).on(this.id,"delete",this.delete).on(this.id,"copy",this.copy).on(this.id,"paste",this.paste).on(this.id,"duplicate",this.duplicate).on(this.id,"import",this.import).on(this.id,"export",this.export),"visual"in this&&this.visual()}setData(o,r){return new Promise(async e=>{x.Helper.clearElementId([o]);const t=this.type.charAt(0).toUpperCase()+this.type.slice(1),i=new x[t](o,this.isSubCol),s=r.dataset.cid;if(s&&(i.el.dataset.oldCid=s),r.replaceWith(i.el),"visual"===x.mode){const l=await i.trigger("recreate");e(l)}else x.Utils.runJs(i.el),e(i.el)})}get(e){const t="module"===this.type?"mod_settings":"styling";return"element_id"===e?this.id:"mod_name"===e?"module"===this.type?this.fields[e]:this.type:"sizes"===e||"cols"===e||"modules"===e||"mod_settings"===e||"styling"===e?"sizes"===e||"cols"===e||"modules"===e?this.fields[e]:this.fields[t]:(this.defaults()[e]===C&&("row"!==this.type&&"subrow"!==this.type&&("column"!==this.type||"grid_class"!==e&&"grid_width"!==e)||"grid_class"!==e&&"grid_width"!==e&&"gutter"!==e&&"column_alignment"!==e&&"column_h"!==e&&"desktop_dir"!==e&&"tablet_landscape_dir"!==e&&"tablet_dir"!==e&&"mobile_dir"!==e&&"col_tablet_landscape"!==e&&"col_tablet"!==e&&"col_mobile"!==e)?this.fields[t]:this.fields)[e]}set(e,t){const i="module"===this.type?"mod_settings":"styling";return"cols"===e||"modules"===e||"sizes"===e||"mod_settings"===e||"styling"===e||"element_id"===e?("sizes"!==e&&"cols"!==e&&"modules"!==e&&("element_id"===e?this.id=t:e=i),this.fields[e]=t):this.defaults()[e]!==C?this.fields[e]=t:this.fields[i][e]=t,this}unset(e){return"mod_settings"!==e&&"styling"!==e||(e="module"===this.type?"mod_settings":"styling"),delete this.fields[e],this}destroy(e=!1){x.Registry.remove(this.id,e)}setHtmlAttributes(){const t=this.attributes();t["data-cid"]=this.id,t.draggable=!0,t.class+=" tb_element_cid_"+this.id;for(let e in t)this.el.setAttribute(e,t[e])}trigger(e,...t){return x.Registry.trigger(this.id,e,...t)}getData(){let e={};switch(this.type){case"row":case"subrow":e=x.Utils._getRowSettings(this.el,this.type);break;case"module":e=x.Helper.cloneObject(this.fields);break;case"column":case"sub-column":const t=this.el.closest(!0===this.isSubCol?".active_subrow":".module_row"),i=x.Utils._getRowSettings(t,!0===this.isSubCol?"subrow":"row"),s=Array.from(this.el.parentNode.children).indexOf(this.el);e=i.cols[s];break}return x.Helper.clear(e)}fixSafariSrcSet(){if(!0===x.isSafari&&"visual"===x.mode){const t=this.el.querySelectorAll("img[srcset]");for(let e=t.length-1;-1<e;--e)t[e].outerHTML=t[e].outerHTML}}visibilityLabel(){let s=null!==x.activeModel&&this.id===x.activeModel.id&&"visibility"===ThemifyConstructor.clicked?x.Forms.serialize("tb_options_visibility"):C;if(s=s===C?this.get("mod_settings"):s){const t=this.el.tfClass("tb_visibility_hint")[0],l={visibility_desktop:themifyBuilder.i18n.de,visibility_mobile:themifyBuilder.i18n.mo,visibility_tablet:themifyBuilder.i18n.ta,visibility_tablet_landscape:themifyBuilder.i18n.ta_l,sticky_visibility:themifyBuilder.i18n.s_v};if(t!==C){let i="";if("hide_all"===s.visibility_all)i=themifyBuilder.i18n.h_a;else{let t;for(let e in l)t=""===i?"":", ",i+="hide"===s[e]?t+l[e]:""}if(""!==i){t.tfTag("svg")[0]===C&&t.appendChild(x.Helper.getIcon("ti-eye"));let e=t.tfTag("span")[0];e===C&&(e=S.createElement("span"),t.appendChild(e)),e.textContent=i,t.classList.add("tb_has_visiblity")}else t.classList.remove("tb_has_visiblity")}}}setBreadCrumbs(e){if(!0!==x.isGSPage&&(e=e.tfClass("tb_action_breadcrumb")[0])!==C){while(null!==e.firstChild)e.lastChild.remove();this.el.isConnected&&"row"!==this.type&&(x.LightBox.el.contains(e)&&e.tfOn(k.click,e=>{const t=e.target.dataset.id;t&&(e.preventDefault(),e.stopPropagation(),x.Registry.trigger(t,"edit"))}),e.appendChild(this.getBreadCrumbs()))}}getBreadCrumbs(){let e=this.el;const l=[this.id],t=x.Builder.get().el,o=S.createDocumentFragment();if(!0!==x.isGSPage){while(1){if(!(e=e.parentNode.closest("[data-cid]"))||!t.contains(e))break;l.push(e.dataset.cid)}for(let s=l.length-1;-1<s;--s){let e=S.createElement("span"),t=x.Registry.get(l[s]),i=t.get("mod_name");e.textContent=!0===t.isSubCol?"Sub-Column":i,e.className="tb_bread tb_bread_"+i+" tf_inline_b tf_box tf_rel",this.id===l[s]&&(e.className+=" tb_active_bc"),e.dataset.id=l[s],o.appendChild(e)}}return o}async duplicate(e){x.activeModel&&this.el.contains(x.activeModel.el)&&await x.LightBox.save(),!0!==e&&x.undoManager.start("duplicate",this.id);const t=this.getData(),i=S.createElement("div");this.el.after(i),await this.setData(t,i),x.pageBreakModule.countModules(),!0!==e&&x.undoManager.end("duplicate")}async delete(e){if(x.activeModel&&this.el.contains(x.activeModel.el)&&await x.LightBox.save(),!0!==e&&x.undoManager.start("delete",this.id),"column"!==this.type){if(this.destroy(),"row"!==this.type){const t=this.el.closest(".active_subrow");t&&!t.tfClass("active_module")[0]&&t.classList.add("tb_row_empty")}}else await x.Drop.column(this.el),this.destroy();x.pageBreakModule.countModules(),!0!==e&&x.undoManager.end("delete")}async copy(){x.activeModel&&this.el.contains(x.activeModel.el)&&await x.LightBox.save();const e=this.getData();if(Object.keys(x.GS.styles).length){const t=x.GS.findUsedItems(e);!1!==t&&t.length&&(e.attached_gs=t)}x.Helper.clearElementId([e]),d.set(this.type,e),x.ActionBar.clear()}paste(n,a){return new Promise(async(e,t)=>{await x.LightBox.save();let i=this.get("mod_name"),s=d.get(this.type);if(!1===s||n&&"module"===this.type&&i!==s.mod_name)TF_Notification.showHide("error",themifyBuilder.i18n.text_alert_wrong_paste),t();else{if("column"===this.type&&s.modules&&null!==this.el.closest(".module_subrow"))for(let e=s.modules.length-1;-1<e;--e)if(s.modules[e].cols!==C)return TF_Notification.showHide("error",themifyBuilder.i18n.text_alert_sub_in_sub),t(),!1;if(!0===n){const l=ThemifyStyles.getStyleOptions(i),o="module"===this.type?"mod_settings":"styling",r=this.getData();r[o]===C&&(r[o]={});for(let e in s[o])l[e]!==C||(e=>{if(e.includes("breakpoint_")||e.includes("_apply_all"))return!0;let t=e.includes("_color")?"color":!!e.includes("_style")&&"style";if(!1!==t){if(t=e.replace("_"+t,"_width"),l[t]!==C&&"border"===l[t].type)return!0}else if(e.includes("_unit")){if(t=e.replace(/_unit$/gi,"",""),l[t]!==C)return!0}else if(e.includes("_w")){if(t=e.replace(/_w$/gi,"",""),l[t]!==C&&"font_select"===l[t].type)return!0}else if(l[e]!==C&&"radio"===l[e].type)return!0;return!1})(e)?(r[o][e]=s[o][e],l[e]!==C&&(!0===l[e].isFontColor&&s[o][l[e].g+"-gradient"]!==C?r[o][l[e].g+"-gradient"]=s[o][l[e].g+"-gradient"]:(l[e].posId!==C&&s[o][l[e].posId]!==C&&(r[o][l[e].posId]=s[o][l[e].posId]),l[e].repeatId!==C&&s[o][l[e].repeatId]!==C&&(r[o][l[e].repeatId]=s[o][l[e].repeatId])))):delete s[o][e];s.used_gs!==C&&(r.used_gs=s.used_gs),delete(s=r).element_id}else x.Helper.clearElementId([s]);!0!==a&&x.undoManager.start("paste",this.id),this.setData(s,this.el),x.pageBreakModule.countModules(),e(),!0!==a&&x.undoManager.end("paste")}})}save(t){return new Promise((s,e)=>{x.LightBox.save().then(()=>{t=t||this.el.querySelector(".tb_"+this.type+"_action").getBoundingClientRect();const e={contructor:!0,loadMethod:"html",save:{done:"save"},data:{["s"+this.type]:{options:[{id:"item_title_field",type:"text",label:ThemifyConstructor.label.title},{id:"item_layout_save",type:"checkbox",label:"",options:[{name:"layout_part",value:ThemifyConstructor.label.slayout_part}],after:"",help:'Any changes made to a Layout Part are saved and reflected everywhere else they are being used (<a href="https://themify.me/docs/builder#layout-parts" target="_blank">learn more</a>)'}]}}};x.LightBox.el.classList.add("tb_save_module_lightbox"),x.LightBox.setStandAlone(t.left,t.top).open(e).then(r=>{const e=e=>{if(e.stopPropagation(),"keydown"===e.type){if("Enter"!==e.code)return}else e.preventDefault();x.Spinner.showLoader("show");let i;switch(this.type){case"row":i=x.Utils._getRowSettings(this.el,this.type),x.Helper.clearElementId([i],!0);break;case"module":i={mod_name:this.get("mod_name"),element_id:x.Helper.generateUniqueID(),mod_settings:this.get("mod_settings")};break}i=x.Helper.clear(i);const t=x.Forms.serialize(r),s=x.GS.findUsedItems(i),o=t.item_layout_save,l={action:"tb_save_custom_item",item_title_field:t.item_title_field,item:JSON.stringify(i),type:this.type};o&&(l.item_layout_save=1),!1!==s&&(l.usedGS=s),x.LocalFetch(l).then(l=>{if("success"===l.status){const e=()=>{if(delete l.status,x.MainPanel.el.tfClass("panel_search")[0].value="",o){const i={mod_name:"layout-part",mod_settings:{selected_layout_part:l.post_name}};0<ThemifyConstructor.layoutPart.data.length&&ThemifyConstructor.layoutPart.data.push(l);let e,t;if("row"===this.type){const s=new x.Row({cols:[{grid_class:"col-full",element_id:x.Helper.generateUniqueID(),modules:[i]}]});t=s.el,e=x.Registry.get(t.tfClass("active_module")[0].dataset.cid)}else e=new x.Module(i),t=e.el;this.el.replaceWith(t),"visual"===x.mode&&e.trigger("ajax",e.get("mod_settings"))}if(x.Library){let i=[x.MainPanel.el,x.SmallPanel.el],s=x.Library.create([l]);for(let e=i.length-1;-1<e;--e){let t=i[e].tfClass("library_container")[0];if(t){let e=t.closest(".panel_tab").querySelector(".library_tab .current");t.appendChild(s.cloneNode(!0)),e&&k.triggerEvent(e,k.click)}}}x.Spinner.showLoader("done"),x.LightBox.close()};if(o){const t=ThemifyStyles.builder_id;ThemifyStyles.builder_id=l.id,x.Utils.saveCss([i],"",l.id).then(()=>{ThemifyStyles.builder_id=t,e()})}else e()}else x.LiteLightBox.alert(l.msg)}).catch(()=>{x.Spinner.showLoader("error")})},t=r.tfClass("builder_save_button")[0],i=r.tfTag("input")[0];t.tfOn(k.click,e),i.tfOn("keydown",e,{passive:!0}),k.on("themify_builder_lightbox_close",()=>{r.classList.remove("tb_save_module_lightbox"),t.tfOff(k.click,e),i.tfOff("keydown",e,{passive:!0})},!0),s()})}).catch(e)})}import(){return new Promise(async(t,i)=>{await x.LightBox.save();const e=this.el.querySelector(".tb_"+this.type+"_action").getBoundingClientRect(),s=!0===this.isSubCol?"SubColumn":this.get("mod_name"),l=s.charAt(0).toUpperCase()+s.slice(1),o="subrow"===this.type?"Sub-Row":!0===this.isSubCol?"Sub-Column":l,r={contructor:!0,loadMethod:"html",data:{component_form:{name:ThemifyConstructor.label.import_tab.replace("%s",l),options:[{id:"tb_data_field",type:"textarea",label:ThemifyConstructor.label.import_label.replace("%s",o),help:ThemifyConstructor.label.import_data.replace("%s",l),class:"fullwidth",rows:13}]}}},n=(x.LightBox.el.classList.add("tb_import_export_lightbox"),await x.LightBox.setStandAlone(e.left,e.top).open(r)),a=async e=>{e.preventDefault(),e.stopPropagation();const t=n.querySelector("#tb_data_field").value;if(""===t)i(),x.LightBox.close();else{let e=JSON.parse(t);e.component_name&&e.component_name===this.type?(x.undoManager.start("import",this.id),e.used_gs!==C&&(e=await x.GS.setImport(e.used_gs,e)),delete(e=x.Helper.clear(e)).component_name,await this.setData(e,this.el),x.pageBreakModule.countModules(),x.LightBox.close(),x.undoManager.end("import")):x.LiteLightBox.alert(themifyBuilder.i18n.text_alert_wrong_paste)}},d=n.tfClass("builder_save_button")[0];d.tfOn(k.click,a),k.on("themify_builder_lightbox_close",e=>{e.classList.remove("tb_import_export_lightbox"),d.tfOff(k.click,a),t()},!0)})}async export(){await x.LightBox.save();const e=this.el.querySelector(".tb_"+this.type+"_action").getBoundingClientRect(),t=!0===this.isSubCol?"SubColumn":this.get("mod_name"),i=t.charAt(0).toUpperCase()+t.slice(1),s="subrow"===this.type?"Sub-Row":!0===this.isSubCol?"Sub-Column":i,l={contructor:!0,loadMethod:"html",save:!1,data:{component_form:{name:ThemifyConstructor.label.export_tab.replace("%s",i),options:[{id:"tb_data_field",type:"textarea",label:ThemifyConstructor.label.import_label.replace("%s",s),help:ThemifyConstructor.label.export_data.replace("%s",i),class:"fullwidth",rows:13,readonly:!0}]}}},o=(x.LightBox.el.classList.add("tb_import_export_lightbox"),await x.LightBox.setStandAlone(e.left,e.top).open(l)),r=this.getData(),n=x.GS.findUsedItems(r),a=o.querySelector("#tb_data_field"),d=function(e){e.stopImmediatePropagation(),this.select()};if(r.component_name=this.type,!1!==n){const c={};for(let i=n.length-1;-1<i;--i){let e=x.GS.styles[n[i]],t=x.Helper.cloneObject(e.data[0]);(t="row"===e.type||"subrow"===e.type?t.styling:t.cols!==C?(t=t.cols[0])&&("column"===e.type?t.styling:t.modules!==C?t.modules[0].mod_settings:C):C)!==C&&0<Object.keys(t).length&&(c[n[i]]={title:e.title,type:e.type,data:x.Helper.clear(t,!1)})}Object.keys(c).length&&(r.used_gs=c)}a.tfOn(k.click,d,{passive:!0}).value=JSON.stringify(r),k.on("themify_builder_lightbox_close",e=>{e.classList.remove("tb_import_export_lightbox"),a.tfOff(k.click,d,{passive:!0})},!0)}edit(o){return new Promise(async(e,t)=>{if(x.isPreview||!0===this.isEmpty)t();else{const i=this.get("mod_name"),s="editBuilder"===o&&"visual"===x.mode;if("edit"!==o&&"swap"!==o||(o=""),this.tab=o||"setting",null!==x.activeModel){if(!1==s&&x.activeModel.id===this.id){const l=x.LightBox.el.querySelector('a[data-id="tb_options_'+this.tab+'"]');return l&&k.triggerEvent(l,k.click),e(x.LightBox.el),void delete this.tab}await x.LightBox.save()}!0==s?this.editLayoutPart():(this.setBreadCrumbs(x.LightBox.el),await x.LightBox.open(i,this)),e(x.LightBox.el),delete this.tab}})}restore(){const e=x.undoManager.getState("saveLightbox");if(e){const t=x.undoManager.getDiff("saveLightbox",e,x.undoManager.getCurrentState("saveLightbox"));0<Object.keys(t).length&&(t.styles&&x.undoManager.styleChanges(t.styles,"old",!t.html),t.html&&x.undoManager.domChanges(t.html,"old"),x.undoManager.clear("saveLightbox"),x.ActionBar.clear(),x.Utils.runJs(this.el,null,!0))}}options(e,t){let s,l,o;const i="INPUT"===e.tagName&&"hide_anchor"!==t?"keyup":"change",r=(e,i,t)=>{const s=e.closest(".tb_lb_option").id;if(x.activeModel===this){if(!x.LightBox.el.contains(e)){const l=x.LightBox.el.querySelector("#"+s);if(l){const o=l.closest("[data-type]").dataset.type;if("layout"===o){for(let e=l.children,t=e.length-1;-1<t;--t)e[t].classList.toggle("selected",e[t].id===i);i||l.children[0].classList.add("selected")}else"checkbox"===o?l.tfClass("tb_checkbox")[0].checked=!!i:l.value=i}}}else"row"===this.type&&"change"===t&&!e.parentNode.tfClass("tb_field_error_msg")[0]&&x.undoManager.has("rowOptions")&&(this.set(s,i),x.undoManager.end("rowOptions"))};if("custom_css_id"===t)s=e=>{const t=e.currentTarget,i=t.id,s=x.activeModel===this?x.LightBox.el.querySelector("#"+i):null,l=s?s.parentNode.tfClass("tb_field_error_msg")[0]:null,o=t.parentNode.tfClass("tb_field_error_msg")[0],r=this.el.tfClass("tb_row_id")[0],n=x.Forms.getValidator("custom_css_id")(t),a=t.value;if(s&&(s.value=a),!0===n)return o&&o.remove(),l&&l.remove(),s&&s.classList.remove("tb_field_error"),"row"!==this.type||x.activeModel===this||x.undoManager.has("rowOptions")||x.undoManager.start("rowOptions",this),this.el.id=a,r.textContent=a;this.el.removeAttribute("id"),r.textContent=this.get(i);const d=!1===n?ThemifyConstructor.label.errorId:n;if(o)o.textContent=d,l&&(l.textContent=d);else{const c=S.createElement("span");c.className="tb_field_error_msg",c.textContent=d,t.after(c),!s||l||x.LightBox.el.contains(t)||(s.classList.add("tb_field_error"),s.after(c.cloneNode(!0)))}return!1};else if("custom_css"===t){let o=e.value;s=e=>{x.Forms.getValidator("custom_css")(e.currentTarget);const t=e.currentTarget.value.trim();if("row"!==this.type||x.activeModel===this||x.undoManager.has("rowOptions")||x.undoManager.start("rowOptions",this),t&&"visual"===x.mode){const i=this.el.classList,s=t.split(" ");if(o){const l=o.split(" ");for(let e=l.length-1;-1<e;--e)l[e]=l[e].trim(),l[e]&&i.remove(l[e])}for(let e=0,t=s.length;e<t;++e)s[e]=s[e].trim(),s[e]&&i.add(s[e]);o=t}return t}}else"layout"===t?s=e=>{"row"===this.type&&x.activeModel!==this&&x.undoManager.start("rowOptions",this);const t=e.currentTarget.closest(".tb_lb_option"),i=t.tfClass("selected")[0].id,s=t.id;if("visual"===x.mode)x.liveStylingInstance.bindRowWidthHeight(s,i,this.el);else{const l=this.el.classList;"row_height"===s?l.toggle("fullheight","fullheight"===i):(l.remove("fullwidth","fullwidth_row_container"),"fullwidth"===i?l.add("fullwidth_row_container"):"fullwidth-content"===i&&l.add("fullwidth"))}return i}:"row_anchor"===t?s=e=>{"row"!==this.type||x.activeModel===this||x.undoManager.has("rowOptions")||x.undoManager.start("rowOptions",this),x.Forms.getValidator("row_anchor")(e.currentTarget);const t=e.currentTarget.value;if("visual"===x.mode){const i=this.el.classList,s=this.el.dataset.anchor;s&&i.remove("tb_section-"+s,"tb_has_section"),""!==t?(i.add("tb_section-"+t,"tb_has_section"),this.el.dataset.anchor=t):this.el.removeAttribute("data-anchor")}return this.el.tfClass("tb_row_anchor")[0].textContent=t}:"hide_anchor"===t&&(s=e=>{"row"===this.type&&x.activeModel!==this&&x.undoManager.start("rowOptions",this);const t=e.currentTarget,i=t.checked?t.value:null;return"visual"===x.mode&&this.el.toggleAttribute("data-hide-anchor","1"===i),i});e.tfOn(i,t=>{const i=s(t);if(!1!==i){let e=t.currentTarget;r(e,i,t.type),"keyup"===t.type&&(o||(o=()=>{e&&(e.tfOff("focusout",o,{passive:!0,once:!0}),l&&clearInterval(l),r(e,e.value,"change"),x.undoManager.clear("rowOptions"),l=e=o=null)},e.tfOn("focusout",o,{passive:!0,once:!0})),l=setInterval(()=>{e&&!e.isConnected&&(clearInterval(l),l=null,o)&&o()},1e3))}},{passive:!0}),"visual"!==x.mode&&"keyup"==i&&e.tfOn("keydown focusin focusout copy paste",e=>{e.stopPropagation()},{passive:!0})}},x.Row=class extends x.Base{constructor(e){super(e),this.convertToGrid(e),this instanceof x.Subrow||(this.type="row",this.initialize(),this.render())}initialize(){super.initialize(),x.Registry.on(this.id,"gridMenu",this.gridMenu),this instanceof x.Subrow||x.Registry.on(this.id,"optionsTab",this.optionsTab)}defaults(){return{cols:[],styling:{}}}attributes(){const e=this.get("styling"),t={class:"module_row themify_builder_row tf_clearfix tb_"+this.id};return null!==e&&(e.custom_css_row!==C&&""!==e.custom_css_row&&(t.class+=" "+e.custom_css_row),"fullwidth-content"===e.row_width&&(t.class+=" fullwidth"),e.custom_css_id!==C)&&""!==e.custom_css_id&&(t.id=e.custom_css_id),t}render(){let i=!1,s=this.get("cols");"subrow"===this.type&&this.el.tfClass("module_subrow")[0].classList.add("tb_"+this.id);const e=this.el.tfClass(this.type+"_inner")[0],l=S.createDocumentFragment(),o=s.length;if(0<o){1<o&&"rtl"===this.get("desktop_dir")&&(s=s.reverse());for(let e=0;e<o;++e)if(s[e]!==C&&null!==s[e]){let t=new x.Column(s[e],"subrow"===this.type);if(l.appendChild(t.el),!1===i){let e=t.get("modules");i=e!==C&&0<e.length}1<o&&(0===e||e===o-1)&&t.el.classList.add(0===e?"first":"last")}const t=["tb_col_count_"+o];if(1<o){const r=this.get("sizes");if("visual"!==x.mode){const n=x.breakpointsReverse,a=this.get("styling"),d={grid:Object.assign({count:o,model:this},r)};d.grid.desktop_size||(d.grid.desktop_size=o);for(let t=n.length-1;-1<t;--t){let e=ThemifyStyles.fields.grid.call(ThemifyStyles,"grid",this.type,{},d,this.id,a,n[t],!0);this.setGridCss(e,n[t])}}let e=r.desktop_align;e="start"===(e=e===C?!0==p?"center":"start":e)?"top":"center"===e?"middle":"bottom",t.push("col_align_"+e),"rtl"===r.desktop_dir&&t.push("direction_rtl"),"narrow"!==r.desktop_gutter&&"none"!==r.desktop_gutter||t.push("gutter-"+r.desktop_gutter),1===r.desktop_auto_h&&t.push("col_auto_height")}e.className+=" "+t.join(" ")}else{let e=new x.Column({},"subrow"===this.type);l.appendChild(e.el)}if("row"===this.type){const c=this.get("row_anchor"),u=this.get("custom_css_id");c!==C&&""!==c&&(this.el.tfClass("tb_row_anchor")[0].textContent=c),u!==C&&""!==u&&(this.el.tfClass("tb_row_id")[0].textContent=u)}return!1===i&&this.el.classList.add("tb_row_empty"),this.visibilityLabel(),e.appendChild(l),this}convertToGrid(i){const n=x.breakpointsReverse,a=n.length,s=i.cols,d=s!==C?s.length:0;let c=i.sizes;if(c===C){c={};let e=i.column_alignment,t=i.column_h;if(1<d){const l=i.gutter,u=(l&&"gutter"!==l&&"gutter-default"!==l&&(c.desktop_gutter=l.replace("gutter-","")),c.desktop_gutter||"def"),h=[],g=[];let o=!1;for(let t=0;t<d;++t){let e=s[t].grid_width;e&&(o=!0,g.push(e),delete s[t].grid_width),s[t].grid_class&&(h.push(s[t].grid_class),e||g.push(s[t].grid_class))}let r,e=o;if(!1===e&&"def"!==u&&0<h.length&&(r=ThemifyStyles.gridBackwardCompatibility(h),e=r.includes("_")),!0===e){const _=ThemifyStyles.getOldColsSizes(u);for(let t=g.length-1;-1<t;--t)if("string"==typeof g[t]&&g[t].includes("col")){let e=g[t].split(" ")[0].replace(/tb_3col|tablet_landscape|tablet|mobile|column|first|last/gi,"").trim();_[e]!==C?g[t]=_[e]:g.splice(t,1)}const m=Math.min.apply(null,g);for(let e=g.length-1;-1<e;--e)g[e]=m===g[e]?"1fr":parseFloat((g[e]/m).toFixed(5)).toString()+"fr";r=g.join(" ")}else!r&&0<h.length&&(r=ThemifyStyles.gridBackwardCompatibility(h));r&&"1"!==(r=ThemifyStyles.getColSize(r,!1))&&"2"!==r&&"3"!==r&&"4"!==r&&"5"!==r&&"6"!==r&&("rtl"!==i.desktop_dir||!0!==e&&!r.toString().includes("_")||(r=(r=!0===e?r.split(" "):r.split("_")).reverse(),r=!0===e?r.join(" "):r.join("_")),c.desktop_size=r);for(let l=a-1;-1<l;--l){let s=n[l],e=i[s+"_dir"]||"ltr",t=i["col_"+s];if(c[s+"_dir"]="1"===e||1===e?"rtl":e,"desktop"!==s){let i=t&&"auto"!==t&&"-auto"!==t?ThemifyStyles.gridBackwardCompatibility(t):"auto";if("auto"===i)if(!0===o)i=r;else{let e=s[0],t;if(s.includes("_")&&(e+=s.split("_")[1][0]),!(t=(t=ThemifyStyles.getAreaValue("--area"+e+d+"_"+i))||ThemifyStyles.getAreaValue("--area"+d+"_"+i))){for(let e=l+1;e<a;++e)if((t=c[n[e]+"_size"])&&"auto"!==t){t=t.includes("fr")?t:ThemifyStyles.gridBackwardCompatibility(t);break}i=t||d.toString()}}else if(!i.toString().includes("_")&&0<i&&i<6&&d<i){i="";for(let e=l+1;e<a;++e)if(c[n[e]+"_size"]!==C){i=c[n[e]+"_size"];break}}c[s+"_size"]=""===i?"":ThemifyStyles.getColSize(i,!1)}delete i[s+"_dir"],delete i["col_"+s]}}e&&""!==(e="col_align_top"===e?"":"col_align_middle"===e?"center":"end")&&(c.desktop_align=e),c.desktop_auto_h=t?1:-1,delete i.column_alignment,delete i.gutter,delete i.column_h}else if(1<d)for(let t=0;t<a-1;++t)if(c[n[t]+"_size"]===C)for(let e=t+1;e<a-1;++e)if(c[n[e]+"_size"]!==C){c[n[t]+"_size"]=c[n[e]+"_size"];break}this.fields.sizes=c}getSizes(e,t){t=t||x.activeBreakPoint;const i=this.get("sizes"),s=x.breakpointsReverse,l=s.length;let o,r,n,a,d;if(i!==C)for(let e=s.indexOf(t);e<l;++e)if(o===C&&(o=i[s[e]+"_gutter"]),r===C&&(r=i[s[e]+"_align"]),d===C&&(d=i[s[e]+"_size"]),n===C&&(n=i[s[e]+"_auto_h"]),a===C&&(a=i[s[e]+"_area"]),o&&r&&d&&n&&a)break;d=d&&ThemifyStyles.getColSize(d,!1),a=a&&ThemifyStyles.getArea(a,!1,t,this.el.tfClass(this.type+"_inner")[0].childElementCount),r===C&&(r=!0==p?"center":"start");let c={gutter:o,align:r,size:d,auto_h:n,area:a};return c=e?c[e]:c}setSizes(t,i){i=i||x.activeBreakPoint;const s=this.get("sizes");for(let e in t)""!==t[e]&&t[e]!==C&&null!==t[e]?("size"===e?t[e]&&t[e].includes(" ")&&(t[e]=ThemifyStyles.getColSize(t[e],!1)):"gutter"===e&&(t[e]=ThemifyStyles.getGutter(t[e])),s[i+"_"+e]=t[e].toString().replace(/ +/g," ").trim()):""===t[e]&&delete s[i+"_"+e];this.set("sizes",s)}getGridCss(t,i){const s={grid:{}};for(let e in t)"size"===e?t[e]&&t[e].includes(" ")&&(t[e]=ThemifyStyles.getColSize(t[e],!1)):"gutter"===e&&(t[e]=ThemifyStyles.getGutter(t[e])),i!==e.split("_")[0]?s.grid[i+"_"+e]=t[e]:s.grid[e]=t[e];return ThemifyStyles.fields.grid.call(ThemifyStyles,"grid",this.type,{},s,this.id,null,i,!0)}setCols(t,e,i){e=e||x.activeBreakPoint,t.gutter!==C&&(t.gutter=ThemifyStyles.getGutter(t.gutter));const s=this.getGridCss(t,e);if(s["--align_items"]===C&&"-1"===t.auto_h&&(s["--align_items"]=""),s["--colg"]===C&&"gutter"===t.gutter&&(s["--colg"]=""),"desktop"===e){const l=this.getSizes("gutter"),o=this.el.tfClass(this.type+"_inner")[0].classList;"none"!==t.gutter&&"narrow"!==t.gutter||o.add("gutter-"+t.gutter),l&&o.remove("gutter-"+l)}if(this.setGridCss(s,e),!1!==i){const r=["align","area","size","gutter","auto_h"],n={};for(let e=r.length-1;-1<e;--e)t[r[e]]!==C&&(n[r[e]]=t[r[e]]);"desktop"===e&&(n.area=""),n.auto_h!==C&&"-1"!==n.auto_h&&(n.align=""),this.setSizes(n,e)}}optionsTab(e){let t=null,i=null;const s=x.activeModel||null,l=ThemifyConstructor.component;if(null!==s&&(i=s.type,t=x.Helper.cloneObject(s.get("styling"))),0<e.childElementCount)while(null!==e.firstChild)e.removeChild(e.lastChild);ThemifyConstructor.values=s&&s.id===this.id&&"setting"===ThemifyConstructor.clicked?x.Forms.serialize("tb_options_setting",!0):x.Helper.cloneObject(this.get("styling"))||{},ThemifyConstructor.type=ThemifyConstructor.component=this.type,x.activeModel=this;const o=x.FormTemplates.getItem("row").setting.options.slice(0,6);o[5]=x.Helper.cloneObject(o[5]),o[5].accordion=!1,e.appendChild(ThemifyConstructor.create(o)),ThemifyConstructor.values=t,ThemifyConstructor.component=l,ThemifyConstructor.type=i,x.activeModel=s}grid(e){let t=e.dataset.grid||"";const i=t?t.includes("_")?t.split("_").length:parseInt(t):"",s=this.el.tfClass(this.type+"_inner")[0],l=x.activeBreakPoint,o=s.children,r=o.length,n=s.classList,a=e.closest("#grid"),d=a.querySelector("#range"),c=a.querySelector("#slider"),u=a.classList,h="desktop"===l?"grid":"style",g="desktop"===l?x.breakpointsReverse:[l];if("user"!==t){if(x.undoManager.start(h,this),"desktop"===l){n.remove("tb_col_count_"+r),n.add("tb_col_count_"+i),u.remove("tb_col_count_"+r),u.add("tb_col_count_"+i);const _=S.createDocumentFragment();if(i<o.length){for(let e=o.length-1;e>=i;--e){let t=o[e].tfClass("tb_holder")[0].children;for(let e=t.length-1;-1<e;--e)t[0]&&_.appendChild(t[0]);o[e].remove()}o[o.length-1].tfClass("tb_holder")[0].appendChild(_)}else{for(let t=0;t<i;++t)if(!o[t]){let e=new x.Column(o[t],"subrow"===this.type);_.appendChild(e.el)}s.appendChild(_)}const m=x.getColClass(),p=x.getColClassValues(),f=o.length,y=m[t]!==C?m[t]:m[f],b=p.length-1;for(let e=f-1;-1<e;--e){let t=o[e].classList;for(let e=b;-1<e;--e)t.remove(p[e]);y!==C&&f<7&&t.add(y[e]),t.remove("first","last")}1<f&&(o[0].classList.add("first"),o[f-1].classList.add("last"))}if(this.setCols({size:t,area:""}),"desktop"===l){const v=[];for(let i=g.length-2;-1<i;--i){let e=g[i],t=this.getGridCss({size:"auto"},e);"auto"!==this.getSizes("size",e)&&v.push(x.Helper.getBreakpointName(e)),t["--area"]&&!t["--area"].includes(" ")?this.setCols({size:"auto"},e):(this.setGridCss({"--area":"","--col":""},e),this.setSizes({size:"auto"},e)),this.setMaxGutter(e)}}else{const w=getComputedStyle(s).getPropertyValue("--area").split('" "')[0].split(" ").length;u.toggle("tb_1col_grid",1===w)}let e=this.setMaxGutter();d.max=c.max=this.getMaxGutter(),d.value=c.value=parseFloat(e),x.Utils.setCompactMode(o),k.trigger("tb_grid_changed",[this.el.closest(".module_row"),s]),x.Utils._onResize(!0),x.undoManager.end(h)}}gutter(e){x.undoManager.start("style",this);const t=e.dataset.value,i=ThemifyStyles.getGutterValue(t),s=e.closest("#grid"),l=s.querySelector("#range"),o=s.querySelector("#slider"),r=parseFloat(parseFloat(i).toFixed(2).toString()).toString(),n=i.replace(r,"")||"%";l.max=o.max=this.getMaxGutter(n),l.value=o.value=r,s.querySelector("#range_unit").value=n,this.setCols({gutter:t}),x.Utils._onResize(!0),x.undoManager.end("style")}autoHeight(e){x.undoManager.start("style",this);const t=e.dataset.value;if("desktop"===x.activeBreakPoint){const i=this.el.tfClass(this.type+"_inner")[0];i.classList.toggle("col_auto_height","1"==t)}this.setCols({auto_h:t}),x.undoManager.end("style")}alignment(e){x.undoManager.start("style",this);const s=e.dataset.value;if("desktop"===x.activeBreakPoint){let e=this.el.tfClass(this.type+"_inner")[0],t=this.get("sizes").desktop_align,i=s;t&&(t="start"===(t=t.replace("col_align_",""))?"top":"center"===t?"middle":"bottom",e.classList.remove("col_align_"+t)),i="start"===i?"top":"center"===i?"middle":"bottom",e.classList.add("col_align_"+i)}this.setCols({align:s}),x.undoManager.end()}direction(){const n="desktop"===x.activeBreakPoint?"direction":"style",a=this.el.tfClass(this.type+"_inner")[0];if(x.undoManager.start(n,this),"desktop"===x.activeBreakPoint){if(!a.hasAttribute("data-transition")){a.dataset.transition=1;let i=a.children,l=this,o=i.length,e=this.getSizes("size"),r={};for(let e=o-1;-1<e;--e)r[i[e].dataset.cid]=e+1;i[o-1].tfOn("transitionend",function(){const t=S.createDocumentFragment();for(let e=o-1;-1<e;--e)t.appendChild(i[e]);a.appendChild(t),this.tfOn("transitionend",()=>{for(let e=o-1;-1<e;--e)i[e].style.setProperty("transition",""),i[e].style.setProperty("transition-delay",""),i[e].style.setProperty("transform","");a.classList.remove("direction_rtl"),a.removeAttribute("data-transition");const s={};for(let e=o-1;-1<e;--e)s[i[e].dataset.cid]=e+1;for(let e=x.breakpointsReverse,i=e.length-2;-1<i;--i){let t=l.getSizes("area",e[i]);if(t){t.includes('"')||(t=computed.getPropertyValue("--area"+t).replace(/\s\s+/g," ").trim());for(let e in s)r[e]!==s[e]&&(t=t.replaceAll(r[e]+" ","#"+s[e]+"# ").replaceAll(r[e]+'"',"#"+s[e]+'#"'));l.setCols({area:t.replaceAll("#","")},e[i])}}x.undoManager.end(n),l=o=e=i=null},{once:!0,passive:!0}),e&&l.setCols({size:e.split(" ").reverse().join(" ")}),setTimeout(()=>{for(let e=o-1;-1<e;--e)i[e].style.setProperty("transition-delay",(o-e)/10+"s"),i[e].style.setProperty("transform","scale(1)")},60)},{once:!0,passive:!0});for(let e=o-1;-1<e;--e)i[e].style.setProperty("transition","transform .3s "+(e+1)/10+"s"),i[e].style.setProperty("transform","scale(0)")}}else{let i=getComputedStyle(a).getPropertyValue("--area").replace(/ +/g," ").trim(),s=[],l=i.split('" "')[0].split(" ").length;const o=(i=(i=i.replaceAll('"',"").trim().split(" ")).reverse()).length;for(let e=o-1;-1<e;--e)"."===i[e]&&i.push(i.splice(e,1)[0]);for(let e=0,t=o/l;e<t;++e)s.push('"'+i.slice(e*l,(e+1)*l).join(" ")+'"');this.setCols({area:s.join(" ")}),x.undoManager.end(n)}}breakpoint(e){x.ToolBar.breakpointSwitcher(e.dataset.id).then(()=>{"visual"===x.mode&&(x.ActionBar.clear(),setTimeout(()=>{const e=this.el.getBoundingClientRect().top+u.scrollY-100;c.scroll(0,e),u.scroll(0,e),x.ActionBar.hover({target:this.el.tfClass("tb_"+this.type+"_action")[0]})},50))}).catch(()=>{})}gridMenu(l){const i=S.tfId("tmpl-builder_grid_list").content.cloneNode(!0),e=x.activeBreakPoint,t=this.el.tfClass(this.type+"_inner")[0],s=t.classList,o=l.classList,r=t.childElementCount,n="tb_col_count_"+r,a="desktop"!==e?getComputedStyle(t).getPropertyValue("--area").split('" "')[0].split(" ").length:null,h=i.querySelector("#range"),g=i.querySelector("#range_unit"),d=i.querySelector("#slider");this.setMaxGutter(e);let c=i.querySelector(".grid_list").children,{gutter:u,align:_,size:m,auto_h:p}=this.getSizes();m?"string"==typeof m&&m.includes(" ")&&(m="user"):m=6<r?"user":r;for(let e=s.length-1;-1<e;--e)if(0===s[e].indexOf("tb_col_count_")){n!==s[e]&&s.remove(s[e]);break}s.add(n),o.add(n,x.activeBreakPoint),o.toggle("tb_1col_grid",1===a),"desktop"!==x.activeBreakPoint&&o.add("tb_responsive_mode"),this.el.classList.contains("fullheight")&&o.add("fullheight");for(let e=c.length-1;-1<e;--e)c[e].classList.toggle("selected",c[e].dataset.grid==m);if(_)for(let e=(c=i.querySelector(".alignment").children).length-1;-1<e;--e)c[e].classList.toggle("selected",c[e].dataset.value===_);if(p)for(let e=(c=i.querySelector(".auto_height").children).length-1;-1<e;--e)c[e].classList.toggle("selected",c[e].dataset.value==p);if(u){u=ThemifyStyles.getGutter(u);for(let t=(c=i.querySelector(".gutter").children).length-1;-1<t;--t){let e=c[t].dataset.value;c[t].classList.toggle("selected",e===u)}}else u="gutter";u=ThemifyStyles.getGutterValue(u);const f=parseFloat(u),y=u.toString().replace(f.toString(),"")||"%";h.max=d.max=this.getMaxGutter(y),h.value=d.value=parseFloat(f.toFixed(4)).toString(),g.value=y,l.tfOn(k.click,e=>{e.stopPropagation();const t=e.target.closest("li"),i=t?null:e.target.closest(".expand");if(t){const s=t.closest("[data-col]");if(s){const l=s.children;if(1<l.length)for(let e=l.length-1;-1<e;--e)l[e].classList.toggle("selected",t===l[e]);const o=s.dataset.col;this[o](t)}}else i&&this.trigger(i.dataset.action)},{passive:!0}).appendChild(i),setTimeout(()=>{if(l){const i=l.querySelector("#range_holder"),s=ThemifyConstructor.range.render({id:"range",control:!1,event:"input",value:h.value,unit:g.value,units:{"%":{min:0,increment:.1,max:this.getMaxGutter("%")},em:{min:0,max:this.getMaxGutter("em")},px:{min:0,max:this.getMaxGutter("px")}}},ThemifyConstructor);i.innerHTML="",i.appendChild(s);let r,n=!1,a,t,d=i.parentNode.querySelector("#slider"),c=i.querySelector("#range"),u=i.querySelector("#"+c.id+"_unit"),e=e=>{e.stopImmediatePropagation();const l="change"===e.type,o=e.currentTarget;!1==l&&o===u||(!1===n&&(a=this.el.tfClass(this.type+"_inner")[0],n=!0,x.undoManager.start("style",this),t=setInterval(()=>{c.isConnected||(clearInterval(t),t=null,k.triggerEvent(c,"change"),setTimeout(()=>{c=null},100))},1e3)),l&&t&&(clearInterval(t),t=null),r=requestAnimationFrame(()=>{const t=u.value;if(o===d)c.value=d.value;else if(o===u){let e=this.getMaxGutter(t);c.max=d.max=e,"px"===t?(d.step=1,c.value=d.value=parseInt(d.value)):d.step=.1,parseFloat(c.value)>e&&(c.value=d.value=e)}else d.value=c.value;let i=c.value;if(0<i&&(i+=t),!0==l){r&&cancelAnimationFrame(r);const s=c.closest("#grid").tfClass("gutter")[0].children;i=ThemifyStyles.getGutter(i);for(let e=s.length-1;-1<e;--e)s[e].classList.toggle("selected",i===s[e].dataset.value);this.setCols({gutter:i},"",l),a.style.setProperty("--colg",""),this.setMaxGutter(),!0===n&&(a=null,x.Utils._onResize(!0),x.undoManager.end("style"),n=!1),r=null}else a.style.setProperty("--colg",i)}))};d.tfOn("input change",e,{passive:!0}),c.tfOn("input change",e,{passive:!0}),u.tfOn("change",e,{passive:!0})}},150)}setMaxGutter(e){e=e||x.activeBreakPoint;let t=this.getSizes("gutter",e)||"gutter",i=(t=ThemifyStyles.getGutterValue(t),parseFloat(t)),s=t.toString().replace(i.toString(),"")||"%",l=this.getMaxGutter(s,e);return l<i&&(this.setCols({gutter:l+s},e),i=l),i+s}getMaxGutter(i,t){t=t||x.activeBreakPoint;const e=this.el.tfClass(this.type+"_inner")[0],s=e.childElementCount;if(s<=1)return 100;const l=this.getSizes("",t),o=e.offsetWidth,r=getComputedStyle(e),n=parseFloat(r.getPropertyValue("font-size")),a=r.getPropertyValue("--col"),d=a&&"none"!==a&&!a.includes("repeat")?a.replace(/\s\s+/g," ").trim().split(" "):null;if(!i){let e=l.gutter||"gutter",t=(e=ThemifyStyles.getGutterValue(e),parseFloat(e));i=e.toString().replace(t.toString(),"")||"%"}let c,u=l.area;if(!u){let e=l.size;e&&((e=e.toString()).includes(" ")?c=e.replace(/\s\s+/g," ").split(" ").length:u=this.getGridCss({size:"auto"},t)["--area"])}c||(u&&u.includes("var")&&(u=r.getPropertyValue(u.replace("var(","").replace(")",""))),c=u?u.replace(/ +/g," ").trim().split('" "')[0].split(" ").length:s);let h=o,g=0,_=0,m=0;if(null!==d){for(let t=d.length-1;-1<t;--t){let e=parseFloat(d[t]);d[t].includes("fr")||(d[t].includes("%")?_+=e:d[t].includes("em")?m+=e:g+=e)}h-=g-parseFloat(_*o/100)-m*n}return h=parseFloat(100*h/o)-5*c,h=parseFloat(h/(c-1)),"px"!==i&&"em"!==i||(h=o*h/100,h="em"===i?parseFloat(h/n):parseInt(h)),parseFloat(parseFloat(h.toFixed(2)).toString())}setGridCss(t,i){i=i||x.activeBreakPoint;const l=ThemifyStyles.getStyleOptions(this.type).grid.selector;if("visual"===x.mode){const s=x.createStyleInstance();if(s.init(!0,!1,this),s.setMode(i),0<Object.keys(t).length)for(let e in t)s.setLiveStyle(e,t[e],l)}else{let s;const o=ThemifyStyles.getSheet(i),r=o.cssRules,n=this.id,a=x.breakpointsReverse,d=a.indexOf(i),c=[];for(let e=d;-1<e;--e)if(c.push(ThemifyStyles.getBaseSelector(this.type,n,a[e])+" "+l),"desktop"===i)break;if(s=c.join(","),0<Object.keys(t).length)for(let e in t)((e,t)=>{const i=x.Utils.findCssRule(r,s);!1!==i&&r[i]?r[i].style.setProperty(e,t):""!==t&&t!==C&&o.insertRule(s+"{"+e+":"+t+";}",r.length)})(e,t[e])}}},x.Subrow=class extends x.Row{constructor(e){super(e),this.type="subrow",super.initialize(),super.render()}attributes(){return{class:"active_module active_subrow"}}},x.Column=class extends x.Base{constructor(e,t){super(e),this.type="column",!0===t&&(this.isSubCol=!0),this.initialize(),this.render()}defaults(){return{modules:[],styling:{}}}attributes(){const e=this.get("grid_class"),t={class:"module_column tb_"+this.id};return t.class+=!0===this.isSubCol?" sub_column":" tb-column",e&&(t.class+=" "+e),!0===this.oldPadding&&(t.class+=" tb_old_padding"),t}render(){const i=this.get("modules");if(i){const e=this.el.tfClass("tb_holder")[0],s=S.createDocumentFragment();for(let t=0,e=i.length;t<e;++t)if(i[t]!==C&&null!==i[t]){let e=new(i[t].cols===C?x.Module:x.Subrow)(i[t]);s.appendChild(e.el)}else i.splice(t,1);!0===this.isSubCol&&e.classList.add("tb_subrow_holder"),e.appendChild(s)}return this}},x.Module=class extends x.Base{constructor(e){e.mod_settings!==C&&(e.mod_settings=ThemifyStyles.convertPreset(e.mod_name,e.mod_settings)),super(e),this.type="module",this.initialize(),this.render()}defaults(){return{mod_name:"",mod_settings:{}}}initialize(){super.initialize()}editLayoutPart(){x.ActionBar.disable=!0,x.Spinner.showLoader(),Promise.all([k.loadCss(k.builder_url+"css/editor/modules/layout-part",null,null,S.tfId("themify-builder-admin-ui-css").nextElementSibling),k.loadJs(k.builder_url+"js/editor/modules/layout-part")]).then(()=>{k.trigger("tb_layout_edit");let t=this.get("mod_name").split("-");for(let e=0;e<t.length;++e)t[e]=t[e].charAt(0).toUpperCase()+t[e].slice(1);t=t.join("");const e=new x[t](this.id);e.edit().finally(()=>{x.ActionBar.disable=null}),x.LayoutPart.item=e}).catch(()=>{x.Spinner.showLoader("error"),x.ActionBar.disable=null})}toRenderData(){const e=this.get("mod_settings");return{name:this.getName(),slug:this.get("mod_name"),element_id:this.id,icon:this.getImage(e),excerpt:this.getExcerpt(e)}}getExcerpt(e){const t=e||this.get("mod_settings"),i=t.content_text||t.content_box||t.plain_text||"";return this.limitString(i,100)}getImage(e){const t=e||this.get("mod_settings"),i=t.url_image||t.url_image_a;return i?'<img src="'+i+'" loading="lazy" decode="async" width="16" height="16" alt="'+this.getName()+'"/>':x.Helper.getIcon("ti-"+this.getIcon()).outerHTML}limitString(e,t){let i="";if(""!==e){const s=S.createElement("div");s.innerHTML=e,e=s.textContent,i=e.length>t?e.substr(0,t):e}return i}backendLivePreview(e){this.el.tfClass("module_excerpt")[0].textContent=this.getExcerpt(e),this.el.tfClass("tb_img_wrap")[0].innerHTML=this.getImage(e)}getIcon(){const e=this.get("mod_name");return themifyBuilder.modules[e]!==C?themifyBuilder.modules[e].icon:""}getName(){const e=this.get("mod_name");return themifyBuilder.modules[e]!==C?themifyBuilder.modules[e].name:e}getPreviewType(){return null!==S.tfId("tmpl-builder-"+this.get("mod_name"))?"live":"ajax"}getPreviewSettings(){return x.Module.getDefault(this.get("mod_name"))}attributes(){const e={class:"active_module"},t=this.get("mod_settings");return"visual"===x.mode&&("hide_all"!==t.visibility_all&&"hide"!==t.visibility_desktop&&"hide"!==t.visibility_tablet&&"hide"!==t.visibility_tablet_landscape&&"hide"!==t.visibility_mobile||(e.class+=" tb_visibility_hidden"),e.class+=" tb_module_front"),t.custom_css_id!==C&&""!==t.custom_css_id&&(e.id=t.custom_css_id),e}getDisabledTpl(){this.isEmpty=!0,x.Builder.get().emptyModules.add(this.get("mod_name"));const e=x.template("builder_module_disabled");this.el.innerHTML=e(this.toRenderData())}render(){return"visual"!==x.mode&&(themifyBuilder.modules[this.get("mod_name")]!==C?(this.el.innerHTML=x.Module.template(this.toRenderData()),this.visibilityLabel()):this.getDisabledTpl()),this}},x.Module.template="visual"===x.mode?null:x.template("builder_module_item"),x.Module.getDefault=e=>x.Helper.cloneObject(themifyBuilder.modules[e].defaults),x.Builder=class{constructor(e,i,t){this.emptyModules=new Set;const s=e.classList,l=(s.remove("not_editable_builder"),s.add("tb_active_builder","tf_rel"),this.id=e.dataset.postid,e.id="themify_builder_content-"+this.id,this.el=e,this.isSaved=!1,this.customCss=t||"",++x.Builder.index,x.Builder.items.push(this),S.createDocumentFragment());for(let t=0,e=i.length;t<e;++t){let e=new x.Row(i[t]);l.appendChild(e.el)}if("visual"===x.mode){let e="tb_custom_css_"+this.id,t=S.tfId(e);null===t&&((t=S.createElement("style")).id=e,S.head.appendChild(t)),t.innerHTML=this.customCss}this.el.appendChild(l),x.Registry.on(this,"tb_init",this.init)}init(){"visual"===x.mode&&setTimeout(()=>{x.Utils._onResize(!0)},3e3),setTimeout(()=>{x.Utils.setCompactMode(this.el.tfClass("module_column")),"visual"!==x.mode&&x.GS.init(),this.lastRowBlock(),this.newRowAvailable(),this.insertLayoutButton(),x.pageBreakModule.countModules(),0<this.emptyModules.size&&TF_Notification.showHide("warning",themifyBuilder.i18n.empty_modules.replace("%s",Array.from(this.emptyModules).join(", ")),1e4),this.emptyModules.clear(),this.emptyModules=null},1e3)}destroy(){null!==this.emptyModules&&(this.emptyModules.clear(),this.emptyModules=null);const i=this.el.querySelectorAll("[data-cid]"),e=this.el.classList,t=x.Builder.items,s=S.tfId("tb_custom_css_"+this.id);x.Registry.off(this);for(let t=i.length-1;-1<t;--t){let e=x.Registry.get(i[t].dataset.cid);e.destroy(!0)}for(let e=t.length-1;-1<e;--e)if(t[e]===this){t[e]=null,t.splice(e,1),--x.Builder.index;break}while(null!==this.el.firstChild)this.el.lastChild.remove();this.el.removeAttribute("id"),e.remove("tb_active_builder","tf_rel"),e.add("not_editable_builder"),null!==s&&s.remove()}toJSON(i){const s=[],l=this.el.children,o=i=>{for(let e=i.length-1;-1<e;--e){if(i[e].styling&&0<Object.keys(i[e].styling).length)return!0;let t=i[e].modules;if(t&&0<t.length)for(let e=t.length-1;-1<e;--e){if(!t[e].cols)return!0;if(o(t[e].cols))return!0}}return!1};for(let t=0,e=l.length;t<e;++t)if(l[t].classList.contains("module_row")){let e=x.Utils._getRowSettings(l[t],"row",i);(e.styling&&0<Object.keys(e.styling).length||e.cols&&o(e.cols))&&s.push(e)}return s}removeLayoutButton(){const t=this.el.tfClass("tb_import_layout_button");for(let e=t.length-1;-1<e;--e)t[e].remove()}insertLayoutButton(){if(!0!==x.isGSPage){this.removeLayoutButton();const e=this.el.tfClass("module_row");if(e[0]!==C&&e.length<2&&e[0].classList.contains("tb_row_empty")){const t=S.createElement("a");t.className="tb_import_layout_button",t.textContent=themifyBuilder.i18n.text_import_layout_button,t.tfOn(k.click,e=>{e.stopPropagation(),k.triggerEvent(x.ToolBar.el.tfClass("load_layout")[0],e.type)},{passive:!0}).href="javascript:;",this.lastRow.getRootNode().host.before(t)}}}newRowAvailable(e){if(!0!==x.isGSPage){const i=this.el.children,s=!0===e?0:i.length;let t;if(0!==s)for(let e=s-1;-1<e;--e)if(i[e].tfClass("active_module")[0]===C&&i[e].classList.contains("module_row")){t=x.Registry.get(i[e].dataset.cid);break}return t||((t=new x.Row(x.Utils.grid(1)[0])).el.className+=" tb_new_row",this.lastRow.getRootNode().host.before(t.el),x.Utils.setCompactMode(t.el.tfClass("module_column"))),t}}lastRowBlock(){if(!(!0===x.isGSPage||this.lastRow&&this.el.contains(this.lastRow.getRootNode().host))){const t=S.createElement("div"),e=S.tfId("tmpl-last_row_add_btn");t.id="tb_last_row_add_btn",t.className="tf_w tf_hidden",t.attachShadow({mode:"open"}).appendChild(e.content.cloneNode(!0)),this.el.appendChild(t),this.lastRow=t.shadowRoot.tfId("container"),k.on("tb_toolbar_loaded",()=>{setTimeout(()=>{const e=S.createDocumentFragment();e.append(x.ToolBar.getBaseCss(),x.MainPanel.el.getRootNode().querySelector("#module_drag_grids_style").cloneNode(!0)),t.shadowRoot.prepend(e),t.classList.remove("tf_hidden"),this.lastRow.tfOn(k.click,function(e){e.stopPropagation();const t=e.target,i=t.closest(".tb_grid");if(null!==i)this.classList.add("hide"),x.MainPanel.newGrid(i.dataset.slug,!1);else if(t.closest(".block")){const s=this.getRootNode().host;s.classList.remove("clicked"),this.classList.add("hide"),x.SmallPanel.show(s)}else t.classList.contains("add_btn")&&(this.classList.remove("hide"),this.tfClass("grids")[0]||this.appendChild(S.tfId("tmpl-last_row_expand").content))},{passive:!0})},1500)},!0,x.ToolBar!==C&&!0===x.ToolBar.isLoaded)}}reLoad(a,d){return new Promise(async e=>{await x.LightBox.save();const t=this.el;let i=a.builder_data!==C?a.builder_data:a,s=a.custom_css||"",l="visual"!==x.mode||null===t.parentNode.closest(".themify_builder");if(i=x.Helper.correctBuilderData(i),!0===d?(i=this.toJSON().concat(i),s=this.customCss+s):!0==l&&x.GS.reset(),a.used_gs!==C){for(let e in a.used_gs){let s=a.used_gs[e];if(s.data!==C){if(s.data[0]===C){let e=s.type,t=x.Helper.cloneObject(s.data),i=x.Helper.generateUniqueID();s.data=[{element_id:"row"+i}],"row"!==e&&"subrow"!==e?(s.data[0].cols=[{element_id:"col"+i}],"column"===e||"subcolumn"===e?s.data[0].cols[0].styling=t:s.data[0].cols[0].modules=[{mod_name:e,mod_settings:t}]):s.data[0].styling=t}}else delete a.used_gs[e]}x.GS.styles=ThemifyStyles.extend(!0,{},a.used_gs,x.GS.styles)}if(!0==l&&"visual"===x.mode){x.liveStylingInstance.reset(),S.body.classList.add("sidebar-none","full_width");for(let e=S.querySelectorAll("#sidebar,.page-title"),t=e.length-1;-1<t;--t)e[t].remove()}this.destroy();const o=new x.Builder(t,x.Helper.clear(i),s);x.undoManager.reset();let r;if(!1==l){r=[];const n=o.el.querySelectorAll("[data-cid]");for(let e=n.length-1;-1<e;--e)r.push(n[e].dataset.cid)}"visual"===x.mode&&(await x.bootstrap(r,a.used_gs),x.setCss(o.toJSON())),await x.correctColumnPaddings(),x.Registry.trigger(o,"tb_init"),x.Utils.runJs(o.el,null,!0),x.Spinner.showLoader("done"),e()})}async save(){const i=x.ToolBar.el.tfClass("save_wrap")[0].classList;try{if(i.contains("disabled"))throw"isWorking";i.add("disabled"),await x.LightBox.save(),x.Spinner.showLoader();const s=x.Utils.getAllImages();try{await x.Utils.importThemifyImages(s.get("themify"))}catch(e){}const l=this.id,o=this.toJSON(!0),r=this.customCss||"";let t,e=s.get("local");e=0<e.size?JSON.stringify(Array.from(e)):"",await x.GS.setImport(x.GS.styles,null,!0);const n={data:JSON.stringify(x.Helper.clear(o)),sourceEditor:"visual"===x.mode?"frontend":"backend",action:"tb_save_data",images:e,custom_css:r};try{if(!(t=await x.LocalFetch(n)).success)throw t}catch(e){try{if(n.data=new Blob([n.data],{type:"application/json"}),!(t=await x.LocalFetch(n)).success)throw t}catch(e){throw await Promise.all([x.Spinner.showLoader("error"),TF_Notification.showHide("error",themifyBuilder.i18n.errorSaveBuilder,5e3)]),e}}t=t.data;const a=await x.Utils.saveCss(o,r,l,e,!(t=>{if("visual"!==x.mode){const s=s=>{const l=["padding_top","padding_bottom","padding_left","padding_right","margin-bottom","margin-top"],e=l.length,o=x.breakpointsReverse,r=o.length;for(let i=e-1;-1<i;--i){if("%"===s[l[i]+"_unit"]&&""!==s[l[i]]&&s[l[i]]!==C&&!s[l[i]].toString().includes(","))return!0;for(let t=r-2;-1<t;--t)if(s["breakpoint_"+o[t]]){let e=s["breakpoint_"+o[t]][l[i]];if(""!==e&&e!==C&&!e.toString().includes(",")&&"%"===ThemifyStyles.getStyleVal(l[i]+"_unit",s,o[t]))return!0}}};for(let e=t.length-1;-1<e;--e){let i=t[e];if(i.cols!==C)for(let e in i.cols){let t=i.cols[e];if(t.styling!==C&&s(t.styling))return!1;if(t.modules!==C)for(let e in t.modules){let i=t.modules[e];if(i&&i.cols!==C)for(let t in i.cols){let e=i.cols[t];if(e.styling!==C&&s(e.styling))return!1}}}}}return!0})(o));return t.css_file=a.css_file,x.Spinner.showLoader("done"),k.trigger("themify_builder_save_data",t),this.isSaved=!0,t}catch(e){throw e}finally{i.remove("disabled")}}},x.Builder.items=[],x.Builder.index=-1,x.Builder.get=e=>(e||0===e||(e=x.Builder.index),x.Builder.items[e]),x.pageBreakModule={countModules(){const t="visual"===x.mode,e=x.Builder.get().el,i=t?e.tfClass("module-page-break"):e.tfClass("tb-page-break");for(let e=i.length-1;-1<e;--e)!0==t?i[e].tfClass("page-break-order")[0].textContent=e+1:i[e].tfClass("page-break-overlay")[0].textContent="PAGE BREAK - "+(e+1)},get(){return[{cols:[{grid_class:"col-full",modules:[{mod_name:"page-break"}]}],styling:{custom_css_row:"tb-page-break"}}]}},x.Utils={onResizeEvents:new Set,_onResize(s){return new Promise(e=>{let i=$._data(u,"events");if(i=i&&i.resize)for(let e=0,t=i.length;e<t;++e)i[e].handler!==C&&this.onResizeEvents.add(i[e].handler);if($(u).off("resize"),s){const t=$.Event("resize",{type:"resize",isTrigger:!1});for(let e of this.onResizeEvents)try{e.apply(u,[t,$])}catch(e){}k.triggerEvent(u,"resize"),k.trigger("tfsmartresize",{w:k.w,h:k.h})}e()})},_updateDocumentSize(){if("visual"===x.mode){let i,s;new ResizeObserver(t=>{"desktop"!==x.activeBreakPoint&&(s&&clearTimeout(s),s=setTimeout(()=>{const e=t[0].target;i&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{c.document.body.style.height=e.scrollHeight+"px",setTimeout(()=>{this._onResize(!0),c.document.body.style.height=e.scrollHeight+"px",s=i=null},220)})},60))}).observe(S.body)}},findCssRule(t,i){const s="@"===(i=i.replace(/\s*>\s*/g,">").replace(/\,\s/g,","))[0];for(let e=t.length-1;-1<e;--e)if(!0==s&&t[e].conditionText&&t[e].cssText.replace(/\s*>\s*/g,">").replace(/\,\s/g,",").includes(i)||!1==s&&!t[e].conditionText&&i===t[e].selectorText.replace(/\s*>\s*/g,">").replace(/\,\s/g,","))return e;return!1},filterClass(t){const i=x.getColClassValues();for(let e=t.length-1;-1<e;--e)if(i.includes(t[e]))return t[e];return""},_getRowSettings(e,t,a){t=t||"row",a=!!a;let i={},r;const o=x.Registry.get(e.dataset.cid);if(o){const d=e.tfClass(t+"_inner")[0],c=d.childElementCount,u=x.breakpointsReverse,h=u.length,g=[],_=["padding_top","padding_bottom","padding_left","padding_right","margin-bottom","margin-top"],m=_.length;for(let s=0,l=d.children;s<c;++s)if(l[s].classList.contains("module_column")){let i=x.Registry.get(l[s].dataset.cid);if(i){let o=l[s].tfClass("tb_holder")[0],e=this.filterClass(l[s].classList),t=g.push({element_id:i.id});if(--t,""!==e&&(g[t].grid_class=e),(r=x.Helper.cloneObject(i.get("styling")))&&0<Object.keys(r).length){if(!0===a&&"visual"===x.mode)for(let e=m-1;-1<e;--e){let i=_[e];"%"!==r[i+"_unit"]||""===r[i]||r[i]===C||r[i].toString().includes(",")||(r[i]=","+r[i]);for(let t=h-2;-1<t;--t)if(r["breakpoint_"+u[t]]!==C){let e=r["breakpoint_"+u[t]][i];""===e||e===C||e.toString().includes(",")||"%"!==ThemifyStyles.getStyleVal(i+"_unit",r,u[t])||(r["breakpoint_"+u[t]][i]=","+e)}}g[t].styling=r}if(o!==C){let l=[];for(let s=0,e=(o=o.children).length;s<e;++s){let t=x.Registry.get(o[s].dataset.cid),i=t?t.get("mod_name"):null;if(i){r=x.Helper.cloneObject(t.get("mod_settings"));let e=l.push({mod_name:i,element_id:t.id});--e,r&&0<Object.keys(r).length&&(delete r.cid,l[e].mod_settings=r),o[s].classList.contains("active_subrow")&&(l[e]=this._getRowSettings(o[s],"subrow",a))}}0<l.length&&(g[t].modules=l)}}}i={element_id:o.id,cols:g};let n=Object.assign({},o.get("sizes"));if(1<c){for(let l=h-1;-1<l;--l){let t=u[l],i=n[t+"_size"],s=n[t+"_area"],e=n[t+"_auto_h"];if(i){if((i=ThemifyStyles.getColSize(i,!1)).includes(" ")){for(let t=(i=i.replace(/\s\s+/g," ").split(" ")).length-1;-1<t;--t){let e=parseFloat(i[t].trim());1!==e&&(i[t]=i[t].replace(e.toString(),parseFloat(e.toFixed(5)).toString()))}i=i.join(" ").replaceAll("0.",".").trim()}n[t+"_size"]=i}if(s)if("desktop"===t)delete n[t+"_area"];else if(s.includes(" ")){if(s=s.replaceAll("col","").replace(/\s\s+/g," ").trim(),n[t+"_area"]=s,i&&!i.includes(" ")){let e=o.getGridCss({size:i},t);e["--area"]&&e["--area"].replaceAll("col","").replace(/\s\s+/g," ").trim()===s&&delete n[t+"_area"]}}else ThemifyStyles.getAreaValue(s)||delete n[t+"_area"];e&&(n[t+"_auto_h"]=parseInt(e)),!0===a&&n[t+"_dir"]!==C&&delete n[t+"_dir"]}for(let e=0;e<h-1;++e){let i=u[e],s=n[i+"_gutter"],l=n[i+"_auto_h"],o=n[i+"_size"],r=n[i+"_align"];if(s||r||l||o)for(let t=e+1;t<h;++t){let e=u[t];if(s&&n[e+"_gutter"]&&(n[e+"_gutter"]===s&&delete n[i+"_gutter"],s=null),r&&n[e+"_align"]&&(n[e+"_align"]===r&&delete n[i+"_align"],r=null),l&&n[e+"_auto_h"]&&(n[e+"_auto_h"]===l&&delete n[i+"_auto_h"],l=null),o&&n[e+"_size"]&&(!0===a&&n[e+"_size"]===o&&delete n[i+"_size"],o=null),!(s||r||l||o))break}}if(n.desktop_area){const s=[];for(let e=0;e<c;++e)s.push(e+1);s.join(" ")===n.desktop_area&&delete n.desktop_area}n.mobile_dir===C||n.desktop_dir&&n.desktop_dir!==n.tablet_landscape_dir||n.tablet_dir!==n.mobile_dir||n.tablet_landscape_dir!==n.mobile_dir?"ltr"===n.desktop_dir&&delete n.desktop_dir:(delete n.desktop_dir,delete n.tablet_landscape_dir,delete n.tablet_dir,delete n.mobile_dir),-1===n.desktop_auto_h&&delete n.desktop_auto_h,"start"===n.desktop_align&&!1==p&&delete n.desktop_align,"gutter"===n.desktop_gutter&&delete n.desktop_gutter;for(let e in n)n[e]!==C&&""!==n[e]||delete n[e]}else n={};i.sizes=n,(r=x.Helper.cloneObject(o.get("styling")))&&0<Object.keys(r).length&&(delete r.cid,i.styling=r)}return i},getAllImages(e){const i=x.Registry.items,t=new Map,s=new Set,l=new Set,o=new Set,r=e=>{x.Helper.isImageUrl(e)&&(e.includes("themify.me")||e.includes("themify.org")?e.includes(themifyBuilder.site_url)||o.add(e):(e.includes(k.urlHost)?s:l).add(e))},n=t=>{for(let e in t)if(t[e])if(Array.isArray(t[e])||"object"==typeof t[e])n(t[e]);else{let i=t[e].toString().trim();if(i)if(i.includes("<img ")){let e=S.createElement("template"),s=(e.innerHTML=i,e.content.querySelectorAll("img"));for(let i=s.length-1;-1<i;--i){let e=s[i].src,t=s[i].srcset;t=t?t.split(" "):[],e&&t.push(e);for(let e=t.length-1;-1<e;--e)t[e]&&r(t[e].trim())}}else if("["===i[0]&&i.includes("path=")){let t=i.match(/path.*?=.*?['"](.+?)['"]/gim);if(t&&t[0])for(let e=(t=t[0].split("path=")[1].replaceAll('"',"").replace("'","").split(",")).length-1;-1<e;--e)t[e]&&r(t[e].trim())}else r(i)}};for(let[e,t]of i)t.el.isConnected&&n(t.get("styling"));const a=x.Builder.get().el.tfTag("img");for(let i=a.length-1;-1<i;--i){let e=a[i].src,t=a[i].srcset;t=t?t.split(" "):[],e&&t.push(e);for(let e=t.length-1;-1<e;--e)t[e]&&r(t[e].trim())}return t.set("themify",o),t.set("local",s),t.set("external",l),e?t.get(e):t},async importThemifyImages(o){if(0<(o=o||this.getAllImages("themify")).size)return new Promise(async(e,t)=>{try{await k.loadJs(k.url+"js/admin/import/import-images",!!u.TF_ImportImages);const i=parseInt(themifyBuilder.memory)||64,s=255<=i?4:120<=i?3:60<i?2:1,r=await TF_ImportImages.init(o,themifyBuilder.nonce,themifyBuilder.i18n.uploading,s),n=x.breakpointsReverse,l=x.Registry.items,a=o=>{for(let s in o)if(o[s]===C)delete o[s];else if(o[s])if(Array.isArray(o[s])||"object"==typeof o[s])a(o[s]);else{let i=o[s].toString().trim();if(i)if(i.includes("<img ")){let e=S.createElement("template"),t=(e.innerHTML="<div>"+i+"</div>",e.content.firstChild),l=t.tfTag("img");for(let s=l.length-1;-1<s;--s){let i=l[s].src;if(i)for(let[e,t]of r)!1!==t&&i.includes(e)&&(l[s].outerHTML=t.html)}o[s]=t.innerHTML}else if(isNaN(i)&&("["===i[0]||!i.includes(" ")))for(let[e,t]of r)!1!==t&&i.includes(e)&&(o[s]=i.replaceAll(e,t.src))}};for(let[l,o]of r)if(!1!==o){let t=S.querySelectorAll('img[src="'+l+'"]');for(let e=t.length-1;-1<e;--e)t[e].src=o.src,t[e].classList.add("wp-image-"+o.id);if("visual"===x.mode)for(let s=n.length-1;-1<s;--s){let e=n[s],t=ThemifyStyles.getSheet(e).cssRules,i=ThemifyStyles.getSheet(e,!0).cssRules;for(let e=t.length-1;-1<e;--e)t[e].style.cssText=t[e].style.cssText.replaceAll(l,o.src);for(let e=i.length-1;-1<e;--e)t[e].style.cssText=t[e].style.cssText.replaceAll(l,o.src)}}for(let[e,t]of l)a(t.get("styling"));TF_Notification.showHide("done","",100),e(r)}catch(e){t(e)}})},grid(e){const i=[],s=x.getColClass()[e.toString()];let l=s===C?s.length:parseInt(e);for(let t=0;t<l;++t){let e=s===C?{}:{grid_class:s[t]};i.push(e)}return[{cols:i}]},setCompactMode(t){const i=t.length;if(0<i){for(let e=i-1;-1<e;--e)t[e]&&t[e].classList.toggle("compact-mode",t[e].clientWidth<185);const e=t[0].parentNode,s=e.classList,l=e.childElementCount;for(let e=s.length-1;-1<e;--e)if(0===s[e].indexOf("tb_col_count_")){s.remove(s[e]);break}s.add("tb_col_count_"+l)}},async saveCss(e,t,i,s,l){let o;const r={css:e&&!l?JSON.stringify(x.GS.createCss(e,e[0]&&e[0].mod_name||null,!0)):"",action:"tb_save_css",custom_css:!l&&t?t:"",bid:i,images:s||"",delete_css:l?1:""};try{o=await x.LocalFetch(r)}catch(e){try{r.css=new Blob([r.css],{type:"application/json"}),o=await x.LocalFetch(r)}catch(e){throw e}}return o},async runJs(e,t,i){const o=[];if("visual"===x.mode){if(!t)if(null!==x.activeModel)t=x.activeModel.type;else if(e){const s=x.Registry.get(e.dataset.cid);s&&(t=s.type)}if("module"===t&&!0===x.is_builder_ready&&k.fonts(e),!0!==i){const l=e||S,r=l.querySelectorAll("img[data-w]:not(.tf_large_img)"),n=r.length,a=k.isTouch?4:8,d=k.isTouch?20:5;for(let l=n-1;-1<l;--l)if(2560<r[l].naturalWidth||2560<r[l].naturalHeight)r[l].className+=" tf_large_img",k.largeImages(r[l]);else{let i=r[l].getAttribute("width"),s=r[l].getAttribute("height");if(i||s)if(a<n){let e=new Promise((e,t)=>{setTimeout(()=>{ThemifyImageResize.toBlob(r[l],i,s).then(e).catch(t)},l*d)});o.push(e)}else o.push(ThemifyImageResize.toBlob(r[l],i,s))}}}try{await Promise.all(o)}catch(e){}if(e&&u.Isotope){const c=k.selectWithParent("masonry-done",e);for(let t=c.length-1;-1<t;--t){let e=Isotope.data(c[t]);e&&e.destroy(),c[t].classList.remove("masonry-done")}}return k.reRun(e)},getBPWidth(e){const t=Array.isArray(themifyBuilder.breakpoints[e])?themifyBuilder.breakpoints[e]:themifyBuilder.breakpoints[e].toString().split("-");return t[t.length-1]},scrollTo(e,t,i){e&&(t?((i=i||{}).top=e.getBoundingClientRect().top-u.document.body.getBoundingClientRect().top-t,u.scrollTo(i)):e.scrollIntoView(i))},addViewPortClass(i){i.style.transition="none",this.removeViewPortClass(i);for(let e=this.isInViewport(i),t=e.length-1;-1<t;--t)i.classList.add(e[t]);i.style.transition=""},removeViewPortClass(t){const i=["top","left","bottom","right"];for(let e=4;-1<e;--e)t.classList.remove("tb_touch_"+i[e])},isInViewport(e){const t=e.getBoundingClientRect(),i=[];return t.left<0?i.push("tb_touch_left"):t.right-1>=S.documentElement.clientWidth&&i.push("tb_touch_right"),t.top<0?i.push("tb_touch_top"):(t.bottom+1>=S.documentElement.clientHeight||u.innerHeight+u.scrollY>=S.body.offsetHeight&&t.bottom+20>=S.documentElement.clientHeight)&&i.push("tb_touch_bottom"),i}},x.correctColumnPaddings=()=>new Promise(l=>{if("visual"!==x.mode)l();else{const i=x.Builder.get().el.tfClass("module_column"),e=i.length;if(0<e){const n=["padding_top","padding_bottom","padding_left","padding_right","margin-bottom","margin-top"],o=x.breakpointsReverse,r=o.length,_={};for(let t=i.length-1;-1<t;--t){let l=i[t].dataset.cid,e=x.Registry.get(l);if(e){let s=e.get("styling");if(s!==C){for(let e=r-1;-1<e;--e){let t=o[e],i="desktop"===t?s:s["breakpoint_"+t];if(i){let e=((s,l,o)=>{const r={};for(let i=n.length-1;-1<i;--i){let e=n[i],t=s[e];""===t||t===C||t.toString().includes(",")||"%"!==ThemifyStyles.getStyleVal(e+"_unit",l,o)||(r[e]=t)}return r})(i,s,t);0<Object.keys(e).length&&(_[t]===C&&(_[t]={}),_[t][l]=e)}}for(let i=r-2;-1<i;--i){let t=o[i];if(_[t]===C||_[t][l]===C)for(let e=i+1;e<r;++e)if(_[o[e]]!==C&&_[o[e]][l]!==C){_[t]===C&&(_[t]={}),_[t][l]=Object.assign({},_[o[e]][l]);break}}}}}if(0===Object.keys(_).length)l();else{let g=S.createElement("iframe"),e=(g.id="tb_regenerate_css_iframe",g.style.setProperty("position","fixed","important"),g.style.setProperty("top","-100000000px","important"),g.style.setProperty("left","-100000000px","important"),g.style.setProperty("visibility","hidden","important"),g.style.setProperty("min-width","auto","important"),g.style.setProperty("max-height","none","important"),g.style.setProperty("min-height","auto","important"),g.style.setProperty("contain","none","important"),g.style.setProperty("width","100%","important"),g.style.setProperty("height","100%","important"),g.style.setProperty("opacity","0","important"),g.src="about:blank",g.className="tb_iframe",c.document.body.appendChild(g),g.contentWindow.document),t=S.documentElement.cloneNode(!0);const s=t.querySelectorAll("script"),a=x.breakpointsReverse;for(let e=s.length-1;-1<e;--e)s[e].remove();e.open(),e.write("<!DOCTYPE html>"+t.outerHTML);for(let t=a.length-1;-1<t;--t){let e=ThemifyStyles.styleName+a[t],i=ThemifyStyles.getSheet(a[t]).cssRules,s=ThemifyStyles.getSheet(a[t],!0).cssRules,l=g.contentWindow.document.querySelector("#"+e).sheet,o=g.contentWindow.document.querySelector("#"+e+"_global").sheet;for(let e=0,t=s.length;e<t;++e)o.insertRule(s[e].cssText);for(let e=0,t=i.length;e<t;++e)l.insertRule(i[e].cssText)}t=null;const d=S.createElement("style");d.textContent="html,body,body *,div,a{transition:none!important;animation:none!important;pointer-events:none!important}",g.contentWindow.document.body.appendChild(d),g.tfOn("load",function(){e=null;const i=c.innerWidth+5,s=this.contentWindow.document.body.classList,t=a.length;s.add("tb_start_animate");for(let e=t-1;-1<e;--e){let h=a[e];if(_[h]!==C){let e="max-width",t="desktop"===h?null:+x.Utils.getBPWidth(h),u=ThemifyStyles.getSheet(h);(!t||t>=i)&&(e="min-width",t||(t=x.Utils.getBPWidth("tablet_landscape")+1)<i&&(t=""),t===i)&&--t,s.remove("builder-breakpoint-mobile","builder-breakpoint-tablet","builder-breakpoint-tablet_landscape"),"desktop"!==h?s.add("tb_responsive_mode","builder-breakpoint-"+h):s.remove("tb_responsive_mode"),this.style.setProperty("max-width","none","important"),this.style.setProperty("min-width","auto","important"),t&&this.style.setProperty(e,t+"px","important");for(let c in _[h]){let e=x.Registry.get(c),r=ThemifyStyles.getBaseSelector(e.type,c),n=g.contentWindow.document.querySelector(r),a=e.get("styling"),d=x.Utils.findCssRule(u.cssRules,r),t=getComputedStyle(n).getPropertyValue("position");if("absolute"!==t&&"fixed"!==t){n.style.setProperty("padding","0","important");let l=n.parentNode.getBoundingClientRect().width,o=n.getBoundingClientRect().width;for(let t in _[h][c]){let e=_[h][c][t],i=t.replace("_","-"),s=100*parseFloat(parseFloat(e)/100*l/o);if(s=parseFloat(parseFloat(s.toFixed(2))).toString(),"desktop"===h){if(a[t]!==C&&a[t].toString().includes(","))continue;a[t]===C&&(a[t]=""),a[t]+=","+s}else{if(a["breakpoint_"+h]!==C&&a["breakpoint_"+h][t]!==C&&a["breakpoint_"+h][t].toString().includes(","))continue;a["breakpoint_"+h]===C&&(a["breakpoint_"+h]={}),a["breakpoint_"+h][t]===C&&(a["breakpoint_"+h][t]=""),a["breakpoint_"+h][t]+=","+s}if("p"!==t[0])!1!==d&&u.cssRules[d]!==C?u.cssRules[d].style.setProperty(i,s+"%"):u.insertRule(r+"{"+i+":"+s+"%}",u.cssRules.length);else{n.style.padding="";let e=!1!==d&&u.cssRules[d]!==C,t=(!0==e?u.cssRules[d].style:g.contentWindow.getComputedStyle(n)).getPropertyValue("padding");n.style.setProperty("padding","0","important"),t&&_[h][c].padding_top!==C&&!t.includes(" ")&&(s=_[h][c].padding_top,s=100*parseFloat(parseFloat(s)/100*l/o),s=parseFloat(parseFloat(s.toFixed(2))).toString(),i="padding"),!0==e?u.cssRules[d].style.setProperty(i,s+"%"):u.insertRule(r+"{"+i+":"+s+"%}",u.cssRules.length)}}e.set("styling",a)}}}}this.remove(),g=null,l()},{passive:!0,once:!0}),e.close()}}else l()}}),u.tfOn("offline",()=>{setTimeout(()=>{if(!u.navigator.onLine&&!x.Builder.get().isSaved&&x.undoManager.hasUndo()){const e=x.ToolBar.el.tfClass("save_wrap")[0].classList,d=S.createElement("div"),c=n=>{if(n.composedPath()[0].closest("a")){n.preventDefault(),n.stopImmediatePropagation(),n.currentTarget.tfOff(n.type,c,{once:!0});let e=x.Builder.get(),t=e.toJSON(!0),i=e.customCss,s=themifyBuilder.post_title,l=new Date,o=l.getFullYear()+"_"+l.getMonth()+"_"+l.getDate(),r=x.GS.findUsedItems(t);if(t={builder_data:t},i&&(t.custom_css=i.trim()),r){const a={};for(let t=r.length-1;-1<t;--t){let e=x.Helper.cloneObject(x.GS.styles[r[t]]);delete e.id,delete e.url,a[r[t]]=e}t.used_gs=a}t=JSON.stringify(t),((e,t)=>{let i=S.createElement("a");i.download=t,i.rel="noopener",i.href=URL.createObjectURL(e),setTimeout(()=>{URL.revokeObjectURL(i.href),i=null},1e4),i.click(),TF_Notification.showHide("warning",d,300)})(new Blob([t],{type:"application/json"}),s+"_themify_builder_export_"+o+".txt")}};d.innerHTML=themifyBuilder.i18n.offline,TF_Notification.show("warning",d),e.add("disabled"),u.tfOn("online",()=>{e.remove("disabled"),TF_Notification.showHide("warning",d,300),TF_Notification.el.tfOff(k.click,c,{once:!0})},{passive:!0,once:!0}),TF_Notification.el.tfOn(k.click,c,{once:!0})}},3e3)},{passive:!0})})(jQuery,Themify,window,window.top,document,void 0);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка