Sid Gifari File Manager
🏠 Root
/
home2
/
compro23
/
luaoficial.com.br
/
wp-content
/
plugins
/
happy-elementor-addons
/
assets
/
admin
/
js
/
Editing: template-elements.min.js
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,o,r,i,l=[],d=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(a=r.call(n)).done)&&(l.push(a.value),l.length!==t);d=!0);}catch(e){c=!0,o=e}finally{try{if(!d&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}(d=>{var e=document.getElementById("tmpl-modal-template-condition"),a=document.getElementById("tmpl-elementor-new-template"),n=0,t=[],o="";"undefined"!=typeof elementor&&(elementor.on("panel:init",function(e){var t;n=elementor.config.document.id,t=n,jQuery.ajax({url:ajaxurl,type:"get",dataType:"json",data:{nonce:HappyAddonsEditor.editor_nonce,action:"ha_cond_get_current",template_id:t},success:function(e){e&&e.data&&(o=e.data)}}),"loop-template"!=haTemplateInfo.templateType&&elementor.getPanelView().footer.currentView.addSubMenuItem("saver-options",{before:"save-draft",name:"haconditions",icon:"ha-template-elements",title:"Template Conditions",callback:function(){return elementor.trigger("ha:templateCondition")}})}),elementor.on("set:page",function(e){})),d("body").append(e.innerHTML),"undefined"!=typeof elementor&&(elementor.on("ha:templateCondition",function(e){var t=d(".ha-template-condition-wrap");""==t.html()&&(t.append(o),t.find("select").trigger("change")),d(".ha-template-notice").removeClass("error").text(""),MicroModal.show("modal-new-template-condition")}),elementor.on("ha:templateConditionChange",function(e){var o;o=[],d(".ha-template-condition-wrap").find(".ha-template-condition-item").each(function(){var e=d(this).find(".ha-tce-type select").val(),t=d(this).find(".ha-tce-name select").val(),n=d(this).find(".ha-tce-sub_name select").val(),a=d(this).find(".ha-tce-sub_id select").val(),e=e+"/"+t;n&&(e+="/"+n),a&&(e+="/"+a.trim()),o.push(e)}),t=o})),"undefined"!=typeof elementor&&window.elementorV2&&window.elementorV2.editorAppBar&&window.elementorV2.editorAppBar.documentOptionsMenu&&window.elementorV2.editorAppBar.documentOptionsMenu.registerAction({id:"ha-template-condition",group:["save"],priority:10,props:{icon:function(){return React?React.createElement("i",{className:"hm hm-happyaddons"}):null},title:window.wp?window.wp.i18n.__("Template Conditions","happy-elementor-addons"):"Template Conditions",visible:!0,onClick:function(e){return e.preventDefault(),elementor.trigger("ha:templateCondition")}}}),d(document).on("click",".ha-cond-repeater-add",function(){var e,t=d(".ha-template-condition-wrap"),n=(e=a.innerHTML,n=Math.random().toString(36).replace("0.",""),e=e.replace(/{{([^{}]+)}}/g,n));t.append(n),elementor.trigger("ha:templateConditionChange")}),d(document).on("click",".ha-template-condition-remove",function(){d(this).parent().remove(),elementor.trigger("ha:templateConditionChange")}),d(document).on("click","#ha-template-save-data",function(){var e;(e=document.getElementById("elementor-panel-saver-button-publish")).classList.add("elementor-button-state"),n=elementor.config.document.id,jQuery.ajax({url:ajaxurl,type:"post",dataType:"json",data:{nonce:HappyAddonsEditor.editor_nonce,action:"ha_condition_update",conds:t,template_id:n},success:function(e){e&&(!e.success&&e.hasOwnProperty("data")&&e.data.hasOwnProperty("msg")?d(".ha-template-notice").addClass("error").text(e.data.msg):(MicroModal.close("modal-new-template-condition"),d(".ha-template-notice").removeClass("error").text("")))}}),setTimeout(function(){e.classList.remove("elementor-button-state")},500)}),d(document).on("change",".ha-template-condition-wrap select",function(e){var t,n,a,o,r,i,l;"select"==e.target.localName&&(a=e.target.dataset.parent,t=e.target.dataset.setting,e=e.target.value,d("[data-id='type-"+a+"']"),n=d("[data-id='name-"+a+"']"),r=d("[data-id='sub_name-"+a+"']"),a=d("[data-id='sub_id-"+a+"']"),"name"==t&&("general"==e?(r.parent().hide(),a.parent().hide()):(r.parent().show(),o=r.data("selected")?r.data("selected"):"",((t,e,n)=>{jQuery.ajax({url:ajaxurl,type:"get",dataType:"json",data:{nonce:HappyAddonsEditor.editor_nonce,action:"ha_condition_autocomplete",object_type:e},success:function(e){e&&e.data&&(e=((e,t)=>{for(var n="",a=0,o=Object.entries(e);a<o.length;a++){var r=_slicedToArray(o[a],2),i=r[0],r=r[1];if(r.hasOwnProperty("type")){n+="<optgroup label='"+r.title+"'>";for(var l=0,d=Object.entries(r.conditions);l<d.length;l++){var c=_slicedToArray(d[l],2),p=c[0],c=c[1],s=c.is_pro,u=c.title,m="";s&&(u+=" [Pro]",m=" disabled"),n+="<option value='"+(h=p)+"' "+m+(t==h?" selected":"")+">"+u+"</option>"}n+="</optgroup>"}else{var h,s=r.is_pro,u=r.title,m="";s&&(u+=" [Pro]",m=" disabled"),n+="<option value='"+(h=i)+"' "+m+(t==h?" selected":"")+">"+u+"</option>"}}return n})(e.data,n),t.html(e))}})})(r,n.val(),o))),"sub_name"==t)&&((r={post:"post",in_category:"category",in_category_children:"category",in_post_tag:"post_tag",post_by_author:"author",page:"page",page_by_author:"author",child_of:"page",any_child_of:"page",by_author:"author"}).hasOwnProperty(e)?(a.parent().show(),i=r[e],l=e,["post","page"].includes(i)&&(l=i,i="post"),["category","post_tag"].includes(i)&&(l=i,i="tax"),a.select2({ajax:{url:ajaxurl,dataType:"json",delay:250,data:function(e){return{nonce:HappyAddonsEditor.editor_nonce,action:"ha_condition_autocomplete",q:e.term,object_type:i,object_term:l}},processResults:function(e){var n;return e.success&&0!==e.data.length?(n=[],_.each(e.data,function(e,t){n.push({id:t,text:e})}),{results:n}):{results:[{id:-1,text:"No results found",disabled:!0}]}}},minimumInputLength:2,cache:!0,placeholder:"All",allowClear:!0,dropdownCssClass:"ha-template-condition-dropdown"})):a.parent().hide()),elementor.trigger("ha:templateConditionChange")}),"undefined"!=typeof elementor&&elementor.saver&&elementor.saver.on("after:save",function(e){"inherit"!=e.status&&"loop-template"!=haTemplateInfo.templateType&&elementor.trigger("ha:templateCondition")})})(jQuery);
Save
Cancel