Current File : /pages/54/47/d0016649/home/htdocs/ob_maxi/wp-content/themes/thrive-theme/tests/js/all.min.js |
!function(){var e={2464:function(e,t,n){const o=n(3264);switch(n(5940),o.getTemplateType()){case"single":n(1281);break;case"list":n(2897)}},2897:function(e,t,n){n(4849)},4849:function(){QUnit.module("General List",{}),QUnit.test("General checks",(e=>{e.true(!TVE.Theme.template.isSingular(),"This is not a singular template")}))},5940:function(e,t,n){const o=n(8852),i=n(3328),s=n(5898),r=e=>`#theme-${e}-section`;QUnit.module("Sections",{before:()=>{TVE.Elements["main-container"].components.animation.hidden=!0},afterEach:()=>{TVE.ActiveElement&&TVE.ActiveElement.head_css(i.reset),TVE.Components.background.get_collection().reset([]),TVE.Editor_Page.blur()}}),QUnit.testWithSelectedElement("Position for Sidebar",r("sidebar"),((e,t)=>{const n=o.get("theme_section","Position"),i=o.get("main-container","Gutter");TVE.Components.theme_section.section=TVE.Theme.utils.getSectionInstance(t),n.setValue("left",!0),e.equal(TVE.inner.window.ThriveTheme.utils.getSidebarPosition(),"left","Move sidebar to left"),o.get("sidebar-settings","SidebarDisplay").setValue("normal",!0);const c=s.getBySelector(r("content")),a=s.offset(t,"right"),l=s.offset(c,"left");i.update(TVE.Theme.$main),e.equal(a<l,!0,"Sidebar is on left"),e.equal(l-a,i.getValue(),"Correct gutter."),n.setValue("right",!0)})),["top","bottom"].forEach((e=>{const t=TVE.ucFirst(e),n=r(e);QUnit.testWithSelectedElement(`Visibility for ${t} Section`,n,((e,n)=>{const i=o.get("theme_section","Visibility");TVE.Components.theme_section.section=TVE.Theme.utils.getSectionInstance(n),i.setChecked(!1,!0),e.equal(s.isVisible(n),!1,`Visibility hide functionality on ${t} Section`),i.setChecked(!0,!0),e.equal(s.isVisible(n),!0,`Visibility show functionality on ${t} Section`)})),QUnit.testWithSelectedElement(`Contained(Full Width) for ${t} Section`,n,((e,n)=>{const i=o.get("theme_section","StretchBackground");TVE.Components.theme_section.section=TVE.Theme.utils.getSectionInstance(n),i.setChecked(!0,!0),e.equal(n.parent().hasClass("main-container"),!1,`${t} section is Full width`),i.setChecked(!1,!0)})),QUnit.testWithSelectedElement(`Section Height for ${t} Section`,n,((e,n)=>{const i=o.get("theme_section","SectionHeight");TVE.Components.theme_section.section=TVE.Theme.utils.getSectionInstance(n),i.setValue(500,!0),e.equal(parseInt(n.css("height")),500,`${t} section height is 500px`)})),QUnit.testWithSelectedElement(`Width for ${t} Section`,n,((e,n)=>{const i=o.get("theme_section","MinWidth");TVE.Components.theme_section.section=TVE.Theme.utils.getSectionInstance(n),i.setValue(500,!0),e.equal(parseInt(n.css("min-width")),500,`${t} section Content max-width is 500px`),i.setValue("100%",!0),e.equal(parseInt(n.css("min-width")),100,`${t} section Content has full width`)})),QUnit.testWithSelectedElement(`VerticalPosition for ${t} Section`,n,((e,n)=>{const i=n.find(".section-content"),s=o.get("theme_section","VerticalPosition");TVE.Components.theme_section.section=TVE.Theme.utils.getSectionInstance(n),o.setActive(s,"center"),e.equal(i.css("justify-content"),"center",`${t} section Vertical position center`),o.setActive(s,"flex-end"),e.equal(i.css("justify-content"),"flex-end",`${t} section Vertical position bottom`),s.$(".default").trigger("click"),e.equal(i.css("justify-content"),"normal",`${t} section Vertical position top`),o.get("theme_section","SectionHeight").setValue(20,!0)}))})),QUnit.testWithSelectedElement("Gutter for Columns",".main-container",((e,t)=>{const n=o.get("main-container","Gutter"),i=s.getBySelector(".main-columns-separator");n.setValue(100,!0),e.equal(parseInt(i.css("width")),n.getValue(),"Correct gutter. Gutter was changed")})),QUnit.testWithSelectedElement("Content Width for Template Section","#content",((e,t)=>{o.get("template-content","LayoutWidth").setValue(1234,!0),e.equal(parseInt(TVE.Theme.$main.css("width")),1234,"The template width was changed to 1234px")})),QUnit.testWithSelectedElement("Boxed Layout(ContentFullWidth) for Template Section","#content",((e,t)=>{TVE.Components["template-content"].$('.full-width-control [data-fn="toggleFullWidth"][data-boxed="0"]').trigger("click"),e.equal(TVE.Theme.$main.css("max-width").trim(),"100%","Template container was changed to Full Width")})),i.elements.forEach((e=>{QUnit.testWithSelectedElement(`Background for ${e.name}`,e.selector,((t,n)=>{const s=o.get("background.ColorPicker");o.background.color(i.colors.cyan.hex),t.equal(o.head_css(s,"background-color"),i.colors.cyan.rgb,`${e.name} Background is Cyan`)})),QUnit.testWithSelectedElement(`Solid Background for ${e.name}`,e.selector,((t,n)=>{const s=o.get("background.ColorPicker");o.background.add_solid_layer(i.colors.cyan.hex),t.equal(o.head_css(s,"background-image"),"linear-gradient("+i.colors.cyan.rgb+", "+i.colors.cyan.rgb+")",`${e.name} Solid Background is Cyan`)})),QUnit.testWithSelectedElement(`Corners for ${e.name}`,e.selector,((t,n)=>{const i=o.get("borders.Corners");i.current_corner="",o.corner.size(40),t.equal(parseInt(o.head_css(i,"border-radius")),40,`Border radius is 40px for ${e.name}`)})),QUnit.testWithSelectedElement(`Borders for ${e.name}`,e.selector,((e,t)=>{const n=o.get("borders.Borders");n.border_side="",o.border.side(""),o.border.color(i.colors.red.hex),o.border.width(5),e.equal(o.head_css(n,"border-color"),i.colors.red.rgb,"Border color was changed to Red"),e.equal(parseInt(o.head_css(n,"border-width")),5,"Border width was changed to 5px")}))})),QUnit.testWithSelectedElement("Visibility for Sidebar",r("sidebar"),((e,t)=>{const n=o.get("theme_section","Visibility");n.setChecked(!1,!0),e.equal(s.isVisible(t),!1,"Visibility hide functionality"),n.setChecked(!0,!0),e.equal(s.isVisible(t),!0,"Visibility show functionality")}),"theme_section")},1281:function(e,t,n){n(403)},403:function(){QUnit.module("General Single",{}),QUnit.test("General checks",(e=>{e.true(TVE.Theme.template.isSingular(),"This is a singular template")}))},8852:function(e){class t{static setActive(e,t){let n;Array.isArray(t)||(t=[t]),e.clearActive(),t.forEach((t=>{n=e.$(`[data-value="${t}"]`).click()[0]})),e.change(e.applyTo(),n)}static head_css(e,t){return e.applyTo().head_css(t,!1,e.config.css_suffix,!1,e.config.css_prefix)}static get(e,t){e.match(/(.+)[\.|\/](.+)/)&&(e=RegExp.$1,t=RegExp.$2);const n=TVE.Components[e].controls[t];return"function"==typeof n.onShow&&(n.onShow(),n.favorites&&n.favorites.on_color_show&&n.favorites.on_color_show()),n}static background_panel(e){return TVE.Components.background.tabs.data.buttons[e].panel}static open_panel(e,t){return e.$el.find(`[data-panel="${t}"]`).trigger("click"),e.data.buttons[t].panel}static get background(){return{color:e=>t.get("background.ColorPicker").setValue(e,!0,!0),add_solid_layer:e=>{const n=t.open_panel(TVE.Components.background.tabs,"solid");return n.color.setValue(e,!0),n.onApply(),n}}}static get border(){const e=t.get("borders.Borders");return{color:t=>e.controls.Color.setValue(t,!0,!0),width:t=>e.controls.Width.setValue(parseInt(t),!0,!0),style:t=>e.controls.Style.setValue(t,!0,!0),side:function(t){return e.$(t?'.tve-border-side[data-value="'+t+'"]':".default").trigger("click"),this}}}static get corner(){const e=t.get("borders.Borders"),n=t.get("borders.Corners");return{side:function(t){return e.$(t?`.tve-corner[data-value="${t}"]`:".default").trigger("click"),this},size:e=>n.controls.BorderRadius.setValue(parseInt(e),!0,!0)}}}e.exports=t},3328:function(e){e.exports={lyrics:"<p>Oh, let the sun beat down upon my face</p><p>And stars fill my dream</p><p>I'm a traveler of both time and space</p><p>To be where I have been</p><p>To sit with elders of the gentle race</p><p>This world has seldom seen</p><p>They talk of days for which they sit and wait</p><p>All will be revealed</p>",reset:{"background-image":"","background-color":"","border-color":"","border-width":0,"border-radius":0},default:{color:"rgb(0, 174, 239)",align:"justify",style:["bold","line-through","underline"],transform:"capitalize",size:"3em",lineHeight:"2em",letterSpacing:"5px",font:'"Comic Sans MS", cursive, sans-serif'},hover:{color:"rgb(0, 174, 239)",align:"right",style:["italic"],transform:"uppercase",size:"4em",lineHeight:"1em",letterSpacing:"10px",font:"Verdana, sans-serif"},colors:{cyan:{hex:"#00ffff",rgb:"rgb(0, 255, 255)"},red:{hex:"#ff0000",rgb:"rgb(255, 0, 0)"}},elements:[{name:"Template Container",selector:"#content"},{name:"Main Section Container",selector:".main-container"},{name:"Top Section",selector:".top-section"},{name:"Bottom Section",selector:".bottom-section"},{name:"Sidebar Section",selector:".sidebar-section"},{name:"Content Section",selector:".content-section"}]}},3264:function(e){e.exports=class{static changeState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";TVE.ActiveElement&&TVE.state_manager.change(e)}static getTemplateType(){return new URLSearchParams(window.location.search).get("jstest")}}},5898:function(e){class t{static select(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=t.getBySelector(e);if(n){const e=TVE.Editor_Page.selection_manager.select_element(o);return o.hasClass("theme-section")&&o.find(".section-content").trigger("click",{emulate:!0}),o.is("#content")&&o.find(".main-content-background").trigger("click",{emulate:!0}),e}return TVE.Editor_Page.focus_element(o),o}static getBySelector(e){let t;if(e.jquery)t=e;else{const n={};_.each(TVE.Elements,(function(e,t){n[t]=e.identifier})),t=n[e]?TVE.inner_$(n[e]).first():TVE.inner_$(e).first()}return t}static insert(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||void 0===TVE.Elements[t])throw new Error(`Unknown element type: ${t}`);n&&n.length||(n=TVE.Theme.$sections.top.find(".section-content")),void 0===TVE.renderers[t]?(e=TVE.main.static_element(t).children().first(),n.append(e)):e=TVE.inner_$(TVE.renderers[t].render_default(n));for(const t in o)e.attr(t,o[t]);return TVE.Theme.content.init_selectors(n),e}static isVisible(e){if(e.jQuery&&(e=$(e)),1!==e.length)return null;let t=!0;return e.is(".control-hide")&&(t=!1),t=t&&-1!==["block","inline","inline-block","flex","inline-flex"].indexOf(e.css("display")),t}static offset(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";switch(e.jquery&&(e=e[0]),n){case"left":t=e.offsetLeft;break;case"top":t=e.offsetTop;break;case"right":t=e.offsetLeft+e.offsetWidth;break;case"bottom":t=e.offsetTop+e.offsetHeight;break;default:t=!1}return t}}e.exports=t}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}!function(){"use strict";window.$=jQuery,window.media={};const e=n(5898),t={init:function(){n(2464),TVE.add_filter("tcb.selection.element",((e,t)=>(t.target.classList.contains("theme-section")&&(e=TVE.inner_$(t.target)),t.target.classList.contains("section-content")&&(e=TVE.inner_$(t.target.parentElement)),e))),TVE.$document.off("heartbeat-tick.wp-auth-check"),_.each(TVE.main.responsive,(function(e,t){window.media[t]=e.media})),TVE.UndoManager.setCallback((function(){window.onbeforeunload=null})),this.isCliRunner()||QUnit.start()},isCliRunner:function(){return navigator.userAgent.includes("Puppeteer-CLI-Runner")}};QUnit.testAsync=QUnit.asyncTest=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return QUnit.test(e,(function(e){const o=e.async(),i=t(e);if(i&&"function"==typeof i.then)return i.then((function(){return o()}));setTimeout((function(){return o()}),n)}))},QUnit.testWithSelectedElement=function(t,n,o){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return QUnit.testAsync(t,(function(t){const s=e.getBySelector(n);if(0===s.length)throw new Error(`${n} element was not found!!!`);return e.select(s,!0).then((function(){if(i&&TVE.Components[i]){const e=TVE._type(s);TVE.Components[i].open(TVE.Elements[e].components[i],e,{docked:!0}).then((()=>{o(t,s)}))}else o(t,s)}))}))},QUnit.config.autostart=!1,QUnit.done((function(){document.body.classList.remove("running")})),jQuery((function(){TVE.main.on("tcb-ready",(function(){t.init()}))}))}()}();