/home/bonphmya/liebeszauber-magie.de/wp-content/plugins/gtm-kit/assets/admin/settings.js
(()=>{var t,e,n={5588:(t,e,n)=>{"use strict";function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},i.apply(this,arguments)}var a;n.d(e,{AO:()=>d,B6:()=>_,Gh:()=>D,HS:()=>L,Oi:()=>o,Rr:()=>p,TM:()=>s,pX:()=>K,pb:()=>C,rc:()=>a,tH:()=>z,ue:()=>m,yD:()=>A}),function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(a||(a={}));const r="popstate";function s(t){return void 0===t&&(t={}),function(t,e,n,s){void 0===s&&(s={});let{window:l=document.defaultView,v5Compat:p=!1}=s,h=l.history,m=a.Pop,g=null,f=v();function v(){return(h.state||{idx:null}).idx}function x(){m=a.Pop;let t=v(),e=null==t?null:t-f;f=t,g&&g({action:m,location:k.location,delta:e})}function y(t){let e="null"!==l.location.origin?l.location.origin:l.location.href,n="string"==typeof t?t:d(t);return n=n.replace(/ $/,"%20"),o(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==f&&(f=0,h.replaceState(i({},h.state,{idx:f}),""));let k={get action(){return m},get location(){return t(l,h)},listen(t){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(r,x),g=t,()=>{l.removeEventListener(r,x),g=null}},createHref:t=>e(l,t),createURL:y,encodeLocation(t){let e=y(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){m=a.Push;let i=u(k.location,t,e);n&&n(i,t),f=v()+1;let r=c(i,f),s=k.createHref(i);try{h.pushState(r,"",s)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;l.location.assign(s)}p&&g&&g({action:m,location:k.location,delta:1})},replace:function(t,e){m=a.Replace;let i=u(k.location,t,e);n&&n(i,t),f=v();let r=c(i,f),s=k.createHref(i);h.replaceState(r,"",s),p&&g&&g({action:m,location:k.location,delta:0})},go:t=>h.go(t)};return k}((function(t,e){let{pathname:n="/",search:i="",hash:a=""}=p(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),u("",{pathname:n,search:i,hash:a},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let n=t.document.querySelector("base"),i="";if(n&&n.getAttribute("href")){let e=t.location.href,n=e.indexOf("#");i=-1===n?e:e.slice(0,n)}return i+"#"+("string"==typeof e?e:d(e))}),(function(t,e){l("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}function o(t,e){if(!1===t||null==t)throw new Error(e)}function l(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function c(t,e){return{usr:t.state,key:t.key,idx:e}}function u(t,e,n,a){return void 0===n&&(n=null),i({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?p(e):e,{state:n,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function d(t){let{pathname:e="/",search:n="",hash:i=""}=t;return n&&"?"!==n&&(e+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(e+="#"===i.charAt(0)?i:"#"+i),e}function p(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}var h;function m(t,e,n){return void 0===n&&(n="/"),function(t,e,n,i){let a=C(("string"==typeof e?p(e):e).pathname||"/",n);if(null==a)return null;let r=g(t);!function(t){t.sort(((t,e)=>t.score!==e.score?e.score-t.score:function(t,e){return t.length===e.length&&t.slice(0,-1).every(((t,n)=>t===e[n]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let s=null;for(let t=0;null==s&&t<r.length;++t){let e=N(a);s=j(r[t],e,i)}return s}(t,e,n,!1)}function g(t,e,n,i){void 0===e&&(e=[]),void 0===n&&(n=[]),void 0===i&&(i="");let a=(t,a,r)=>{let s={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:a,route:t};s.relativePath.startsWith("/")&&(o(s.relativePath.startsWith(i),'Absolute route path "'+s.relativePath+'" nested under path "'+i+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(i.length));let l=L([i,s.relativePath]),c=n.concat(s);t.children&&t.children.length>0&&(o(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),g(t.children,e,c,l)),(null!=t.path||t.index)&&e.push({path:l,score:w(l,t.index),routesMeta:c})};return t.forEach(((t,e)=>{var n;if(""!==t.path&&null!=(n=t.path)&&n.includes("?"))for(let n of f(t.path))a(t,e,n);else a(t,e)})),e}function f(t){let e=t.split("/");if(0===e.length)return[];let[n,...i]=e,a=n.endsWith("?"),r=n.replace(/\?$/,"");if(0===i.length)return a?[r,""]:[r];let s=f(i.join("/")),o=[];return o.push(...s.map((t=>""===t?r:[r,t].join("/")))),a&&o.push(...s),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(h||(h={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const v=/^:[\w-]+$/,x=3,y=2,k=1,b=10,S=-2,E=t=>"*"===t;function w(t,e){let n=t.split("/"),i=n.length;return n.some(E)&&(i+=S),e&&(i+=y),n.filter((t=>!E(t))).reduce(((t,e)=>t+(v.test(e)?x:""===e?k:b)),i)}function j(t,e,n){void 0===n&&(n=!1);let{routesMeta:i}=t,a={},r="/",s=[];for(let t=0;t<i.length;++t){let o=i[t],l=t===i.length-1,c="/"===r?e:e.slice(r.length)||"/",u=_({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},c),d=o.route;if(!u&&l&&n&&!i[i.length-1].route.index&&(u=_({path:o.relativePath,caseSensitive:o.caseSensitive,end:!1},c)),!u)return null;Object.assign(a,u.params),s.push({params:a,pathname:L([r,u.pathname]),pathnameBase:I(L([r,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(r=L([r,u.pathnameBase]))}return s}function _(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),l("*"===t||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were "'+t.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+t.replace(/\*$/,"/*")+'".');let i=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((t,e,n)=>(i.push({paramName:e,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(i.push({paramName:"*"}),a+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==t&&"/"!==t&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),i]}(t.path,t.caseSensitive,t.end),a=e.match(n);if(!a)return null;let r=a[0],s=r.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:i.reduce(((t,e,n)=>{let{paramName:i,isOptional:a}=e;if("*"===i){let t=o[n]||"";s=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const l=o[n];return t[i]=a&&!l?void 0:(l||"").replace(/%2F/g,"/"),t}),{}),pathname:r,pathnameBase:s,pattern:t}}function N(t){try{return t.split("/").map((t=>decodeURIComponent(t).replace(/\//g,"%2F"))).join("/")}catch(e){return l(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+e+")."),t}}function C(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&"/"!==i?null:t.slice(n)||"/"}const T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,O=t=>T.test(t);function R(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?n.length>1&&n.pop():"."!==t&&n.push(t)})),n.length>1?n.join("/"):"/"}function P(t,e,n,i){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function A(t,e){let n=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?n.map(((t,e)=>e===n.length-1?t.pathname:t.pathnameBase)):n.map((t=>t.pathnameBase))}function D(t,e,n,a){let r;void 0===a&&(a=!1),"string"==typeof t?r=p(t):(r=i({},t),o(!r.pathname||!r.pathname.includes("?"),P("?","pathname","search",r)),o(!r.pathname||!r.pathname.includes("#"),P("#","pathname","hash",r)),o(!r.search||!r.search.includes("#"),P("#","search","hash",r)));let s,c=""===t||""===r.pathname,u=c?"/":r.pathname;if(null==u)s=n;else{let t=e.length-1;if(!a&&u.startsWith("..")){let e=u.split("/");for(;".."===e[0];)e.shift(),t-=1;r.pathname=e.join("/")}s=t>=0?e[t]:"/"}let d=function(t,e){void 0===e&&(e="/");let n,{pathname:i,search:a="",hash:r=""}="string"==typeof t?p(t):t;if(i)if(O(i))n=i;else{if(i.includes("//")){let t=i;i=i.replace(/\/\/+/g,"/"),l(!1,"Pathnames cannot have embedded double slashes - normalizing "+t+" -> "+i)}n=i.startsWith("/")?R(i.substring(1),"/"):R(i,e)}else n=e;return{pathname:n,search:U(a),hash:M(r)}}(r,s),h=u&&"/"!==u&&u.endsWith("/"),m=(c||"."===u)&&n.endsWith("/");return d.pathname.endsWith("/")||!h&&!m||(d.pathname+="/"),d}const L=t=>t.join("/").replace(/\/\/+/g,"/"),I=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),U=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",M=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";class z extends Error{}function K(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}const $=["post","put","patch","delete"],B=(new Set($),["get",...$]);new Set(B),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred")},7677:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(6087),a=(0,i.forwardRef)((({icon:t,size:e=24,...n},a)=>(0,i.cloneElement)(t,{width:e,height:e,...n,ref:a})))},4277:(t,e,n)=>{"use strict";n.d(e,{A:()=>c,v:()=>l});var i=n(6942),a=n.n(i),r=n(6087),s=n(790);const o=(0,r.memo)((({count:t,important:e,nav:n=!1})=>(0,s.jsx)(s.Fragment,{children:t>0&&(0,s.jsx)("span",{className:a()("gtmkit-ml-2 gtmkit-text-xs gtmkit-text-white gtmkit-font-bold gtmkit-rounded-full gtmkit-py-px gtmkit-leading-[1.125rem] gtmkit-uppercase",{"gtmkit-bg-color-error":e},{"gtmkit-bg-color-success":!e},{"gtmkit-px-1.5":n},{"gtmkit-px-2":!n}),children:t})}))),l=(0,r.memo)((({metrics:t})=>(0,s.jsx)(o,{count:t.total,important:t.problem>0,nav:!0}))),c=o},7449:(t,e,n)=>{"use strict";n.d(e,{a:()=>a});var i=n(8621);const a=(t="general",e="")=>{const n=i.A.getAdminPageUrl();return e?`${n}${t}#/${e}`:`${n}${t}`}},7398:(t,e,n)=>{"use strict";n.d(e,{n:()=>s});var i=n(7723),a=n(7449),r=n(8621);const s=t=>((t,e,n)=>{const i=(t,n)=>({...n,title:t.title,to:t.path,group:t.group||n.group,option:t.option||n.option,text:[t.description],link:{...n.link,url:(0,a.a)(e,""),destination:"/"+t.path}});return"templates"===e?Object.keys(t).map((e=>i(t[e][0],n))):Object.keys(t).map((e=>i(t[e],n)))})(r.A.getRaw(t),t,function(t){switch(t){case"integrations":return{pill:!0,group:"integrations",option:null,link:{internal:!0,text:(0,i.__)("Setup Integration","gtm-kit")}};case"templates":return{pill:!1,group:null,option:null,link:{internal:!0,text:(0,i.__)("Get Template","gtm-kit")}};default:return{pill:!1,group:null,option:null,link:{internal:!0,text:(0,i.__)("Read More","gtm-kit")}}}}(t))},4085:(t,e,n)=>{"use strict";n.d(e,{yD:()=>p,Hz:()=>d,wi:()=>h,yZ:()=>u,Xx:()=>c});const i=window.wp.apiFetch;var a=n.n(i),r=n(8621),s=n(6555),o=n(4882);a().use(a().createNonceMiddleware(r.A.getNonce())),a().use(a().createRootURLMiddleware(r.A.getRestRoot()));const l=async(t,e,n=null,i=!1)=>{try{const r=await a()({path:t,method:e,...n&&{data:n}});if(!0===i)return r;if(!0===r.success)return r.data;throw new s.LG(r.message||"API request failed",r)}catch(i){if((0,o.vV)(i,{path:t,method:e,data:n}),i.message?.includes("NetworkError")||i.message?.includes("Failed to fetch"))throw new s.Dr(`Network error while calling ${t}`);if("rest_invalid_param"===i.code||400===i.data?.status)throw new s.yI(i.message||"Validation failed",i.data?.params);if(i instanceof s.LG||i instanceof s.Dr||i instanceof s.yI)throw i;throw new s.LG(i.message||`API request failed: ${t}`,i)}},c=t=>l("gtmkit/v1/set-options","POST",t),u=t=>l("gtmkit/v1/send-support-data","POST",t,!0),d=t=>l("gtmkit/v1/send-license-key","POST",t,!0),p=()=>l("gtmkit/v1/deactivate-license","POST",null,!0),h=t=>l("gtmkit/v1/set-notification-status","POST",t,!0)},9257:(t,e,n)=>{"use strict";n.d(e,{$E:()=>u,Ab:()=>l,E5:()=>r,FI:()=>i,I_:()=>s,Ls:()=>m,YU:()=>p,a1:()=>h,cT:()=>d,ev:()=>o,tx:()=>c,wO:()=>a});const i="FETCH_SETTINGS",a="UPDATE_SETTINGS_BEFORE",r="UPDATE_SETTINGS",s="UPDATE_STATE",o="SEND_SUPPORT_DATA_BEFORE",l="SEND_SUPPORT_DATA",c="SEND_LICENSE_KEY_BEFORE",u="SEND_LICENSE_KEY",d="SEND_NOTIFICATION_STATUS_BEFORE",p="SEND_NOTIFICATION_STATUS",h="OPTIMISTIC_NOTIFICATION_UPDATE",m="NOTIFICATION_UPDATE_ROLLBACK"},9132:(t,e,n)=>{"use strict";n.d(e,{BN:()=>u,t:()=>h});var i=n(6087),a=n(4085),r=n(8621),s=n(9257),o=n(4882),l=n(6555),c=n(790);const u=(0,i.createContext)(),d={licenseKey:"",isSendingLicenseKey:!1,isLicenseKeySent:!1,licenseKeyMessage:"",isPremium:!1,hasValidLicense:!1},p=(t,e)=>{const n={...t};switch(e.type){case s.tx:n.isSendingLicenseKey=!0;break;case s.$E:n.isSendingLicenseKey=!1,n.isLicenseKeySent=e.payload.isLicenseKeySent||!1,n.licenseKeyMessage=e.payload.licenseKeyMessage||"";break;case s.I_:void 0!==e.payload.licenseKey&&(n.licenseKey=e.payload.licenseKey),void 0!==e.payload.isSendingLicenseKey&&(n.isSendingLicenseKey=e.payload.isSendingLicenseKey);break;default:return t}return n},h=({children:t})=>{const[e,n]=(0,i.useReducer)(p,{...d,isPremium:r.A.isPremium(),hasValidLicense:r.A.hasValidLicense()}),h={licenseKey:e.licenseKey,isSendingLicenseKey:e.isSendingLicenseKey,isLicenseKeySent:e.isLicenseKeySent,licenseKeyMessage:e.licenseKeyMessage,isPremium:e.isPremium,hasValidLicense:e.hasValidLicense,updateLicenseKey:t=>{n({type:s.I_,payload:{licenseKey:t}})},sendLicenseKey:async()=>{n({type:s.tx});try{const t=await(0,a.Hz)(e.licenseKey);n({type:s.$E,payload:{isLicenseKeySent:t.success,licenseKeyMessage:t.data}})}catch(t){const e=t instanceof l.gG?t:new l.gG(t.message),i=(0,o.Qk)(e);n({type:s.$E,payload:{isLicenseKeySent:!1,licenseKeyMessage:i}})}},deactivateLicense:async()=>await(0,a.yD)(),useLicenseKey:e.licenseKey,useIsSendingLicenseKey:e.isSendingLicenseKey,useIsLicenseKeySent:e.isLicenseKeySent,useLicenseKeyMessage:e.licenseKeyMessage};return(0,c.jsx)(u.Provider,{value:h,children:t})}},282:(t,e,n)=>{"use strict";n.d(e,{V2:()=>l,ph:()=>d});var i=n(6087),a=n(4085),r=n(8621),s=n(9257);var o=n(790);const l=(0,i.createContext)(),c={notifications:{metrics:{total:0,problem:0}},isUpdatingNotifications:!1,previousNotifications:null},u=(t,e)=>{const n={...t};switch(e.type){case s.FI:n.notifications=e.payload.notifications;break;case s.cT:n.isUpdatingNotifications=!0;break;case s.YU:n.isUpdatingNotifications=!1,n.notifications=e.payload.notifications||t.notifications,n.previousNotifications=null;break;case s.a1:n.previousNotifications=t.notifications,n.notifications=e.payload.notifications;break;case s.Ls:n.notifications=t.previousNotifications||t.notifications,n.previousNotifications=null,n.isUpdatingNotifications=!1;break;default:return t}return n},d=({children:t})=>{const[e,n]=(0,i.useReducer)(u,c);(0,i.useEffect)((()=>{(()=>{const t=r.A.getNotifications();n({type:s.FI,payload:{notifications:t}})})()}),[]),(0,i.useEffect)((()=>{void 0!==e.notifications?.metrics?.total&&(t=>{if("undefined"==typeof document)return;const e=document.querySelectorAll("li.toplevel_page_gtmkit_general span.menu-counter");e&&0!==e.length&&e.forEach((e=>{const n=e.querySelector("span.count");n&&(n.textContent=t),e.className=e.className.replace(/count-\d+/,`count-${t}`)}))})(e.notifications.metrics.total)}),[e.notifications?.metrics?.total]);const d={notifications:e.notifications,isUpdatingNotifications:e.isUpdatingNotifications,setNotificationStatus:async(t,i)=>{const r=((t,e,n)=>{const i=JSON.parse(JSON.stringify(t));let a=null,r=null;for(const t in i)if("metrics"!==t&&i[t].active?.[e]){a=t,r=i[t].active[e];break}return a&&r?("dismiss"===n?(delete i[a].active[e],i[a].dismissed[e]=r,i.metrics?.total&&(i.metrics.total=Math.max(0,i.metrics.total-1))):"remove"===n&&delete i[a].dismissed[e],i):i})(e.notifications,t,i);n({type:s.a1,payload:{notifications:r}}),n({type:s.cT});try{const e={"notification-id":t,action:i},r=await(0,a.wi)(e);n({type:s.YU,payload:{notifications:r.data}})}catch(t){n({type:s.Ls})}},useNotifications:e.notifications,useIsUpdatingNotifications:e.isUpdatingNotifications};return(0,o.jsx)(l.Provider,{value:d,children:t})}},3951:(t,e,n)=>{"use strict";n.d(e,{ph:()=>d,xi:()=>g});var i=n(6087),a=n(7723);const r=window.lodash;var s=n(4085),o=n(8621),l=n(9257),c=n(4882),u=n(790);const d=(0,i.createContext)(),p={fetchedSettings:{},stateSettings:{},isPending:!0,canSave:!1,notice:"",hasError:!1},h=t=>({...t,general:t.general||{},integrations:t.integrations||{},premium:t.premium||{}}),m=(t,e)=>{const n={...t};switch(e.type){case l.FI:n.fetchedSettings=h(e.payload.fetchedSettings),n.stateSettings=h(e.payload.stateSettings),n.isPending=!1,n.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(n.notice="An error occurred.",n.hasError=!0);break;case l.wO:n.isPending=!0,n.notice="";break;case l.E5:n.fetchedSettings=h(e.payload.fetchedSettings),n.stateSettings=h(e.payload.stateSettings),n.isPending=!1,n.canSave=!1,n.notice=(0,a.__)("Settings saved successfully.","gtm-kit"),n.hasError=!1;break;case l.I_:void 0!==e.payload.fetchedSettings&&(n.fetchedSettings=e.payload.fetchedSettings),void 0!==e.payload.stateSettings&&(n.stateSettings=e.payload.stateSettings),void 0!==e.payload.canSave&&(n.canSave=e.payload.canSave),void 0!==e.payload.notice&&(n.notice=e.payload.notice),void 0!==e.payload.hasError&&(n.hasError=e.payload.hasError);break;default:return t}return n},g=({children:t})=>{const[e,n]=(0,i.useReducer)(m,p),a=()=>{const t=o.A.getSettings();n({type:l.FI,payload:{fetchedSettings:t,stateSettings:t}})};(0,i.useEffect)((()=>{a()}),[]);const h={settings:e.stateSettings,fetchedSettings:e.fetchedSettings,isPending:e.isPending,canSave:e.canSave,notice:e.notice,hasError:e.hasError,updateSettings:async()=>{n({type:l.wO});try{const t=await(0,s.Xx)(e.stateSettings);n({type:l.E5,payload:{fetchedSettings:t,stateSettings:t}})}catch(t){const e=(0,c.Qk)(t);n({type:l.I_,payload:{isPending:!1,hasError:!0,notice:e}})}},updateStateSettings:(t,i,a)=>{const s={...e.stateSettings,[t]:{...e.stateSettings[t]||{},[i]:a}},o=!(0,r.isEqual)(s,e.fetchedSettings);n({type:l.I_,payload:{stateSettings:s,canSave:o}})},importSettings:t=>{const i={...e.stateSettings,general:{...e.stateSettings.general||{},...t.general||{}}};"integrations"in t&&(i.integrations={...e.stateSettings.integrations||{},...t.integrations||{}});const a=!(0,r.isEqual)(i,e.fetchedSettings);n({type:l.I_,payload:{stateSettings:i,canSave:a}})},fetchSettings:a,useSettings:e.stateSettings};return(0,u.jsx)(d.Provider,{value:h,children:t})}},9730:(t,e,n)=>{"use strict";n.d(e,{hh:()=>o,p6:()=>s});var i=n(6087),a=n(8621),r=n(790);const s=(0,i.createContext)(),o=({children:t})=>{const e={siteData:a.A.getSiteData(),installData:"wizard"===a.A.getCurrentPage()?a.A.getInstallData():{},userRoles:a.A.getUserRoles(),useSiteData:a.A.getSiteData(),useInstallData:"wizard"===a.A.getCurrentPage()?a.A.getInstallData():{},useUserRoles:a.A.getUserRoles()};return(0,r.jsx)(s.Provider,{value:e,children:t})}},7568:(t,e,n)=>{"use strict";n.d(e,{fY:()=>o,p:()=>u});var i=n(6087),a=n(4085),r=n(9257),s=n(790);const o=(0,i.createContext)(),l={supportTicket:"",isSendingSystemData:!1,isSystemDataSent:!1,systemDataMessage:""},c=(t,e)=>{const n={...t};switch(e.type){case r.ev:n.isSendingSystemData=!0;break;case r.Ab:n.isSendingSystemData=!1,n.isSystemDataSent=e.payload.isSystemDataSent||!1,n.systemDataMessage=e.payload.systemDataMessage||"";break;case r.I_:void 0!==e.payload.supportTicket&&(n.supportTicket=e.payload.supportTicket),void 0!==e.payload.isSendingSystemData&&(n.isSendingSystemData=e.payload.isSendingSystemData);break;default:return t}return n},u=({children:t})=>{const[e,n]=(0,i.useReducer)(c,l),u={supportTicket:e.supportTicket,isSendingSystemData:e.isSendingSystemData,isSystemDataSent:e.isSystemDataSent,systemDataMessage:e.systemDataMessage,updateSupportTicket:t=>{n({type:r.I_,payload:{supportTicket:t}})},sendSystemData:async()=>{n({type:r.ev});try{const t=await(0,a.yZ)(e.supportTicket);n({type:r.Ab,payload:{isSystemDataSent:t.success,systemDataMessage:t.data}})}catch(t){n({type:r.Ab,payload:{isSystemDataSent:!1,systemDataMessage:t.message||"Failed to send system data"}})}},useSupportTicket:e.supportTicket,useIsSendingSystemData:e.isSendingSystemData,useIsSystemDataSent:e.isSystemDataSent,useSystemDataMessage:e.systemDataMessage};return(0,s.jsx)(o.Provider,{value:u,children:t})}},8621:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});const i=new class{constructor(){this.data=window.gtmkitSettings||{}}getSettings(){return this.data.settings||{}}getSiteData(){return this.data.site_data||{}}getInstallData(){return this.data.install_data||{}}getNotifications(){return this.data.notifications||{metrics:{total:0,problem:0}}}getCurrentPage(){return this.data.currentPage||""}isPremium(){return Boolean(this.data.isPremium)}hasValidLicense(){return Boolean(this.data.hasValidLicense)}getUserRoles(){return this.data.user_roles||[]}getPlugins(){return this.data.plugins||{}}isPluginActive(t){return Boolean(this.data.plugins?.[t])}getTaxonomyOptions(){return this.data.taxonomyOptions||[]}getTemplates(){return this.data.templates||{}}getRestRoot(){return this.data.root||""}getNonce(){return this.data.nonce||""}getRootId(){return this.data.rootId||"gtmkit-settings"}getAdminPageUrl(){return this.data.adminPageUrl||""}getPluginUrl(){return this.data.pluginUrl||""}getOpportunities(){return this.data.opportunities||[]}getPluginInstallUrl(){return this.data.pluginInstallUrl||""}getCurrentPageAlias(){return this.data.current_page||""}getPageOptions(){return this.data.pageOptions||[]}getTutorials(){return this.data.tutorials||[]}getGeneratorUrl(){return this.data.generatorUrl||""}getRaw(t){return this.data[t]}}},4882:(t,e,n)=>{"use strict";n.d(e,{Qk:()=>r,vV:()=>s});var i=n(7723),a=n(6555);const r=t=>t instanceof a.yI?t.message:t instanceof a.gG?(0,i.__)("License validation failed. Please check your license key.","gtm-kit"):t instanceof a.Dr?(0,i.__)("Network error. Please check your connection and try again.","gtm-kit"):t instanceof a.LG?(0,i.__)("Server error. Please try again later.","gtm-kit"):(0,i.__)("An unexpected error occurred. Please try again.","gtm-kit"),s=(t,e={})=>{}},6555:(t,e,n)=>{"use strict";n.d(e,{Dr:()=>o,LG:()=>a,gG:()=>s,yI:()=>r});class i extends Error{constructor(t,e="GTMKIT_ERROR"){super(t),this.name="GTMKitError",this.code=e,Error.captureStackTrace&&Error.captureStackTrace(this,i)}}class a extends i{constructor(t,e=null){super(t,"API_ERROR"),this.name="APIError",this.response=e,Error.captureStackTrace&&Error.captureStackTrace(this,a)}}class r extends i{constructor(t,e=null){super(t,"VALIDATION_ERROR"),this.name="ValidationError",this.field=e,Error.captureStackTrace&&Error.captureStackTrace(this,r)}}class s extends i{constructor(t){super(t,"LICENSE_ERROR"),this.name="LicenseError",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}class o extends i{constructor(t){super(t,"NETWORK_ERROR"),this.name="NetworkError",Error.captureStackTrace&&Error.captureStackTrace(this,o)}}},7767:(t,e,n)=>{"use strict";n.d(e,{$P:()=>p,BV:()=>P,C5:()=>T,Ix:()=>R,Rq:()=>o,V8:()=>C,Zp:()=>f,jb:()=>l,qh:()=>O,sp:()=>s,x$:()=>v,zy:()=>m});var i=n(1609),a=n(5588);function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r.apply(this,arguments)}const s=i.createContext(null),o=i.createContext(null),l=i.createContext(null),c=i.createContext(null),u=i.createContext({outlet:null,matches:[],isDataRoute:!1}),d=i.createContext(null);function p(t,e){let{relative:n}=void 0===e?{}:e;h()||(0,a.Oi)(!1);let{basename:r,navigator:s}=i.useContext(l),{hash:o,pathname:c,search:u}=v(t,{relative:n}),d=c;return"/"!==r&&(d="/"===c?r:(0,a.HS)([r,c])),s.createHref({pathname:d,search:u,hash:o})}function h(){return null!=i.useContext(c)}function m(){return h()||(0,a.Oi)(!1),i.useContext(c).location}function g(t){i.useContext(l).static||i.useLayoutEffect(t)}function f(){let{isDataRoute:t}=i.useContext(u);return t?function(){let{router:t}=function(){let t=i.useContext(s);return t||(0,a.Oi)(!1),t}(E.UseNavigateStable),e=j(w.UseNavigateStable),n=i.useRef(!1);return g((()=>{n.current=!0})),i.useCallback((function(i,a){void 0===a&&(a={}),n.current&&("number"==typeof i?t.navigate(i):t.navigate(i,r({fromRouteId:e},a)))}),[t,e])}():function(){h()||(0,a.Oi)(!1);let t=i.useContext(s),{basename:e,future:n,navigator:r}=i.useContext(l),{matches:o}=i.useContext(u),{pathname:c}=m(),d=JSON.stringify((0,a.yD)(o,n.v7_relativeSplatPath)),p=i.useRef(!1);return g((()=>{p.current=!0})),i.useCallback((function(n,i){if(void 0===i&&(i={}),!p.current)return;if("number"==typeof n)return void r.go(n);let s=(0,a.Gh)(n,JSON.parse(d),c,"path"===i.relative);null==t&&"/"!==e&&(s.pathname="/"===s.pathname?e:(0,a.HS)([e,s.pathname])),(i.replace?r.replace:r.push)(s,i.state,i)}),[e,r,d,c,t])}()}function v(t,e){let{relative:n}=void 0===e?{}:e,{future:r}=i.useContext(l),{matches:s}=i.useContext(u),{pathname:o}=m(),c=JSON.stringify((0,a.yD)(s,r.v7_relativeSplatPath));return i.useMemo((()=>(0,a.Gh)(t,JSON.parse(c),o,"path"===n)),[t,c,o,n])}function x(t,e,n,s){h()||(0,a.Oi)(!1);let{navigator:o}=i.useContext(l),{matches:d}=i.useContext(u),p=d[d.length-1],g=p?p.params:{},f=(p&&p.pathname,p?p.pathnameBase:"/");p&&p.route;let v,x=m();if(e){var y;let t="string"==typeof e?(0,a.Rr)(e):e;"/"===f||(null==(y=t.pathname)?void 0:y.startsWith(f))||(0,a.Oi)(!1),v=t}else v=x;let E=v.pathname||"/",w=E;if("/"!==f){let t=f.replace(/^\//,"").split("/");w="/"+E.replace(/^\//,"").split("/").slice(t.length).join("/")}let j=(0,a.ue)(t,{pathname:w}),N=function(t,e,n,r){var s;if(void 0===e&&(e=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==t){var o;if(!n)return null;if(n.errors)t=n.matches;else{if(!(null!=(o=r)&&o.v7_partialHydration&&0===e.length&&!n.initialized&&n.matches.length>0))return null;t=n.matches}}let l=t,c=null==(s=n)?void 0:s.errors;if(null!=c){let t=l.findIndex((t=>t.route.id&&void 0!==(null==c?void 0:c[t.route.id])));t>=0||(0,a.Oi)(!1),l=l.slice(0,Math.min(l.length,t+1))}let u=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let t=0;t<l.length;t++){let e=l[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(d=t),e.route.id){let{loaderData:t,errors:i}=n,a=e.route.loader&&void 0===t[e.route.id]&&(!i||void 0===i[e.route.id]);if(e.route.lazy||a){u=!0,l=d>=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((t,a,r)=>{let s,o=!1,p=null,h=null;var m;n&&(s=c&&a.route.id?c[a.route.id]:void 0,p=a.route.errorElement||k,u&&(d<0&&0===r?(_[m="route-fallback"]||(_[m]=!0),o=!0,h=null):d===r&&(o=!0,h=a.route.hydrateFallbackElement||null)));let g=e.concat(l.slice(0,r+1)),f=()=>{let e;return e=s?p:o?h:a.route.Component?i.createElement(a.route.Component,null):a.route.element?a.route.element:t,i.createElement(S,{match:a,routeContext:{outlet:t,matches:g,isDataRoute:null!=n},children:e})};return n&&(a.route.ErrorBoundary||a.route.errorElement||0===r)?i.createElement(b,{location:n.location,revalidation:n.revalidation,component:p,error:s,children:f(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):f()}),null)}(j&&j.map((t=>Object.assign({},t,{params:Object.assign({},g,t.params),pathname:(0,a.HS)([f,o.encodeLocation?o.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?f:(0,a.HS)([f,o.encodeLocation?o.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),d,n,s);return e&&N?i.createElement(c.Provider,{value:{location:r({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:a.rc.Pop}},N):N}function y(){let t=function(){var t;let e=i.useContext(d),n=function(){let t=i.useContext(o);return t||(0,a.Oi)(!1),t}(w.UseRouteError),r=j(w.UseRouteError);return void 0!==e?e:null==(t=n.errors)?void 0:t[r]}(),e=(0,a.pX)(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},e),n?i.createElement("pre",{style:r},n):null,null)}const k=i.createElement(y,null);class b extends i.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||"idle"!==e.revalidation&&"idle"===t.revalidation?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:void 0!==t.error?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){console.error("React Router caught the following error during render",t,e)}render(){return void 0!==this.state.error?i.createElement(u.Provider,{value:this.props.routeContext},i.createElement(d.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function S(t){let{routeContext:e,match:n,children:a}=t,r=i.useContext(s);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),i.createElement(u.Provider,{value:e},a)}var E=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(E||{}),w=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(w||{});function j(t){let e=function(){let t=i.useContext(u);return t||(0,a.Oi)(!1),t}(),n=e.matches[e.matches.length-1];return n.route.id||(0,a.Oi)(!1),n.route.id}const _={},N=(t,e,n)=>{};function C(t,e){void 0===(null==t?void 0:t.v7_startTransition)&&N("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),void 0!==(null==t?void 0:t.v7_relativeSplatPath)||e&&void 0!==e.v7_relativeSplatPath||N("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),e&&(void 0===e.v7_fetcherPersist&&N("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),void 0===e.v7_normalizeFormMethod&&N("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),void 0===e.v7_partialHydration&&N("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),void 0===e.v7_skipActionErrorRevalidation&&N("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function T(t){let{to:e,replace:n,state:r,relative:s}=t;h()||(0,a.Oi)(!1);let{future:o,static:c}=i.useContext(l),{matches:d}=i.useContext(u),{pathname:p}=m(),g=f(),v=(0,a.Gh)(e,(0,a.yD)(d,o.v7_relativeSplatPath),p,"path"===s),x=JSON.stringify(v);return i.useEffect((()=>g(JSON.parse(x),{replace:n,state:r,relative:s})),[g,x,s,n,r]),null}function O(t){(0,a.Oi)(!1)}function R(t){let{basename:e="/",children:n=null,location:s,navigationType:o=a.rc.Pop,navigator:u,static:d=!1,future:p}=t;h()&&(0,a.Oi)(!1);let m=e.replace(/^\/*/,"/"),g=i.useMemo((()=>({basename:m,navigator:u,static:d,future:r({v7_relativeSplatPath:!1},p)})),[m,p,u,d]);"string"==typeof s&&(s=(0,a.Rr)(s));let{pathname:f="/",search:v="",hash:x="",state:y=null,key:k="default"}=s,b=i.useMemo((()=>{let t=(0,a.pb)(f,m);return null==t?null:{location:{pathname:t,search:v,hash:x,state:y,key:k},navigationType:o}}),[m,f,v,x,y,k,o]);return null==b?null:i.createElement(l.Provider,{value:g},i.createElement(c.Provider,{children:n,value:b}))}function P(t){let{children:e,location:n}=t;return x(A(e),n)}function A(t,e){void 0===e&&(e=[]);let n=[];return i.Children.forEach(t,((t,r)=>{if(!i.isValidElement(t))return;let s=[...e,r];if(t.type===i.Fragment)return void n.push.apply(n,A(t.props.children,s));t.type!==O&&(0,a.Oi)(!1),t.props.index&&t.props.children&&(0,a.Oi)(!1);let o={id:t.props.id||s.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(o.children=A(t.props.children,s)),n.push(o)})),n}i.startTransition,new Promise((()=>{})),i.Component},1609:t=>{"use strict";t.exports=window.React},790:t=>{"use strict";t.exports=window.ReactJSXRuntime},6427:t=>{"use strict";t.exports=window.wp.components},6087:t=>{"use strict";t.exports=window.wp.element},7723:t=>{"use strict";t.exports=window.wp.i18n},5573:t=>{"use strict";t.exports=window.wp.primitives},6942:(t,e)=>{var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,r(n)))}return t}function r(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return a.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var n in t)i.call(t,n)&&t[n]&&(e=s(e,n));return e}function s(t,e){return e?t?t+" "+e:t+e:t}t.exports?(a.default=a,t.exports=a):void 0===(n=function(){return a}.apply(e,[]))||(t.exports=n)}()}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>t+".js?ver="+{48:"3def008115a107df0faa",76:"5f882d181b96d2fb95fa",176:"ff335519baeceac089e3",191:"654398285fe6fbe15511",345:"ae99e45c16ee8ee783c2",352:"f332c9f73db9021dd656",389:"6ba637323e640ba9620a",428:"8b7ab28d598fbd00132b",467:"a22f5b744ebb0e465ed1",474:"6b6e408bc946c3aa4102",508:"f802cfb2ce555eb32660",551:"440289ce112c88f5e050",690:"341bb18c92ac2ddea197",761:"fef4161ee83fbba5b826",838:"2d446dee214b69114008",958:"b47178a4b9c14d355e16"}[t],a.miniCssF=t=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="gtm-kit-settings:",a.l=(n,i,r,s)=>{if(t[n])t[n].push(i);else{var o,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==e+r){o=d;break}}o||(l=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-webpack",e+r),o.src=n),t[n]=[i];var p=(e,i)=>{o.onerror=o.onload=null,clearTimeout(h);var a=t[n];if(delete t[n],o.parentNode&&o.parentNode.removeChild(o),a&&a.forEach((t=>t(i))),e)return e(i)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),l&&document.head.appendChild(o)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=n[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{var t={472:0};a.f.j=(e,n)=>{var i=a.o(t,e)?t[e]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise(((n,a)=>i=t[e]=[n,a]));n.push(i[2]=r);var s=a.p+a.u(e),o=new Error;a.l(s,(n=>{if(a.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+s+")",o.name="ChunkLoadError",o.type=r,o.request=s,i[1](o)}}),"chunk-"+e,e)}};var e=(e,n)=>{var i,r,[s,o,l]=n,c=0;if(s.some((e=>0!==t[e]))){for(i in o)a.o(o,i)&&(a.m[i]=o[i]);l&&l(a)}for(e&&e(n);c<s.length;c++)r=s[c],a.o(t,r)&&t[r]&&t[r][0](),t[r]=0},n=globalThis.webpackChunkgtm_kit_settings=globalThis.webpackChunkgtm_kit_settings||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),(()=>{"use strict";var t={};a.r(t);const e=window.ReactDOM;var n=a.n(e),i=a(7723),r=a(6087),s=a(6427),o=a(3951),l=a(282),c=a(9132),u=a(7568),d=a(9730),p=a(790);const h=(0,r.createContext)();let m=1;const g=({children:t})=>{const[e,n]=(0,r.useState)([]),i=(0,r.useCallback)((t=>{n((e=>e.filter((e=>e.id!==t))))}),[]),a=(0,r.useCallback)(((t,e="info",a=3e3)=>{const r=m++,s={id:r,message:t,type:e,duration:a};return n((t=>[...t,s])),a>0&&setTimeout((()=>{i(r)}),a),r}),[i]),s=(0,r.useCallback)(((t,e=3e3)=>a(t,"success",e)),[a]),o=(0,r.useCallback)(((t,e=5e3)=>a(t,"error",e)),[a]),l=(0,r.useCallback)((t=>a(t,"loading",0)),[a]),c=(0,r.useCallback)(((t,e=3e3)=>a(t,"info",e)),[a]),u={toasts:e,addToast:a,removeToast:i,success:s,error:o,loading:l,info:c};return(0,p.jsx)(h.Provider,{value:u,children:t})};var f=a(8621),v=a(7767),x=a(1609),y=a.n(x),k=a(5588);function b(){return b=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},b.apply(this,arguments)}function S(t,e){if(null==t)return{};var n,i,a={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(a[n]=t[n]);return a}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const E=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],w=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"];try{window.__reactRouterVersion="6"}catch(t){}const j=x.createContext({isTransitioning:!1});new Map;const _=x.startTransition;function N(t){let{basename:e,children:n,future:i,window:a}=t,r=x.useRef();null==r.current&&(r.current=(0,k.TM)({window:a,v5Compat:!0}));let s=r.current,[o,l]=x.useState({action:s.action,location:s.location}),{v7_startTransition:c}=i||{},u=x.useCallback((t=>{c&&_?_((()=>l(t))):l(t)}),[l,c]);return x.useLayoutEffect((()=>s.listen(u)),[s,u]),x.useEffect((()=>(0,v.V8)(i)),[i]),x.createElement(v.Ix,{basename:e,children:n,location:o.location,navigationType:o.action,navigator:s,future:i})}e.flushSync,x.useId;const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,O=x.forwardRef((function(t,e){let n,{onClick:i,relative:a,reloadDocument:r,replace:s,state:o,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,p=S(t,E),{basename:h}=x.useContext(v.jb),m=!1;if("string"==typeof c&&T.test(c)&&(n=c,C))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=(0,k.pb)(e.pathname,h);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:m=!0}catch(t){}let g=(0,v.$P)(c,{relative:a}),f=function(t,e){let{target:n,replace:i,state:a,preventScrollReset:r,relative:s,viewTransition:o}=void 0===e?{}:e,l=(0,v.Zp)(),c=(0,v.zy)(),u=(0,v.x$)(t,{relative:s});return x.useCallback((e=>{if(function(t,e){return!(0!==t.button||e&&"_self"!==e||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t))}(e,n)){e.preventDefault();let n=void 0!==i?i:(0,k.AO)(c)===(0,k.AO)(u);l(t,{replace:n,state:a,preventScrollReset:r,relative:s,viewTransition:o})}}),[c,l,u,i,a,n,t,r,s,o])}(c,{replace:s,state:o,target:l,preventScrollReset:u,relative:a,viewTransition:d});return x.createElement("a",b({},p,{href:n||g,onClick:m||r?i:function(t){i&&i(t),t.defaultPrevented||f(t)},ref:e,target:l}))})),R=x.forwardRef((function(t,e){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:r=!1,style:s,to:o,viewTransition:l,children:c}=t,u=S(t,w),d=(0,v.x$)(o,{relative:u.relative}),p=(0,v.zy)(),h=x.useContext(v.Rq),{navigator:m,basename:g}=x.useContext(v.jb),f=null!=h&&function(t,e){void 0===e&&(e={});let n=x.useContext(j);null==n&&(0,k.Oi)(!1);let{basename:i}=function(){let t=x.useContext(v.sp);return t||(0,k.Oi)(!1),t}(P.useViewTransitionState),a=(0,v.x$)(t,{relative:e.relative});if(!n.isTransitioning)return!1;let r=(0,k.pb)(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=(0,k.pb)(n.nextLocation.pathname,i)||n.nextLocation.pathname;return null!=(0,k.B6)(a.pathname,s)||null!=(0,k.B6)(a.pathname,r)}(d)&&!0===l,y=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,E=p.pathname,_=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;i||(E=E.toLowerCase(),_=_?_.toLowerCase():null,y=y.toLowerCase()),_&&g&&(_=(0,k.pb)(_,g)||_);const N="/"!==y&&y.endsWith("/")?y.length-1:y.length;let C,T=E===y||!r&&E.startsWith(y)&&"/"===E.charAt(N),R=null!=_&&(_===y||!r&&_.startsWith(y)&&"/"===_.charAt(y.length)),A={isActive:T,isPending:R,isTransitioning:f},D=T?n:void 0;C="function"==typeof a?a(A):[a,T?"active":null,R?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let L="function"==typeof s?s(A):s;return x.createElement(O,b({},u,{"aria-current":D,className:C,ref:e,style:L,to:o,viewTransition:l}),"function"==typeof c?c(A):c)}));var P,A;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(P||(P={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(A||(A={}));const D=({title:t})=>(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("header",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-sticky",children:(0,p.jsx)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between",children:(0,p.jsxs)("h1",{className:"gtmkit-flex gtmkit-items-center gtmkit-font-medium gtmkit-text-3xl",children:[(0,p.jsxs)("svg",{className:"gtmkit-mr-8",height:"44",viewBox:"0 0 160 54",width:"128",xmlns:"http://www.w3.org/2000/svg",children:[(0,p.jsx)("rect",{fill:"#888",height:"54",rx:"4.265",width:"160"}),(0,p.jsx)("path",{d:"m88.659 7.002h-49.266c-2.915 0-5.378-.184-9.23 2.596l-18.743 12.752c-4.549 3.292-4.571 6.001 0 9.302l18.743 12.751c3.652 2.646 6.299 2.597 9.23 2.597h15.686 33.58c2.931-.057 5.394-1.784 5.34-3.923v-32.21c-.012-2.134-2.409-3.865-5.34-3.865z",fill:"#3969bb",transform:"matrix(-1 0 0 -1 101.999867 53.999547)"}),(0,p.jsxs)("g",{fill:"#fff",transform:"matrix(1.465202 0 0 1.465202 -4.582436 -7.553126)",children:[(0,p.jsx)("path",{d:"m18.316 23.086h4.632v6.052c-.75.245-1.459.415-2.121.514-.663.098-1.341.148-2.033.148-1.764 0-3.106-.517-4.035-1.554-.929-1.034-1.395-2.519-1.395-4.457 0-1.886.538-3.356 1.617-4.41 1.078-1.054 2.573-1.579 4.481-1.579 1.2 0 2.357.239 3.469.718l-.823 1.979c-.85-.425-1.737-.637-2.657-.637-1.071 0-1.932.358-2.572 1.077-.645.718-.968 1.685-.968 2.899 0 1.267.26 2.233.78 2.904.516.667 1.271.999 2.262.999.517 0 1.041-.052 1.572-.158v-2.435h-2.209zm11.912 6.555h-2.474v-9.614h-3.173v-2.06h8.816v2.06h-3.169zm9.908 0-2.811-9.158h-.072c.103 1.863.154 3.105.154 3.728v5.43h-2.213v-11.674h3.368l2.764 8.927h.048l2.934-8.927h3.369v11.674h-2.308v-5.525c0-.261 0-.561.009-.903.009-.341.048-1.246.112-2.716h-.074l-3.011 9.144z"}),(0,p.jsx)("path",{d:"m88.883 31.898h-3.811l-4.147-6.67-1.417 1.018v5.652h-3.357v-15.83h3.357v7.242l1.318-1.861 4.293-5.381h3.724l-5.523 7.006zm1.589-15.233c0-1.075.6-1.614 1.8-1.614 1.199 0 1.798.539 1.798 1.614 0 .512-.148.91-.45 1.196-.297.284-.749.429-1.348.429-1.2 0-1.8-.543-1.8-1.625zm3.449 15.233h-3.302v-12.104h3.302zm8.563-2.413c.578 0 1.271-.128 2.077-.38v2.456c-.82.37-1.831.552-3.031.552-1.324 0-2.28-.333-2.885-1.001-.602-.667-.902-1.668-.902-3.003v-5.835h-1.585v-1.399l1.823-1.103.949-2.557h2.115v2.579h3.388v2.48h-3.388v5.835c0 .467.129.815.393 1.041.264.222.614.335 1.046.335z"})]})]}),t]})})})});var L=a(4277);const I={general:()=>a.e(191).then(a.bind(a,5191)),container:()=>a.e(508).then(a.bind(a,7508)),"post-data":()=>a.e(958).then(a.bind(a,9958)),"user-data":()=>a.e(389).then(a.bind(a,7389)),"google-consent-mode":()=>a.e(551).then(a.bind(a,6551)),misc:()=>a.e(761).then(a.bind(a,1761)),integrations:()=>a.e(352).then(a.bind(a,2352)),woocommerce:()=>a.e(690).then(a.bind(a,7690)),cf7:()=>a.e(345).then(a.bind(a,3345)),edd:()=>a.e(76).then(a.bind(a,2076)),"integrations-section":()=>a.e(838).then(a.bind(a,6838)),notifications:()=>a.e(467).then(a.bind(a,2467)),upgrades:()=>a.e(474).then(a.bind(a,4474)),templates:()=>a.e(176).then(a.bind(a,1176)),help:()=>a.e(48).then(a.bind(a,9048)),support:()=>a.e(428).then(a.bind(a,5428))},U=new Set,M=(0,r.memo)((({to:t,title:e})=>{const{useNotifications:n}=(0,r.useContext)(l.V2);return(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)(R,{to:t,onMouseEnter:()=>{(t=>{const e=t.startsWith("/")?t.slice(1):t;if(U.has(e))return null;const n=I[e];n&&(U.add(e),n())})(t)},className:({isActive:t})=>"gtmkit-border-b-4 gtmkit-border-white gtmkit-text-color-grey gtmkit-font-semibold gtmkit-pt-5 gtmkit-pb-[18px] hover:gtmkit-border-color-grey "+(t?"gtmkit-text-color-heading gtmkit-border-b-color-primary ":""),children:[e,"notifications"===t&&(0,p.jsx)(L.v,{metrics:n.metrics})]})})})),z=(0,r.memo)((({NavList:t})=>(0,p.jsx)("nav",{className:"gtmkit-flex gtmkit-flex-wrap gtmkit-items-center gtmkit-px-8 gtmkit-border-y gtmkit-bg-white gtmkit-border-color-border gtmkit-text-[15px] gtmkit-space-x-9",children:t.map((function(t){return(0,p.jsx)(M,{to:t.to,title:t.title},t.to)}))})));function K(){return K=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},K.apply(null,arguments)}function $(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;n[i]=t[i]}return n}function B(t,e){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},B(t,e)}function F(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,B(t,e)}function V(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const G=y().createContext(null);var q=function(t){return t.scrollTop},W="unmounted",H="exited",J="entering",Z="entered",X="exiting",Y=function(t){function e(e,n){var i;i=t.call(this,e,n)||this;var a,r=n&&!n.isMounting?e.enter:e.appear;return i.appearStatus=null,e.in?r?(a=H,i.appearStatus=J):a=Z:a=e.unmountOnExit||e.mountOnEnter?W:H,i.state={status:a},i.nextCallback=null,i}F(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===W?{status:H}:null};var i=e.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==J&&n!==Z&&(e=J):n!==J&&n!==Z||(e=X)}this.updateStatus(!1,e)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var t,e,n,i=this.props.timeout;return t=e=n=i,null!=i&&"number"!=typeof i&&(t=i.exit,e=i.enter,n=void 0!==i.appear?i.appear:e),{exit:t,enter:e,appear:n}},i.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===J){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:n().findDOMNode(this);i&&q(i)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===H&&this.setState({status:W})},i.performEnter=function(t){var e=this,i=this.props.enter,a=this.context?this.context.isMounting:t,r=this.props.nodeRef?[a]:[n().findDOMNode(this),a],s=r[0],o=r[1],l=this.getTimeouts(),c=a?l.appear:l.enter;t||i?(this.props.onEnter(s,o),this.safeSetState({status:J},(function(){e.props.onEntering(s,o),e.onTransitionEnd(c,(function(){e.safeSetState({status:Z},(function(){e.props.onEntered(s,o)}))}))}))):this.safeSetState({status:Z},(function(){e.props.onEntered(s)}))},i.performExit=function(){var t=this,e=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:n().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:X},(function(){t.props.onExiting(a),t.onTransitionEnd(i.exit,(function(){t.safeSetState({status:H},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:H},(function(){t.props.onExited(a)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},i.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,e.nextCallback=null,t(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},i.onTransitionEnd=function(t,e){this.setNextCallback(e);var i=this.props.nodeRef?this.props.nodeRef.current:n().findDOMNode(this),a=null==t&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],s=r[0],o=r[1];this.props.addEndListener(s,o)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},i.render=function(){var t=this.state.status;if(t===W)return null;var e=this.props,n=e.children,i=(e.in,e.mountOnEnter,e.unmountOnExit,e.appear,e.enter,e.exit,e.timeout,e.addEndListener,e.onEnter,e.onEntering,e.onEntered,e.onExit,e.onExiting,e.onExited,e.nodeRef,$(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return y().createElement(G.Provider,{value:null},"function"==typeof n?n(t,i):y().cloneElement(y().Children.only(n),i))},e}(y().Component);function Q(){}Y.contextType=G,Y.propTypes={},Y.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Q,onEntering:Q,onEntered:Q,onExit:Q,onExiting:Q,onExited:Q},Y.UNMOUNTED=W,Y.EXITED=H,Y.ENTERING=J,Y.ENTERED=Z,Y.EXITING=X;const tt=Y;var et=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return i=e,void((n=t).classList?n.classList.remove(i):"string"==typeof n.className?n.className=V(n.className,i):n.setAttribute("class",V(n.className&&n.className.baseVal||"",i)));var n,i}))},nt=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(t,n){var i=e.resolveArguments(t,n),a=i[0],r=i[1];e.removeClasses(a,"exit"),e.addClass(a,r?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(t,n)},e.onEntering=function(t,n){var i=e.resolveArguments(t,n),a=i[0],r=i[1]?"appear":"enter";e.addClass(a,r,"active"),e.props.onEntering&&e.props.onEntering(t,n)},e.onEntered=function(t,n){var i=e.resolveArguments(t,n),a=i[0],r=i[1]?"appear":"enter";e.removeClasses(a,r),e.addClass(a,r,"done"),e.props.onEntered&&e.props.onEntered(t,n)},e.onExit=function(t){var n=e.resolveArguments(t)[0];e.removeClasses(n,"appear"),e.removeClasses(n,"enter"),e.addClass(n,"exit","base"),e.props.onExit&&e.props.onExit(t)},e.onExiting=function(t){var n=e.resolveArguments(t)[0];e.addClass(n,"exit","active"),e.props.onExiting&&e.props.onExiting(t)},e.onExited=function(t){var n=e.resolveArguments(t)[0];e.removeClasses(n,"exit"),e.addClass(n,"exit","done"),e.props.onExited&&e.props.onExited(t)},e.resolveArguments=function(t,n){return e.props.nodeRef?[e.props.nodeRef.current,t]:[t,n]},e.getClassNames=function(t){var n=e.props.classNames,i="string"==typeof n,a=i?(i&&n?n+"-":"")+t:n[t];return{baseClassName:a,activeClassName:i?a+"-active":n[t+"Active"],doneClassName:i?a+"-done":n[t+"Done"]}},e}F(e,t);var n=e.prototype;return n.addClass=function(t,e,n){var i=this.getClassNames(e)[n+"ClassName"],a=this.getClassNames("enter").doneClassName;"appear"===e&&"done"===n&&a&&(i+=" "+a),"active"===n&&t&&q(t),i&&(this.appliedClasses[e][n]=i,function(t,e){t&&e&&e.split(" ").forEach((function(e){return i=e,void((n=t).classList?n.classList.add(i):function(t,e){return t.classList?!!e&&t.classList.contains(e):-1!==(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i}))}(t,i))},n.removeClasses=function(t,e){var n=this.appliedClasses[e],i=n.base,a=n.active,r=n.done;this.appliedClasses[e]={},i&&et(t,i),a&&et(t,a),r&&et(t,r)},n.render=function(){var t=this.props,e=(t.classNames,$(t,["classNames"]));return y().createElement(tt,K({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(y().Component);nt.defaultProps={classNames:""},nt.propTypes={};const it=nt,at=(0,r.memo)((({title:t=(0,i.__)("Save","gtm-kit"),className:e="gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-4 !gtmkit-px-6 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey"})=>{const{updateSettings:n,isPending:a,canSave:l}=(0,r.useContext)(o.ph);return(0,p.jsxs)(s.Button,{className:e,onClick:()=>n(),variant:"primary",disabled:a||!l,children:[l?t:(0,i.__)("Saved","gtm-kit"),a?(0,p.jsx)(s.Spinner,{}):""]})})),rt=()=>{const{canSave:t}=(0,r.useContext)(o.ph);return(0,p.jsx)(it,{in:t,timeout:500,classNames:"slide",unmountOnExit:!0,children:(0,p.jsx)("footer",{className:"gtmkit-fixed gtmkit-bottom-0 gtmkit-w-full gtmkit-z-10 gtmkit-bg-color-grey gtmkit-text-white gtmkit-p-8",children:(0,p.jsx)(at,{})})})};var st=a(7398);const ot=window.wp.plugins;class lt extends r.Component{constructor(t){super(t),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,e){this.setState({error:t,errorInfo:e})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null}),this.props.reloadOnReset&&window.location.reload()};render(){return this.state.hasError?(0,p.jsxs)("div",{className:"gtmkit-error-boundary gtmkit-p-8 gtmkit-bg-red-50 gtmkit-border gtmkit-border-red-200 gtmkit-rounded-lg gtmkit-max-w-4xl gtmkit-mx-auto gtmkit-my-8",children:[(0,p.jsx)("h2",{className:"gtmkit-text-xl gtmkit-font-bold gtmkit-text-red-600 gtmkit-mb-4",children:this.props.title||(0,i.__)("Something went wrong","gtm-kit")}),(0,p.jsx)("p",{className:"gtmkit-mb-4 gtmkit-text-gray-700",children:this.props.message||(0,i.__)("An unexpected error occurred. Please try refreshing the page.","gtm-kit")}),!1,(0,p.jsxs)("div",{className:"gtmkit-flex gtmkit-gap-4",children:[(0,p.jsx)("button",{onClick:this.handleReset,className:"gtmkit-px-4 gtmkit-py-2 gtmkit-bg-red-600 gtmkit-text-white gtmkit-rounded hover:gtmkit-bg-red-700 gtmkit-transition-colors",children:(0,i.__)("Try Again","gtm-kit")}),(0,p.jsx)("button",{onClick:()=>window.location.reload(),className:"gtmkit-px-4 gtmkit-py-2 gtmkit-bg-gray-600 gtmkit-text-white gtmkit-rounded hover:gtmkit-bg-gray-700 gtmkit-transition-colors",children:(0,i.__)("Reload Page","gtm-kit")})]})]}):this.props.children}}const ct=lt,ut=({children:t,sectionName:e})=>{const n=e?`${e} - ${(0,i.__)("Section Error","gtm-kit")}`:(0,i.__)("Section Error","gtm-kit"),a=e?`${(0,i.__)("The","gtm-kit")} "${e}" ${(0,i.__)("section encountered an error. Other sections may still work normally.","gtm-kit")}`:(0,i.__)("This section encountered an error. Other sections may still work normally.","gtm-kit");return(0,p.jsx)(ct,{title:n,message:a,children:t})};var dt=a(6942),pt=a.n(dt);const ht=(0,r.memo)((({className:t="",width:e,height:n,circle:i=!1})=>{const a=i?"gtmkit-rounded-full":"",r={width:e||"100%",height:n||"1rem"};return(0,p.jsx)("div",{className:pt()("gtmkit-animate-pulse gtmkit-bg-color-border gtmkit-rounded",a,t),style:r,"aria-hidden":"true"})})),mt=(0,r.memo)((({lines:t=3})=>(0,p.jsx)("div",{className:"gtmkit-space-y-2",children:Array.from({length:t},((e,n)=>(0,p.jsx)(ht,{height:"1rem",width:n===t-1?"70%":"100%"},n)))}))),gt=(0,r.memo)((()=>(0,p.jsxs)("div",{className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-max-w-screen-lg gtmkit-border-color-grey gtmkit-rounded",children:[(0,p.jsx)("div",{className:"gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey",children:(0,p.jsx)(ht,{height:"1.5rem",width:"200px"})}),(0,p.jsxs)("div",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-space-y-4",children:[(0,p.jsx)(mt,{lines:2}),(0,p.jsx)(ht,{height:"2.5rem",width:"300px"})]})]}))),ft=((0,r.memo)((()=>(0,p.jsxs)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4",children:[(0,p.jsx)(ht,{height:"1.25rem",width:"150px",className:"gtmkit-mb-2"}),(0,p.jsx)(ht,{height:"2.5rem",width:"100%"})]}))),(0,r.memo)((()=>(0,p.jsxs)("div",{className:"gtmkit-flex gtmkit-flex-col gtmkit-min-h-[128px] gtmkit-bg-white gtmkit-border gtmkit-border-color-border gtmkit-mb-6 gtmkit-py-4 gtmkit-px-5 gtmkit-rounded",children:[(0,p.jsxs)("div",{className:"gtmkit-flex gtmkit-justify-between gtmkit-items-center gtmkit-mb-5",children:[(0,p.jsx)(ht,{height:"2rem",width:"200px"}),(0,p.jsx)(ht,{height:"1.5rem",width:"60px",circle:!1})]}),(0,p.jsx)("div",{className:"gtmkit-flex-auto gtmkit-mb-4",children:(0,p.jsx)(mt,{lines:2})}),(0,p.jsx)(ht,{height:"3rem",width:"225px"})]}))),(0,r.memo)((({sections:t=3,showTitle:e=!0})=>(0,p.jsxs)("div",{children:[e&&(0,p.jsx)("div",{className:"gtmkit-mb-8",style:{height:"2rem"},"aria-hidden":"true"}),Array.from({length:t},((t,e)=>(0,p.jsx)(gt,{},e)))]}))));(0,r.memo)((({count:t=3})=>(0,p.jsx)("div",{className:"gtmkit-space-y-4",children:Array.from({length:t},((t,e)=>(0,p.jsxs)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between gtmkit-border-2 gtmkit-px-4 gtmkit-py-3",children:[(0,p.jsxs)("div",{className:"gtmkit-flex-1",children:[(0,p.jsx)(ht,{height:"1.25rem",width:"150px"}),(0,p.jsx)(ht,{height:"1rem",width:"80%",className:"gtmkit-mt-2"})]}),(0,p.jsx)(ht,{height:"2rem",width:"80px"})]},e)))})));var vt=a(7677),xt=a(5573),yt=(0,p.jsx)(xt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(xt.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})}),kt=(0,p.jsx)(xt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)(xt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),bt=(0,p.jsx)(xt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,p.jsx)(xt.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});const St=(0,r.memo)((({message:e,type:n="info",onClose:i=null,duration:a=0})=>(a>0&&i&&setTimeout(i,a),(0,p.jsxs)("div",{className:pt()("gtmkit-fixed gtmkit-bottom-8 gtmkit-right-8 gtmkit-z-50 gtmkit-flex gtmkit-items-center gtmkit-gap-3 gtmkit-px-4 gtmkit-py-3 gtmkit-rounded-lg gtmkit-shadow-lg gtmkit-min-w-[300px] gtmkit-max-w-md gtmkit-animate-slide-up",{info:"gtmkit-bg-blue-50 gtmkit-text-blue-900 gtmkit-border gtmkit-border-blue-200",success:"gtmkit-bg-green-50 gtmkit-text-green-900 gtmkit-border gtmkit-border-green-200",error:"gtmkit-bg-red-50 gtmkit-text-red-900 gtmkit-border gtmkit-border-red-200",loading:"gtmkit-bg-gray-50 gtmkit-text-gray-900 gtmkit-border gtmkit-border-gray-200"}[n]),children:[(0,p.jsx)("div",{className:"gtmkit-flex-shrink-0",children:(()=>{switch(n){case"success":return(0,p.jsx)(vt.A,{icon:yt});case"error":return(0,p.jsx)(vt.A,{icon:t.warning});case"loading":return(0,p.jsx)(s.Spinner,{});default:return(0,p.jsx)(vt.A,{icon:kt})}})()}),(0,p.jsx)("div",{className:"gtmkit-flex-grow gtmkit-text-sm gtmkit-font-medium",children:e}),i&&(0,p.jsx)("button",{onClick:i,className:"gtmkit-flex-shrink-0 gtmkit-p-1 gtmkit-rounded gtmkit-hover:bg-black gtmkit-hover:bg-opacity-10 gtmkit-transition-colors","aria-label":"Close",children:(0,p.jsx)(vt.A,{icon:bt,size:20})})]}))));St.displayName="Toast";const Et=(0,r.memo)((({toasts:t=[]})=>t.length?(0,p.jsx)("div",{className:"gtmkit-fixed gtmkit-bottom-0 gtmkit-right-0 gtmkit-p-8 gtmkit-z-50 gtmkit-pointer-events-none",children:(0,p.jsx)("div",{className:"gtmkit-space-y-2",children:t.map((t=>(0,p.jsx)("div",{className:"gtmkit-pointer-events-auto",children:(0,p.jsx)(St,{...t})},t.id)))})}):null));Et.displayName="ToastContainer";const wt=(0,r.lazy)((()=>a.e(191).then(a.bind(a,5191)))),jt=(0,r.lazy)((()=>a.e(508).then(a.bind(a,7508)))),_t=(0,r.lazy)((()=>a.e(958).then(a.bind(a,9958)))),Nt=(0,r.lazy)((()=>a.e(389).then(a.bind(a,7389)))),Ct=(0,r.lazy)((()=>a.e(551).then(a.bind(a,6551)))),Tt=(0,r.lazy)((()=>a.e(761).then(a.bind(a,1761)))),Ot=(0,r.lazy)((()=>a.e(352).then(a.bind(a,2352)))),Rt=(0,r.lazy)((()=>a.e(690).then(a.bind(a,7690)))),Pt=(0,r.lazy)((()=>a.e(345).then(a.bind(a,3345)))),At=(0,r.lazy)((()=>a.e(76).then(a.bind(a,2076)))),Dt=(0,r.lazy)((()=>a.e(176).then(a.bind(a,1176)))),Lt=(0,r.lazy)((()=>a.e(48).then(a.bind(a,9048)))),It=(0,r.lazy)((()=>a.e(428).then(a.bind(a,5428)))),Ut=(0,r.lazy)((()=>a.e(838).then(a.bind(a,6838)))),Mt=(0,r.lazy)((()=>a.e(467).then(a.bind(a,2467)))),zt=(0,r.lazy)((()=>a.e(474).then(a.bind(a,4474)))),Kt={integrations:(0,i.__)("Integrations","gtm-kit"),templates:(0,i.__)("Google Tag Manager Templates","gtm-kit"),help:(0,i.__)("Help","gtm-kit")},$t=()=>{const{useSettings:t}=(0,r.useContext)(o.ph),{toasts:e}=(0,r.useContext)(h),n=f.A.getCurrentPage(),a=function({page:t}){switch(t){case"general":return[{to:"general",title:(0,i.__)("Dashboard","gtm-kit")},{to:"container",title:(0,i.__)("Container","gtm-kit")},{to:"post-data",title:(0,i.__)("Post data","gtm-kit")},{to:"user-data",title:(0,i.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,i.__)("Google Consent Mode","gtm-kit")},{to:"notifications",title:(0,i.__)("Notifications","gtm-kit")},{to:"misc",title:(0,i.__)("Misc","gtm-kit")}];case"integrations":return[{to:"integrations",title:(0,i.__)("Integrations","gtm-kit")},...(0,st.n)("integrations")];case"upgrades":return[{to:"upgrades",title:(0,i.__)("Upgrades","gtm-kit")}];case"templates":return[{to:"templates",title:(0,i.__)("Templates","gtm-kit")}];case"help":return[{to:"help",title:(0,i.__)("Help","gtm-kit")},{to:"support",title:(0,i.__)("Support","gtm-kit")}]}}({page:n}),l=f.A.getTemplates(),c=f.A.getRaw("integrations"),u=Kt[n]||(0,i.__)("Settings","gtm-kit");return Object.keys(t).length?(0,p.jsxs)(s.SlotFillProvider,{children:[(0,p.jsx)(D,{title:u}),(0,p.jsx)(z,{NavList:a}),(0,p.jsx)("main",{className:"gtmkit-max-w-[1536px] gtmkit-px-8 gtmkit-pt-8 gtmkit-text-base",children:(0,p.jsx)(r.Suspense,{fallback:(0,p.jsx)(ft,{sections:2}),children:(0,p.jsxs)(v.BV,{children:[(0,p.jsx)(v.qh,{exact:!0,path:"/general",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("General","gtm-kit"),children:(0,p.jsx)(wt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/container",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Container Settings","gtm-kit"),children:(0,p.jsx)(jt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/post-data",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Post Data","gtm-kit"),children:(0,p.jsx)(_t,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/user-data",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("User Data","gtm-kit"),children:(0,p.jsx)(Nt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/google-consent-mode",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Google Consent Mode","gtm-kit"),children:(0,p.jsx)(Ct,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/notifications",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Notifications","gtm-kit"),children:(0,p.jsx)(Mt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/misc",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Miscellaneous","gtm-kit"),children:(0,p.jsx)(Tt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/integrations",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Integrations","gtm-kit"),children:(0,p.jsx)(Ot,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/woocommerce",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("WooCommerce","gtm-kit"),children:(0,p.jsx)(Rt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/cf7",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Contact Form 7","gtm-kit"),children:(0,p.jsx)(Pt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/edd",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Easy Digital Downloads","gtm-kit"),children:(0,p.jsx)(At,{})})}),c&&Object.keys(c).map((function(t){return"add-on"===c[t].type?(0,p.jsx)(v.qh,{exact:!0,path:t,element:(0,p.jsx)(ut,{sectionName:c[t].title,children:(0,p.jsx)(Ut,{integrationID:t,pluginName:c[t].title})})},t):null})),(0,p.jsx)(v.qh,{exact:!0,path:"/upgrades",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Upgrades","gtm-kit"),children:(0,p.jsx)(zt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/templates",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Templates","gtm-kit"),children:(0,p.jsx)(Dt,{templateData:l})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/help",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Help","gtm-kit"),children:(0,p.jsx)(Lt,{})})}),(0,p.jsx)(v.qh,{exact:!0,path:"/support",element:(0,p.jsx)(ut,{sectionName:(0,i.__)("Support","gtm-kit"),children:(0,p.jsx)(It,{})})}),(0,p.jsx)(v.qh,{path:"/",element:(0,p.jsx)(v.C5,{replace:!0,to:"/"+n})})]})})}),(0,p.jsx)(rt,{}),(0,p.jsx)(ot.PluginArea,{}),(0,p.jsx)(Et,{toasts:e})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(D,{title:u}),(0,p.jsx)(z,{NavList:a}),(0,p.jsx)("main",{className:"gtmkit-max-w-[1536px] gtmkit-px-8 gtmkit-pt-8 gtmkit-text-base",children:(0,p.jsx)(ft,{sections:2})}),(0,p.jsx)(rt,{})]})},Bt=()=>(0,p.jsx)(N,{basename:"/",children:(0,p.jsx)(g,{children:(0,p.jsx)(o.xi,{children:(0,p.jsx)(l.ph,{children:(0,p.jsx)(c.t,{children:(0,p.jsx)(u.p,{children:(0,p.jsx)(d.hh,{children:(0,p.jsx)($t,{})})})})})})})});document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(f.A.getRootId());null!=t&&(0,e.createRoot)(t).render((0,p.jsx)(Bt,{}))}))})()})();