File: /home/enamadmin/public_html/wp-content/plugins/thim-elementor-kit/build/admin.js
(()=>{"use strict";var e={250:(e,t,n)=>{var o=n(196),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useState,a=o.useEffect,l=o.useLayoutEffect,s=o.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),o=i({inst:{value:n,getSnapshot:t}}),r=o[0].inst,u=o[1];return l((function(){r.value=n,r.getSnapshot=t,c(r)&&u({inst:r})}),[e,n,t]),a((function(){return c(r)&&u({inst:r}),e((function(){c(r)&&u({inst:r})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:u},688:(e,t,n)=>{e.exports=n(250)},196:e=>{e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e=window.wp.element,t=window.wp.i18n,o=window.wp.components,r=window.wp.apiFetch;var i=n.n(r),a=n(196),l=n(688);const s=new WeakMap,c={},u={},d=()=>{},m=d(),p=Object,h=e=>e===m,f=e=>"function"==typeof e,g=(e,t)=>({...e,...t}),y="undefined",E=typeof window!=y,v=typeof document!=y,_=(e,t)=>{const n=s.get(e);return[()=>e.get(t)||c,o=>{if(!h(t)){const r=e.get(t);t in u||(u[t]=r),n[5](t,g(r,o),r||c)}},n[6],()=>!h(t)&&t in u?u[t]:e.get(t)||c]},w=new WeakMap;let k=0;const S=e=>{const t=typeof e,n=e&&e.constructor,o=n==Date;let r,i;if(p(e)!==e||o||n==RegExp)r=o?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(r=w.get(e),r)return r;if(r=++k+"~",w.set(e,r),n==Array){for(r="@",i=0;i<e.length;i++)r+=S(e[i])+",";w.set(e,r)}if(n==p){r="#";const t=p.keys(e).sort();for(;!h(i=t.pop());)h(e[i])||(r+=i+":"+S(e[i])+",");w.set(e,r)}}return r};let b=!0;const[C,x]=E&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[d,d],O={isOnline:()=>b,isVisible:()=>{const e=v&&document.visibilityState;return h(e)||"hidden"!==e}},L={initFocus:e=>(v&&document.addEventListener("visibilitychange",e),C("focus",e),()=>{v&&document.removeEventListener("visibilitychange",e),x("focus",e)}),initReconnect:e=>{const t=()=>{b=!0,e()},n=()=>{b=!1};return C("online",t),C("offline",n),()=>{x("online",t),x("offline",n)}}},T=!a.useId,P=!E||"Deno"in window,R=P?a.useEffect:a.useLayoutEffect,D="undefined"!=typeof navigator&&navigator.connection,M=!P&&D&&(["slow-2g","2g"].includes(D.effectiveType)||D.saveData),F=e=>{if(f(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?S(e):"",t]};let I=0;const N=()=>++I;async function V(...e){const[t,n,o,r]=e,i=g({populateCache:!0,throwOnError:!0},"boolean"==typeof r?{revalidate:r}:r||{});let a=i.populateCache;const l=i.rollbackOnError;let c=i.optimisticData;const u=!1!==i.revalidate,d=i.throwOnError;if(f(n)){const e=n,o=[],r=t.keys();for(let n=r.next();!n.done;n=r.next()){const r=n.value;!r.startsWith("$inf$")&&e(t.get(r)._k)&&o.push(r)}return Promise.all(o.map(p))}return p(n);async function p(n){const[r]=F(n);if(!r)return;const[i,p]=_(t,r),[g,y,E]=s.get(t),v=g[r],w=()=>u&&(delete E[r],v&&v[0])?v[0](2).then((()=>i().data)):i().data;if(e.length<3)return w();let k,S=o;const b=N();y[r]=[b,0];const C=!h(c),x=i(),O=x.data,L=x._c,T=h(L)?O:L;if(C&&(c=f(c)?c(T):c,p({data:c,_c:T})),f(S))try{S=S(T)}catch(e){k=e}if(S&&f(S.then)){if(S=await S.catch((e=>{k=e})),b!==y[r][0]){if(k)throw k;return S}k&&C&&(e=>"function"==typeof l?l(e):!1!==l)(k)&&(a=!0,S=T,p({data:S,_c:m}))}a&&(k||(f(a)&&(S=a(S,T)),p({data:S,_c:m}))),y[r][1]=N();const P=await w();if(p({_c:m}),!k)return a?P:S;if(d)throw k}}const B=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},W=(e,t)=>{if(!s.has(e)){const n=g(L,t),o={},r=V.bind(m,e);let i=d;const a={},l=(e,t)=>{const n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},c=(t,n,o)=>{e.set(t,n);const r=a[t];if(r)for(const e of r)e(n,o)},u=()=>{if(!s.has(e)&&(s.set(e,[o,{},{},{},r,c,l]),!P)){const t=n.initFocus(setTimeout.bind(m,B.bind(m,o,0))),r=n.initReconnect(setTimeout.bind(m,B.bind(m,o,1)));i=()=>{t&&t(),r&&r(),s.delete(e)}}};return u(),[e,r,u,i]}return[e,s.get(e)[4]]},[q,A]=W(new Map),j=g({onLoadingSlow:d,onSuccess:d,onError:d,onErrorRetry:(e,__,t,n,o)=>{const r=t.errorRetryCount,i=o.retryCount,a=~~((Math.random()+.5)*(1<<(i<8?i:8)))*t.errorRetryInterval;!h(r)&&i>r||setTimeout(n,a,o)},onDiscarded:d,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:M?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:M?5e3:3e3,compare:(e,t)=>S(e)==S(t),isPaused:()=>!1,cache:q,mutate:A,fallback:{}},O),K=(e,t)=>{const n=g(e,t);if(t){const{use:o,fallback:r}=e,{use:i,fallback:a}=t;o&&i&&(n.use=o.concat(i)),r&&a&&(n.fallback=g(r,a))}return n},U=(0,a.createContext)({}),z=E&&window.__SWR_DEVTOOLS_USE__,$=z?window.__SWR_DEVTOOLS_USE__:[],H=$.concat((e=>(t,n,o)=>e(t,n&&((...e)=>{const o=F(t)[0],[,,,r]=s.get(q),i=r[o];return i?(delete r[o],i):n(...e)}),o)));z&&(window.__SWR_DEVTOOLS_REACT__=a);const J={dedupe:!0};p.defineProperty((e=>{const{value:t}=e,n=(0,a.useContext)(U),o=f(t),r=(0,a.useMemo)((()=>o?t(n):t),[o,n,t]),i=(0,a.useMemo)((()=>o?r:K(n,r)),[o,n,r]),l=r&&r.provider,[s]=(0,a.useState)((()=>l?W(l(i.cache||q),r):m));return s&&(i.cache=s[0],i.mutate=s[1]),R((()=>{if(s)return s[2]&&s[2](),s[3]}),[]),(0,a.createElement)(U.Provider,g(e,{value:i}))}),"defaultValue",{value:j});var Q,G=(Q=(e,t,n)=>{const{cache:o,compare:r,suspense:i,fallbackData:c,revalidateOnMount:u,revalidateIfStale:d,refreshInterval:p,refreshWhenHidden:v,refreshWhenOffline:w,keepPreviousData:k}=n,[S,b,C]=s.get(o),[x,O]=F(e),L=(0,a.useRef)(!1),D=(0,a.useRef)(!1),M=(0,a.useRef)(x),I=(0,a.useRef)(t),B=(0,a.useRef)(n),W=()=>B.current,q=()=>W().isVisible()&&W().isOnline(),[A,j,K,U]=_(o,x),z=(0,a.useRef)({}).current,$=h(c)?n.fallback[x]:c,H=(e,t)=>{let n=!0;for(const o in z){const i=o;"data"===i?r(t[i],e[i])||h(e[i])&&r(t[i],oe)||(n=!1):t[i]!==e[i]&&(n=!1)}return n},Q=(0,a.useMemo)((()=>{const e=!!x&&!!t&&(h(u)?!W().isPaused()&&!i&&(!!h(d)||d):u),n=t=>{const n=g(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n};let o=n(A());const r=n(U());return[()=>{const e=n(A());return H(e,o)?o:o=e},()=>r]}),[o,x]),G=(0,l.useSyncExternalStore)((0,a.useCallback)((e=>K(x,((t,n)=>{H(n,t)||e()}))),[o,x]),Q[0],Q[1]),X=!L.current,Y=S[x]&&S[x].length>0,Z=G.data,ee=h(Z)?$:Z,te=G.error,ne=(0,a.useRef)(ee),oe=k?h(Z)?ne.current:Z:ee,re=!(Y&&!h(te))&&(X&&!h(u)?u:!W().isPaused()&&(i?!h(ee)&&d:h(ee)||d)),ie=!!(x&&t&&X&&re),ae=h(G.isValidating)?ie:G.isValidating,le=h(G.isLoading)?ie:G.isLoading,se=(0,a.useCallback)((async e=>{const t=I.current;if(!x||!t||D.current||W().isPaused())return!1;let o,i,a=!0;const l=e||{},s=!C[x]||!l.dedupe,c=()=>T?!D.current&&x===M.current&&L.current:x===M.current,u={isValidating:!1,isLoading:!1},d=()=>{j(u)},p=()=>{const e=C[x];e&&e[1]===i&&delete C[x]},g={isValidating:!0};h(A().data)&&(g.isLoading=!0);try{if(s&&(j(g),n.loadingTimeout&&h(A().data)&&setTimeout((()=>{a&&c()&&W().onLoadingSlow(x,n)}),n.loadingTimeout),C[x]=[t(O),N()]),[o,i]=C[x],o=await o,s&&setTimeout(p,n.dedupingInterval),!C[x]||C[x][1]!==i)return s&&c()&&W().onDiscarded(x),!1;u.error=m;const e=b[x];if(!h(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return d(),s&&c()&&W().onDiscarded(x),!1;const l=A().data;u.data=r(l,o)?l:o,s&&c()&&W().onSuccess(o,x,n)}catch(e){p();const t=W(),{shouldRetryOnError:n}=t;t.isPaused()||(u.error=e,s&&c()&&(t.onError(e,x,t),(!0===n||f(n)&&n(e))&&q()&&t.onErrorRetry(e,x,t,(e=>{const t=S[x];t&&t[0]&&t[0](3,e)}),{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return a=!1,d(),!0}),[x,o]),ce=(0,a.useCallback)(((...e)=>V(o,M.current,...e)),[]);if(R((()=>{I.current=t,B.current=n,h(Z)||(ne.current=Z)})),R((()=>{if(!x)return;const e=se.bind(m,J);let t=0;const n=((e,t,n)=>{const o=t[e]||(t[e]=[]);return o.push(n),()=>{const e=o.indexOf(n);e>=0&&(o[e]=o[o.length-1],o.pop())}})(x,S,((n,o={})=>{if(0==n){const n=Date.now();W().revalidateOnFocus&&n>t&&q()&&(t=n+W().focusThrottleInterval,e())}else if(1==n)W().revalidateOnReconnect&&q()&&e();else{if(2==n)return se();if(3==n)return se(o)}}));return D.current=!1,M.current=x,L.current=!0,j({_k:O}),re&&(h(ee)||P?e():(o=e,E&&typeof window.requestAnimationFrame!=y?window.requestAnimationFrame(o):setTimeout(o,1))),()=>{D.current=!0,n()};var o}),[x]),R((()=>{let e;function t(){const t=f(p)?p(ee):p;t&&-1!==e&&(e=setTimeout(n,t))}function n(){A().error||!v&&!W().isVisible()||!w&&!W().isOnline()?t():se(J).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[p,v,w,x]),(0,a.useDebugValue)(oe),i&&h(ee)&&x){if(!T&&P)throw new Error("Fallback data is required when using suspense in SSR.");throw I.current=t,B.current=n,D.current=!1,h(te)?se(J):te}return{mutate:ce,get data(){return z.data=!0,oe},get error(){return z.error=!0,te},get isValidating(){return z.isValidating=!0,ae},get isLoading(){return z.isLoading=!0,le}}},function(...e){const t=g(j,(0,a.useContext)(U)),[n,o,r]=(e=>f(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(e),i=K(t,r);let l=Q;const{use:s}=i,c=(s||[]).concat(H);for(let e=c.length;e--;)l=c[e](l);return l(n,o||i.fetcher||null,i)});const X=window.lodash,Y=window.wp.url;function Z(n){let{value:r,onChange:a,type:l}=n;const[s,c]=(0,e.useState)(""),[u,d]=(0,e.useState)(""),{data:m,error:p,isLoading:h}=G((0,Y.addQueryArgs)("/thim-ekit/select-query-conditions",{search:u,type:l}),(e=>i()({path:e}))),f=(0,e.useCallback)((0,X.debounce)((e=>d(e)),600),[]);return(0,e.createElement)("div",{style:{flex:1}},(0,e.createElement)(o.Dropdown,{style:{width:"100%"},placement:"bottom center",renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,e.createElement)("button",{type:"button",className:"components-button is-secondary",style:{minWidth:160,width:"100%",maxWidth:280,height:36,justifyContent:"space-between",color:"rgb(30, 30, 30)"},onClick:o},(0,e.createElement)("span",{style:{display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},m&&m.find((e=>e.id===r))?.title||"Select"),(0,e.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",role:"img","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})))},renderContent:n=>{let{onToggle:r}=n;return(0,e.createElement)(e.Fragment,null,p?(0,e.createElement)("p",null,(0,t.__)("Error")):(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.TextControl,{value:s,style:{minWidth:200},onChange:e=>{c(e),f(e)}}),h&&(0,e.createElement)(o.Spinner,null),m&&m.length>0&&m.map((t=>(0,e.createElement)(o.MenuItem,{key:t.id,onClick:()=>{a(t.id),r()}},t.title)))))}}))}function ee(n){let{conditions:r,setConditions:i,type:a}=n;const l=new URL(location.href),s=a||l.searchParams.get("thim_elementor_type"),c=(e,t,n)=>{const o=[...r];o[e][t]=n,i(o)};return(0,e.createElement)("div",null,r.map(((n,a)=>(0,e.createElement)("div",{key:a,style:{display:"flex",gap:10,paddingBottom:5}},(0,e.createElement)("div",{style:{flex:1}},(0,e.createElement)(o.SelectControl,{style:{height:36},value:n.comparison,options:[{label:(0,t.__)("Include","thim-elementor-kit-pro"),value:"include"},{label:(0,t.__)("Exclude","thim-elementor-kit-pro"),value:"exclude"}],onChange:e=>c(a,"comparison",e)})),(0,e.createElement)("div",{style:{flex:1}},(0,e.createElement)(o.SelectControl,{style:{height:36},value:n.type,options:thimEKit?.list_conditions?.[s],onChange:e=>c(a,"type",e)})),thimEKit?.list_conditions?.[s].find((e=>e.value===n.type))?.is_query&&(0,e.createElement)(Z,{type:n.type,value:n.query,onChange:e=>c(a,"query",e)}),(0,e.createElement)(o.Button,{variant:"secondary",style:{height:36},label:"Remove",showTooltip:!0,onClick:()=>(e=>{const t=[...r];t.splice(e,1),i(t)})(a)},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",style:{width:20,height:20}},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})))))),(0,e.createElement)(o.Button,{variant:"primary",onClick:()=>i([...r,{comparison:"include",type:"all",query:null}])},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",style:{width:18,height:18}},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})),(0,t.__)("Add condition","thim-elementor-kit-pro")))}const te="undefined"!=typeof thimEKit?thimEKit.types:[];function ne(n){let{open:r,setOpen:a}=n;const[l,s]=(0,e.useState)(""),[c,u]=(0,e.useState)(""),[d,m]=(0,e.useState)([]),[p,h]=(0,e.useState)([]),[f,g]=(0,e.useState)({id:0,isPro:!1}),[y,E]=(0,e.useState)(!1),[v,_]=(0,e.useState)("post"),[w,k]=(0,e.useState)(!1),[S,b]=(0,e.useState)({status:"",message:""}),{data:C,error:x,isLoading:O}=G("/thim-ekit/get-layout-libraries",(e=>i()({path:e})));return(0,e.useEffect)((()=>{if(C){const e=[],t=[];C?.free?.[l]&&(Object.entries(C.free[l]).forEach((t=>{let[n,o]=t;o?.loop_type&&o?.loop_type!==v||e.push({...o,id:parseFloat(n),isPro:!1})})),e.sort(((e,t)=>e.priority-t.priority))),C?.theme?.[l]&&(Object.entries(C.theme[l]).forEach((e=>{let[n,o]=e;o?.loop_type&&o?.loop_type!==v||t.push({...o,id:parseFloat(n),isPro:!0})})),t.sort(((e,t)=>e.priority-t.priority))),h([...e,...t])}}),[C,l,v]),(0,e.useEffect)((()=>{!function(){const e=new URL(location.href).searchParams.get("thim_elementor_type");e&&s(e)}()}),[]),(0,e.createElement)(o.SlotFillProvider,null,(0,e.createElement)(o.Modal,{className:"thim-ekit__modal",focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:(0,t.__)("Add new template","thim-elementor-kit"),onRequestClose:()=>a(!1)},(0,e.createElement)(e.Fragment,null,(0,e.createElement)("form",{onSubmit:e=>{e.preventDefault(),async function(){k(!0);try{const e=await i()({path:"thim-ekit/create-template",method:"POST",data:{name:c,type:l,sticky:y,conditions:d,layout:f,loopType:v}});b({status:e.status,message:e.message||""}),k(!1),e?.data?.redirect&&(window.location.href=e.data.redirect)}catch(e){b({status:"error",message:e.message||""}),k(!1)}}()}},(0,e.createElement)(o.SelectControl,{label:(0,t.__)("Select the type","thim-elementor-kit"),value:l,onChange:e=>{s(e),g({id:0,isPro:!1})},options:te}),(0,e.createElement)(o.TextControl,{label:(0,t.__)("Template name","thim-elementor-kit"),placeholder:(0,t.__)("Enter template nameā¦","thim-elementor-kit"),value:c,onChange:e=>u(e)}),"header"===l&&(0,e.createElement)(o.CheckboxControl,{label:(0,t.__)("Enable sticky","thim-elementor-kit"),checked:y,onChange:E}),"loop_item"===l&&thimEKit?.loop_item?.post_type&&(0,e.createElement)(o.SelectControl,{label:(0,t.__)("Select post type","thim-elementor-kit"),value:v,onChange:e=>{_(e),g({id:0,isPro:!1})},options:thimEKit?.loop_item?.post_type||[]}),thimEKit?.list_conditions?.[l]&&(0,e.createElement)(o.BaseControl,{id:"thim-elementor-kit-pro-conditions",label:(0,t.__)("Conditions","thim-elementor-kit")},(0,e.createElement)(ee,{conditions:d,setConditions:m,type:l})),l&&(0,e.createElement)(e.Fragment,null,O?(0,e.createElement)(o.Spinner,null):(0,e.createElement)(e.Fragment,null,!x&&p.length>0&&(0,e.createElement)(o.BaseControl,{id:"thim-elementor-kit-layouts",label:(0,t.__)("Select Layouts","thim-elementor-kit")},(0,e.createElement)("div",{className:"thim-elementor-kit-layouts"},p.map((n=>(0,e.createElement)("div",{key:n.id,className:"thim-elementor-kit-layouts__item "+(n.id===f.id?"thim-elementor-kit-layouts__item--active":""),onClick:()=>g({id:n.id!==f.id?n.id:0,isPro:n.isPro}),onKeyDown:()=>g({id:n.id!==f.id?n.id:0,isPro:n.isPro}),"aria-hidden":"true"},(0,e.createElement)("img",{src:n.thumbnail,alt:n?.title||""}),n.isPro&&(0,e.createElement)("span",{className:"thim-elementor-kit-layouts__item__pro"},(0,t.__)("Pro","thim-elementor-kit")),n.title&&(0,e.createElement)("span",{className:"thim-elementor-kit-layouts__item__label"},n.title)))))))),(0,e.createElement)("div",{style:{display:"flex",gap:10,margin:"20px 0 0 0",borderTop:"1px solid #eee",paddingTop:20}},(0,e.createElement)(o.Button,{variant:"primary",type:"submit",icon:w?(0,e.createElement)(o.Spinner,null):""},(0,t.__)("Create template","thim-elementor-kit")))),S.status&&(0,e.createElement)(o.Notice,{status:S.status,isDismissible:!1},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:S?.message||(0,t.__)("No data available","thim-elementor-kit")}})))),(0,e.createElement)(o.Popover.Slot,null))}function oe(n){let{open:r,setOpen:a,postID:l}=n;const[s,c]=(0,e.useState)(""),[u,d]=(0,e.useState)(""),[m,p]=(0,e.useState)([]);return(0,e.useEffect)((()=>{r&&async function(){c("fetch");const e=await i()({path:`/thim-ekit/get-conditions?postID=${l}`});e&&p(e),c("")}()}),[]),(0,e.createElement)(o.SlotFillProvider,null,(0,e.createElement)(o.Modal,{className:"thim-edit-module__modal",focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:(0,t.__)("Edit template","thim-elementor-kit-pro"),onRequestClose:()=>a(!1)},"fetch"===s?(0,e.createElement)("div",{style:{textAlign:"center",padding:20}},(0,e.createElement)(o.Spinner,{style:{height:"20px",width:"20px"}})):(0,e.createElement)("div",{className:"thim-edit-module__modal__content",style:{paddingTop:5}},(0,e.createElement)(ee,{conditions:m,setConditions:p}),(0,e.createElement)("div",{style:{display:"flex",gap:10,margin:"20px 0 0 0",borderTop:"1px solid #eee",paddingTop:20}},(0,e.createElement)(o.Button,{variant:"primary",onClick:async()=>{try{c("save");const e=await i()({path:"/thim-ekit/save-conditions",method:"POST",data:{conditions:m,postID:l}});if(!e?.success)throw new Error(e?.message||(0,t.__)("Something went wrong!","thim-elementor-kit"));a(!1)}catch(e){d(e.message)}finally{c("")}},disabled:""!==s},"save"===s&&(0,e.createElement)(o.Spinner,{style:{margin:"0 5px 0 0"}}),(0,t.__)("Save","thim-elementor-kit-pro")),(0,e.createElement)(o.Button,{variant:"secondary",text:"Close",onClick:()=>a(!1)})),u&&(0,e.createElement)("div",{style:{margin:"10px -15px 0"}},(0,e.createElement)(o.Notice,{status:"error",isDismissible:!1},u)))),(0,e.createElement)(o.Popover.Slot,null))}te.unshift({value:"",label:(0,t.__)("Default","thim-elementor-kit")}),((e,t)=>{const n=F(e)[0],[,,,o]=s.get(q);if(o[n])return o[n];const r=(a=e,i()({path:a}));var a;o[n]=r})("/thim-ekit/get-layout-libraries"),(0,e.render)((0,e.createElement)((function(){const[n,r]=(0,e.useState)(!1),[i,a]=(0,e.useState)(0),[l,s]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{const e=document.querySelector(".page-title-action"),t=document.querySelector(".wp-heading-inline");function n(){-1!==location.hash.indexOf("edit_condition_")&&(a(location.hash.replace("#edit_condition_","")),s(!0),location.hash=""),"#add_new"===location.hash&&(r(!0),location.hash="")}return e&&e.remove(),t&&t.remove(),n(),window.addEventListener("hashchange",(()=>{n()}),!1),()=>{window.removeEventListener("hashchange",(()=>{n()}),!1)}}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"thim-ekit"},(0,e.createElement)("div",{className:"thim-ekit__inner"},(0,e.createElement)("h1",{className:"thim-ekit__heading"},(0,t.__)("Thim Elementor Templates","thim-elementor-kit")),(0,e.createElement)(o.Button,{variant:"primary",onClick:()=>r(!n)},(0,t.__)("Add new","thim-elementor-kit"))),(0,e.createElement)("div",null,(0,e.createElement)("a",{href:"https://thimpress.com/contact-us/",className:"thim-ekit__contact"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})),(0,t.__)("Contact us","thim-elementor-kit")))),n&&(0,e.createElement)(ne,{open:n,setOpen:r}),l&&(0,e.createElement)(oe,{open:l,setOpen:s,postID:i}))}),null),document.getElementById("thim-elementor-header"))})()})();