Plugin Directory

Changeset 3032523


Ignore:
Timestamp:
02/07/2024 06:59:42 AM (2 years ago)
Author:
tlamedia
Message:

Update to version 1.19 from GitHub

Location:
gtm-kit
Files:
30 edited
1 copied

Legend:

Unmodified
Added
Removed
  • gtm-kit/tags/1.19/assets/admin/settings.asset.php

    r3016305 r3032523  
    1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'a1f5a87986f782e4c463');
     1<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'f2be2b3e6277da2304eb');
  • gtm-kit/tags/1.19/assets/admin/settings.js

    r3016305 r3032523  
    1 !function(){"use strict";var t={n:function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},d:function(e,n){for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e=window.React,n=t.n(e),a=window.wp.i18n,i=window.wp.element,r=window.wp.components,o=window.lodash,l=window.wp.apiFetch,s=t.n(l);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const m=async(t,e,n=null,a=!1)=>{let i={};try{i=await s()({path:t,method:e,...n&&{data:n}})}catch(n){return console.log(`${e} ${t} Errors:`,n),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===a?i:!0===i.success?i.data:options};var c=(t,e)=>{const n={...t};switch(e.type){case"FETCH_SETTINGS":n.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},n.stateSettings=e.payload.stateSettings,n.siteData=e.payload.siteData,n.installData=e.payload.installData,n.isPending=!1,n.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(n.notice=(0,a.__)("An error occurred.","gtm-kit"),n.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":n.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":n.fetchedSettings=e.payload.fetchedSettings,n.stateSettings=e.payload.stateSettings,n.isPending=!1,n.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,n.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,a.__)("An error occurred.","gtm-kit"):(0,a.__)("Saved Successfully.","gtm-kit"),n.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":n.fetchedSettings=e.payload.fetchedSettings||n.fetchedSettings,n.stateSettings=e.payload.stateSettings||n.stateSettings,n.isPending=e.payload.isPending||n.isPending,n.notice=e.payload.notice||n.notice,n.hasError=e.payload.hasError||n.hasError,n.canSave=e.payload.canSave||n.canSave,n.isSendingSystemData=e.payload.isSendingSystemData||n.isSendingSystemData,n.supportTicket=e.payload.supportTicket||n.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":n.isSendingSystemData=e.payload.isSendingSystemData||n.isSendingSystemData;break;case"SEND_SUPPORT_DATA":n.isSendingSystemData=!1,n.isSystemDataSent=e.payload.isSystemDataSent||n.isSystemDataSent,n.systemDataMessage=e.payload.systemDataMessage||n.systemDataMessage}return n};const u=(0,i.createContext)();var g,d=t=>{const[n,a]=(0,i.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),r=async()=>{const[t,e]=await Promise.all([m("gtmkit/v1/get-options","GET"),m("gtmkit/v1/get-site-data","GET")]),n="wizard"===window.gtmkitSettings.currentPage?await m("gtmkit/v1/get-install-data","GET"):{};a({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:n}})},l=async t=>{a({type:"UPDATE_STATE",payload:t})};(0,i.useEffect)((()=>{r()}),[]);const s={useDispatch:t=>{a(t)},useUpdateSettings:async()=>{a({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,m("gtmkit/v1/set-options","POST",e));var e;a({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:r,useUpdateState:l,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let r;i[t][e]=a,r=!(0,o.isEqual)(i,n.fetchedSettings),l({stateSettings:i,canSave:r})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const r={};r.general={...a.general,...e.general},"integrations"in e&&(r.integrations={...a.integrations,...e.integrations}),i=!(0,o.isEqual)(r,n.fetchedSettings),l({stateSettings:r,canSave:i})},useUpdateSupportTicket:async t=>{l({supportTicket:t})},useSendSystemData:async()=>{a({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,m("gtmkit/v1/send-support-data","POST",e,!0));var e;a({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData,useIsSending:n.isSendingSystemData,useSupportTicket:n.supportTicket,useIsSystemDataSent:n.isSystemDataSent,useSystemDataMessage:n.systemDataMessage};return(0,e.createElement)(u.Provider,{value:s},t.children)};function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},p.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(g||(g={}));const h="popstate";function _(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function f(t,e){return{usr:t.state,key:t.key,idx:e}}function E(t,e,n,a){return void 0===n&&(n=null),p({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?b(e):e,{state:n,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function v(t){let{pathname:e="/",search:n="",hash:a=""}=t;return n&&"?"!==n&&(e+="?"===n.charAt(0)?n:"?"+n),a&&"#"!==a&&(e+="#"===a.charAt(0)?a:"#"+a),e}function b(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let a=t.indexOf("?");a>=0&&(e.search=t.substr(a),t=t.substr(0,a)),t&&(e.pathname=t)}return e}var y;function x(t,e,n){void 0===n&&(n="/");let a=A(("string"==typeof e?b(e):e).pathname||"/",n);if(null==a)return null;let i=S(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)))))}(i);let r=null;for(let t=0;null==r&&t<i.length;++t)r=O(i[t],U(a));return r}function S(t,e,n,a){void 0===e&&(e=[]),void 0===n&&(n=[]),void 0===a&&(a="");let i=(t,i,r)=>{let o={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};o.relativePath.startsWith("/")&&(_(o.relativePath.startsWith(a),'Absolute route path "'+o.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(a.length));let l=H([a,o.relativePath]),s=n.concat(o);t.children&&t.children.length>0&&(_(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),S(t.children,e,s,l)),(null!=t.path||t.index)&&e.push({path:l,score:M(l,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var n;if(""!==t.path&&null!=(n=t.path)&&n.includes("?"))for(let n of w(t.path))i(t,e,n);else i(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[n,...a]=e,i=n.endsWith("?"),r=n.replace(/\?$/,"");if(0===a.length)return i?[r,""]:[r];let o=w(a.join("/")),l=[];return l.push(...o.map((t=>""===t?r:[r,t].join("/")))),i&&l.push(...o),l.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(y||(y={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const N=/^:\w+$/,C=3,T=2,D=1,G=10,P=-2,I=t=>"*"===t;function M(t,e){let n=t.split("/"),a=n.length;return n.some(I)&&(a+=P),e&&(a+=T),n.filter((t=>!I(t))).reduce(((t,e)=>t+(N.test(e)?C:""===e?D:G)),a)}function O(t,e){let{routesMeta:n}=t,a={},i="/",r=[];for(let t=0;t<n.length;++t){let o=n[t],l=t===n.length-1,s="/"===i?e:e.slice(i.length)||"/",m=R({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},s);if(!m)return null;Object.assign(a,m.params);let c=o.route;r.push({params:a,pathname:H([i,m.pathname]),pathnameBase:B(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function R(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[n,a]=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),k("*"===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 a=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,n)=>(a.push({paramName:e,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(a.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),a]}(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let r=i[0],o=r.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:a.reduce(((t,e,n)=>{let{paramName:a,isOptional:i}=e;if("*"===a){let t=l[n]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const s=l[n];return t[a]=i&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(n){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),t}}(s||"",a),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function U(t){try{return decodeURI(t)}catch(e){return k(!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 A(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,a=t.charAt(n);return a&&"/"!==a?null:t.slice(n)||"/"}function L(t,e,n,a){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(a)+"].  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 F(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(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)):n.map((t=>t.pathnameBase))}function j(t,e,n,a){let i;void 0===a&&(a=!1),"string"==typeof t?i=b(t):(i=p({},t),_(!i.pathname||!i.pathname.includes("?"),L("?","pathname","search",i)),_(!i.pathname||!i.pathname.includes("#"),L("#","pathname","hash",i)),_(!i.search||!i.search.includes("#"),L("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(null==l)r=n;else if(a){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t.pop();i.pathname=e.join("/")}r="/"+t.join("/")}else{let t=e.length-1;if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t-=1;i.pathname=e.join("/")}r=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:n,search:a="",hash:i=""}="string"==typeof t?b(t):t,r=n?n.startsWith("/")?n:function(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("/"):"/"}(n,e):e;return{pathname:r,search:W(a),hash:K(i)}}(i,r),m=l&&"/"!==l&&l.endsWith("/"),c=(o||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const H=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",K=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const J=["post","put","patch","delete"],$=(new Set(J),["get",...J]);function z(){return z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},z.apply(this,arguments)}new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const q=e.createContext(null),V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Z=e.createContext(null);function tt(){return null!=e.useContext(X)}function et(){return tt()||_(!1),e.useContext(X).location}function nt(t){e.useContext(Y).static||e.useLayoutEffect(t)}function at(){let{isDataRoute:t}=e.useContext(Q);return t?function(){let{router:t}=function(t){let n=e.useContext(q);return n||_(!1),n}(ct.UseNavigateStable),n=gt(ut.UseNavigateStable),a=e.useRef(!1);return nt((()=>{a.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,z({fromRouteId:n},i)))}),[t,n])}():function(){tt()||_(!1);let t=e.useContext(q),{basename:n,future:a,navigator:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(F(r,a.v7_relativeSplatPath)),s=e.useRef(!1);return nt((()=>{s.current=!0})),e.useCallback((function(e,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof e)return void i.go(e);let r=j(e,JSON.parse(l),o,"path"===a.relative);null==t&&"/"!==n&&(r.pathname="/"===r.pathname?n:H([n,r.pathname])),(a.replace?i.replace:i.push)(r,a.state,a)}),[n,i,l,o,t])}()}function it(t,n){let{relative:a}=void 0===n?{}:n,{future:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(F(r,i.v7_relativeSplatPath));return e.useMemo((()=>j(t,JSON.parse(l),o,"path"===a)),[t,l,o,a])}function rt(t,n,a,i){tt()||_(!1);let{navigator:r}=e.useContext(Y),{matches:o}=e.useContext(Q),l=o[o.length-1],s=l?l.params:{},m=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let c,u=et();if(n){var d;let t="string"==typeof n?b(n):n;"/"===m||(null==(d=t.pathname)?void 0:d.startsWith(m))||_(!1),c=t}else c=u;let p=c.pathname||"/",h=x(t,{pathname:"/"===m?p:p.slice(m.length)||"/"}),k=function(t,n,a,i){var r;if(void 0===n&&(n=[]),void 0===a&&(a=null),void 0===i&&(i=null),null==t){var o;if(null==(o=a)||!o.errors)return null;t=a.matches}let l=t,s=null==(r=a)?void 0:r.errors;if(null!=s){let t=l.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||_(!1),l=l.slice(0,Math.min(l.length,t+1))}let m=!1,c=-1;if(a&&i&&i.v7_partialHydration)for(let t=0;t<l.length;t++){let e=l[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===a.loaderData[e.route.id]&&(!a.errors||void 0===a.errors[e.route.id])){m=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}return l.reduceRight(((t,i,r)=>{let o,u=!1,g=null,d=null;var p;a&&(o=s&&i.route.id?s[i.route.id]:void 0,g=i.route.errorElement||lt,m&&(c<0&&0===r?(dt[p="route-fallback"]||(dt[p]=!0),u=!0,d=null):c===r&&(u=!0,d=i.route.hydrateFallbackElement||null)));let h=n.concat(l.slice(0,r+1)),_=()=>{let n;return n=o?g:u?d:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(mt,{match:i,routeContext:{outlet:t,matches:h,isDataRoute:null!=a},children:n})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(st,{location:a.location,revalidation:a.revalidation,component:g,error:o,children:_(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):_()}),null)}(h&&h.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:H([m,r.encodeLocation?r.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:H([m,r.encodeLocation?r.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),o,a,i);return n&&k?e.createElement(X.Provider,{value:{location:z({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:g.Pop}},k):k}function ot(){let t=function(){var t;let n=e.useContext(Z),a=function(t){let n=e.useContext(V);return n||_(!1),n}(ut.UseRouteError),i=gt(ut.UseRouteError);return void 0!==n?n:null==(t=a.errors)?void 0:t[i]}(),n=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),a?e.createElement("pre",{style:i},a):null,null)}const lt=e.createElement(ot,null);class st extends e.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?e.createElement(Q.Provider,{value:this.props.routeContext},e.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mt(t){let{routeContext:n,match:a,children:i}=t,r=e.useContext(q);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),e.createElement(Q.Provider,{value:n},i)}var ct=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ct||{}),ut=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}(ut||{});function gt(t){let n=function(t){let n=e.useContext(Q);return n||_(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||_(!1),a.route.id}const dt={};function pt(t){let{to:n,replace:a,state:i,relative:r}=t;tt()||_(!1);let{future:o,static:l}=e.useContext(Y),{matches:s}=e.useContext(Q),{pathname:m}=et(),c=at(),u=j(n,F(s,o.v7_relativeSplatPath),m,"path"===r),g=JSON.stringify(u);return e.useEffect((()=>c(JSON.parse(g),{replace:a,state:i,relative:r})),[c,g,r,a,i]),null}function ht(t){_(!1)}function _t(t){let{basename:n="/",children:a=null,location:i,navigationType:r=g.Pop,navigator:o,static:l=!1,future:s}=t;tt()&&_(!1);let m=n.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:o,static:l,future:z({v7_relativeSplatPath:!1},s)})),[m,s,o,l]);"string"==typeof i&&(i=b(i));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:k="default"}=i,f=e.useMemo((()=>{let t=A(u,m);return null==t?null:{location:{pathname:t,search:d,hash:p,state:h,key:k},navigationType:r}}),[m,u,d,p,h,k,r]);return null==f?null:e.createElement(Y.Provider,{value:c},e.createElement(X.Provider,{children:a,value:f}))}function kt(t){let{children:e,location:n}=t;return rt(ft(e),n)}function ft(t,n){void 0===n&&(n=[]);let a=[];return e.Children.forEach(t,((t,i)=>{if(!e.isValidElement(t))return;let r=[...n,i];if(t.type===e.Fragment)return void a.push.apply(a,ft(t.props.children,r));t.type!==ht&&_(!1),t.props.index&&t.props.children&&_(!1);let o={id:t.props.id||r.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=ft(t.props.children,r)),a.push(o)})),a}e.startTransition,new Promise((()=>{})),e.Component;var Et=window.ReactDOM,vt=t.n(Et);function bt(){return bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},bt.apply(this,arguments)}function yt(t,e){if(null==t)return{};var n,a,i={},r=Object.keys(t);for(a=0;a<r.length;a++)n=r[a],e.indexOf(n)>=0||(i[n]=t[n]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const xt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],St=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],wt=e.createContext({isTransitioning:!1});new Map;const Nt=e.startTransition;function Ct(t){let{basename:n,children:a,future:i,window:r}=t,o=e.useRef();null==o.current&&(o.current=function(t){return void 0===t&&(t={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,o=i.history,l=g.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function u(){l=g.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:k.location,delta:e})}function d(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof t?t:v(t);return _(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,o.replaceState(p({},o.state,{idx:m}),""));let k={get action(){return l},get location(){return t(i,o)},listen(t){if(s)throw new Error("A history only accepts one active listener");return i.addEventListener(h,u),s=t,()=>{i.removeEventListener(h,u),s=null}},createHref(t){return e(i,t)},createURL:d,encodeLocation(t){let e=d(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=g.Push;let a=E(k.location,t,e);n&&n(a,t),m=c()+1;let u=f(a,m),d=k.createHref(a);try{o.pushState(u,"",d)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(d)}r&&s&&s({action:l,location:k.location,delta:1})},replace:function(t,e){l=g.Replace;let a=E(k.location,t,e);n&&n(a,t),m=c();let i=f(a,m),u=k.createHref(a);o.replaceState(i,"",u),r&&s&&s({action:l,location:k.location,delta:0})},go(t){return o.go(t)}};return k}((function(t,e){let{pathname:n="/",search:a="",hash:i=""}=b(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),E("",{pathname:n,search:a,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let n=t.document.querySelector("base"),a="";if(n&&n.getAttribute("href")){let e=t.location.href,n=e.indexOf("#");a=-1===n?e:e.slice(0,n)}return a+"#"+("string"==typeof e?e:v(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:r,v5Compat:!0}));let l=o.current,[s,m]=e.useState({action:l.action,location:l.location}),{v7_startTransition:c}=i||{},u=e.useCallback((t=>{c&&Nt?Nt((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>l.listen(u)),[l,u]),e.createElement(_t,{basename:n,children:a,location:s.location,navigationType:s.action,navigator:l,future:i})}Et.flushSync;const Tt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gt=e.forwardRef((function(t,n){let a,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:u,unstable_viewTransition:g}=t,d=yt(t,xt),{basename:p}=e.useContext(Y),h=!1;if("string"==typeof c&&Dt.test(c)&&(a=c,Tt))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=A(e.pathname,p);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:h=!0}catch(t){}let k=function(t,n){let{relative:a}=void 0===n?{}:n;tt()||_(!1);let{basename:i,navigator:r}=e.useContext(Y),{hash:o,pathname:l,search:s}=it(t,{relative:a}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),f=function(t,n){let{target:a,replace:i,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s}=void 0===n?{}:n,m=at(),c=et(),u=it(t,{relative:l});return e.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,a)){e.preventDefault();let n=void 0!==i?i:v(c)===v(u);m(t,{replace:n,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s})}}),[c,m,u,i,r,a,t,o,l,s])}(c,{replace:l,state:s,target:m,preventScrollReset:u,relative:r,unstable_viewTransition:g});return e.createElement("a",bt({},d,{href:a||k,onClick:h||o?i:function(t){i&&i(t),t.defaultPrevented||f(t)},ref:n,target:m}))})),Pt=e.forwardRef((function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,unstable_viewTransition:m,children:c}=t,u=yt(t,St),g=it(s,{relative:u.relative}),d=et(),p=e.useContext(V),{navigator:h}=e.useContext(Y),k=null!=p&&function(t,n){void 0===n&&(n={});let a=e.useContext(wt);null==a&&_(!1);let{basename:i}=function(t){let n=e.useContext(q);return n||_(!1),n}(It.useViewTransitionState),r=it(t,{relative:n.relative});if(!a.isTransitioning)return!1;let o=A(a.currentLocation.pathname,i)||a.currentLocation.pathname,l=A(a.nextLocation.pathname,i)||a.nextLocation.pathname;return null!=R(r.pathname,l)||null!=R(r.pathname,o)}(g)&&!0===m,f=h.encodeLocation?h.encodeLocation(g).pathname:g.pathname,E=d.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(E=E.toLowerCase(),v=v?v.toLowerCase():null,f=f.toLowerCase());const b="/"!==f&&f.endsWith("/")?f.length-1:f.length;let y,x=E===f||!o&&E.startsWith(f)&&"/"===E.charAt(b),S=null!=v&&(v===f||!o&&v.startsWith(f)&&"/"===v.charAt(f.length)),w={isActive:x,isPending:S,isTransitioning:k},N=x?a:void 0;y="function"==typeof r?r(w):[r,x?"active":null,S?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof l?l(w):l;return e.createElement(Gt,bt({},u,{"aria-current":N,className:y,ref:n,style:C,to:s,unstable_viewTransition:m}),"function"==typeof c?c(w):c)}));var It,Mt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(It||(It={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Mt||(Mt={}));var Ot=({title:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-sticky"},(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between"},(0,e.createElement)("h1",{className:"gtmkit-flex gtmkit-items-center gtmkit-font-medium gtmkit-text-3xl"},(0,e.createElement)("svg",{className:"gtmkit-mr-8",height:"44",viewBox:"0 0 160 54",width:"128",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("rect",{fill:"#888",height:"54",rx:"4.265",width:"160"}),(0,e.createElement)("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,e.createElement)("g",{fill:"#fff",transform:"matrix(1.465202 0 0 1.465202 -4.582436 -7.553126)"},(0,e.createElement)("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,e.createElement)("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)))),Rt=({to:t,title:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Pt,{to: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 ":"")},n)),Ut=({NavList:t})=>(0,e.createElement)("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"},t.map((function(t){return(0,e.createElement)(Rt,{key:t.to,to:t.to,title:t.title})})));function At(){return At=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},At.apply(this,arguments)}function Lt(t,e){if(null==t)return{};var n,a,i={},r=Object.keys(t);for(a=0;a<r.length;a++)n=r[a],e.indexOf(n)>=0||(i[n]=t[n]);return i}function Ft(t,e){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ft(t,e)}function jt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ft(t,e)}function Ht(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Bt=n().createContext(null),Wt=function(t){return t.scrollTop},Kt="unmounted",Jt="exited",$t="entering",zt="entered",qt="exiting",Vt=function(t){function e(e,n){var a;a=t.call(this,e,n)||this;var i,r=n&&!n.isMounting?e.enter:e.appear;return a.appearStatus=null,e.in?r?(i=Jt,a.appearStatus=$t):i=zt:i=e.unmountOnExit||e.mountOnEnter?Kt:Jt,a.state={status:i},a.nextCallback=null,a}jt(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Kt?{status:Jt}:null};var a=e.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==$t&&n!==zt&&(e=$t):n!==$t&&n!==zt||(e=qt)}this.updateStatus(!1,e)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var t,e,n,a=this.props.timeout;return t=e=n=a,null!=a&&"number"!=typeof a&&(t=a.exit,e=a.enter,n=void 0!==a.appear?a.appear:e),{exit:t,enter:e,appear:n}},a.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===$t){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this);n&&Wt(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jt&&this.setState({status:Kt})},a.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[vt().findDOMNode(this),a],r=i[0],o=i[1],l=this.getTimeouts(),s=a?l.appear:l.enter;t||n?(this.props.onEnter(r,o),this.safeSetState({status:$t},(function(){e.props.onEntering(r,o),e.onTransitionEnd(s,(function(){e.safeSetState({status:zt},(function(){e.props.onEntered(r,o)}))}))}))):this.safeSetState({status:zt},(function(){e.props.onEntered(r)}))},a.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),a=this.props.nodeRef?void 0:vt().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:qt},(function(){t.props.onExiting(a),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:Jt},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:Jt},(function(){t.props.onExited(a)}))},a.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},a.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(a){n&&(n=!1,e.nextCallback=null,t(a))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},a.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this),a=null==t&&!this.props.addEndListener;if(n&&!a){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],r=i[0],o=i[1];this.props.addEndListener(r,o)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},a.render=function(){var t=this.state.status;if(t===Kt)return null;var e=this.props,a=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,Lt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n().createElement(Bt.Provider,{value:null},"function"==typeof a?a(t,i):n().cloneElement(n().Children.only(a),i))},e}(n().Component);function Yt(){}Vt.contextType=Bt,Vt.propTypes={},Vt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yt,onEntering:Yt,onEntered:Yt,onExit:Yt,onExiting:Yt,onExited:Yt},Vt.UNMOUNTED=Kt,Vt.EXITED=Jt,Vt.ENTERING=$t,Vt.ENTERED=zt,Vt.EXITING=qt;var Xt=Vt,Qt=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return a=e,void((n=t).classList?n.classList.remove(a):"string"==typeof n.className?n.className=Ht(n.className,a):n.setAttribute("class",Ht(n.className&&n.className.baseVal||"",a)));var n,a}))},Zt=function(t){function e(){for(var e,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(e=t.call.apply(t,[this].concat(a))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(t,n){var a=e.resolveArguments(t,n),i=a[0],r=a[1];e.removeClasses(i,"exit"),e.addClass(i,r?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(t,n)},e.onEntering=function(t,n){var a=e.resolveArguments(t,n),i=a[0],r=a[1]?"appear":"enter";e.addClass(i,r,"active"),e.props.onEntering&&e.props.onEntering(t,n)},e.onEntered=function(t,n){var a=e.resolveArguments(t,n),i=a[0],r=a[1]?"appear":"enter";e.removeClasses(i,r),e.addClass(i,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,a="string"==typeof n,i=a?(a&&n?n+"-":"")+t:n[t];return{baseClassName:i,activeClassName:a?i+"-active":n[t+"Active"],doneClassName:a?i+"-done":n[t+"Done"]}},e}jt(e,t);var a=e.prototype;return a.addClass=function(t,e,n){var a=this.getClassNames(e)[n+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===e&&"done"===n&&i&&(a+=" "+i),"active"===n&&t&&Wt(t),a&&(this.appliedClasses[e][n]=a,function(t,e){t&&e&&e.split(" ").forEach((function(e){return a=e,void((n=t).classList?n.classList.add(a):function(t,e){return t.classList?!!e&&t.classList.contains(e):-1!==(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")}(n,a)||("string"==typeof n.className?n.className=n.className+" "+a:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+a)));var n,a}))}(t,a))},a.removeClasses=function(t,e){var n=this.appliedClasses[e],a=n.base,i=n.active,r=n.done;this.appliedClasses[e]={},a&&Qt(t,a),i&&Qt(t,i),r&&Qt(t,r)},a.render=function(){var t=this.props,e=(t.classNames,Lt(t,["classNames"]));return n().createElement(Xt,At({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n().Component);Zt.defaultProps={classNames:""},Zt.propTypes={};var te=Zt,ee=({title:t=(0,a.__)("Save","gtm-kit"),className:n="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{useUpdateSettings:o,useIsPending:l,useCanSave:s}=(0,i.useContext)(u);return(0,e.createElement)(r.Button,{className:n,onClick:()=>o(),variant:"primary",disabled:l||!s},s?(0,a.__)(t,"gtm-kit"):(0,a.__)("Saved","gtm-kit"),l?(0,e.createElement)(r.Spinner,null):"")},ne=()=>{const{useCanSave:t}=(0,i.useContext)(u);return(0,e.createElement)(te,{in:t,timeout:500,classNames:"slide",unmountOnExit:!0},(0,e.createElement)("footer",{className:"gtmkit-fixed gtmkit-bottom-0 gtmkit-w-full gtmkit-z-10 gtmkit-bg-color-grey gtmkit-text-white gtmkit-p-8"},(0,e.createElement)(ee,null)))},ae=({subject:t})=>{const n=!0===t||"on"===t,i=!0===n?"gtmkit-bg-color-success":"gtmkit-bg-color-button-disabled";return(0,e.createElement)("div",{className:"gtmkit-text-xs gtmkit-text-white gtmkit-font-bold gtmkit-rounded-full gtmkit-py gtmkit-px-2 gtmkit-h-5 gtmkit-leading-5 gtmkit-uppercase "+i},n?(0,a.__)("Active","gtm-kit"):(0,a.__)("Inactive","gtm-kit"))};const ie=(0,i.forwardRef)((({children:t,className:n="",...a},i)=>(0,e.createElement)("div",{...a,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 gtmkit-group gtmkit-w-full "+n,ref:i},t)));ie.Header=({as:t="h3",title:n="",children:a,className:i="",...r})=>(0,e.createElement)("div",{...r,className:"gtmkit-flex gtmkit-justify-between gtmkit-items-center gtmkit-mb-5 "+i},(0,e.createElement)(t,{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading"},n),a),ie.Content=({as:t="div",children:n,className:a="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:a},n),ie.Button=({url:t,destination:n,newTab:a=!1,text:i,group:o="",...l})=>{const s=at();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-rounded !gtmkit-py-4 !gtmkit-px-8 gtmkit-w-full sm:gtmkit-w-auto gtmkit-min-w-[225px]",onClick:()=>{n&&t&&!1===a?window.gtmkitSettings.current_poage===o?s(n,{replace:!0}):window.location.href=t+"#"+n:t?a?window.open(t):window.location.href=t:s(n,{replace:!0})}},(0,e.createElement)("span",{className:"gtmkit-mx-auto gtmkit-text-sm gtmkit-font-bold"},i)))};var re=ie,oe=({title:t,data:n,className:r=""})=>{const{useSettings:o}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8 gtmkit-mt-6"},t),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px] "+r},n.map(((t,n)=>!1===t.featured?null:(0,e.createElement)(re,{key:n},(0,e.createElement)(re.Header,{title:t.title},t.pill?(0,e.createElement)(ae,{subject:o[t.group][t.option]}):null),(0,e.createElement)(re.Content,null,t.text.map(((t,n)=>(0,e.createElement)("p",{key:n},t)))),(0,e.createElement)(re.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,a.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))};const le=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,a.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,a.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,a.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,a.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,a.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,a.__)("Setup integration","gtm-kit")}}],se=[{title:"Getting started with GTM Kit",text:[(0,a.__)("How to get the most out of Google Tag Manager with GTM Kit.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!0},{title:(0,a.__)("WooCommerce integration","gtm-kit"),text:[(0,a.__)("Integrate WooCommerce with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=dashboard-tutorials"},featured:!0},{title:"Contact Form 7 Integration",text:[(0,a.__)("Integrate Contact Form 7 with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/contact-form-7-integration/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Easy Digital Downloads integration",text:[(0,a.__)("Integrate Easy Digital Downloads with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/set-up-easy-digital-downloads-for-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Advanced GTM container implementation",text:[(0,a.__)("Customization of the GTM container implementation and Server Side Tracking.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Settings, actions and filters for developers",text:[(0,a.__)("One of the things that makes GTM Kit a great tool for developers is the ability to override options in wp-config.php.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1}];var me=()=>{const{useSettings:t}=(0,i.useContext)(u),[n,r]=(0,i.useState)(se),o=Boolean(t.general.sgtm_domain&&t.general.sgtm_domain.trim());return(0,i.useEffect)((()=>{r((t=>[...t,{title:(0,a.__)("See all tutorials…","gtm-kit"),text:[(0,a.__)("See all our tutorial and get the most out of GTM Kit","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=documentation&utm_content=dashboard-tutorials",text:(0,a.__)("Read articles","gtm-kit")},featured:!0}]))}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("General","gtm-kit")),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 lg:gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px]"},(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ae,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(re.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,a.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,a.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,a.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,a.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ae,{subject:o})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,a.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,a.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,a.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ae,{subject:t.general.analytics_active})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,a.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/misc",text:(0,a.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(oe,{title:(0,a.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(oe,{title:(0,a.__)("Integrations","gtm-kit"),data:le}))},ce=({title:t,placeholder:n,help:a,className:o="gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",optionGroup:l="general",optionName:s,isDisabled:m})=>{const{useSettings:c,useUpdateStateSettings:g}=(0,i.useContext)(u);return(0,e.createElement)(r.TextControl,{label:t,placeholder:n,help:a,className:o,value:c[l][s],onChange:t=>g(l,s,t),disabled:m})},ue=({title:t,label:n,optionGroup:a="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(r.BaseControl,{label:t},(0,e.createElement)(r.ToggleControl,{label:n,checked:!l&&s[a][o],onChange:()=>{m(a,o,!(s&&s[a][o]))},disabled:l}))))},ge=({title:t,options:n,help:a,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:g}=(0,i.useContext)(u);return(0,e.createElement)(r.RadioControl,{label:t,options:n,help:a,className:o,selected:parseInt(c[l][s]),onChange:t=>g(l,s,t),disabled:m})};const de=(0,i.forwardRef)((({children:t,className:n="",disabled:a=!1,...i},r)=>(0,e.createElement)("div",{...i,className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-w-3/4 gtmkit-border-color-grey "+n+(a?"gtmkit-opacity-60":""),ref:r},t)));de.Header=({as:t="h3",title:n="",children:a,className:i="",...r})=>(0,e.createElement)(t,{...r,className:"gtmkit-font-bold gtmkit-text-lg gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey "+i},n,a),de.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);var pe=de,he=()=>{const{useSettings:t}=(0,i.useContext)(u),n=!(t.general.sgtm_domain&&t.general.sgtm_domain.trim()&&t.general.sgtm_container_identifier&&t.general.sgtm_container_identifier.trim());return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("General Container Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit")),(0,e.createElement)(ce,{title:(0,a.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,a.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ue,{title:(0,a.__)("Inject Container Code","gtm-kit"),label:(0,a.__)("Setting this to Off will remove the Google Tag Manager container code but the data layer will remain.","gtm-kit"),optionName:"container_active"}),(0,e.createElement)(ue,{title:(0,a.__)("Just the container","gtm-kit"),label:(0,a.__)("Setting this to On will reduce the functionality to just the GTM container code. No additional data will be pushed to the datalayer regardless of any other settings.","gtm-kit"),optionName:"just_the_container"}),(0,e.createElement)(ce,{title:(0,a.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,a.__)("The default name of the data layer object is dataLayer. If you prefer to use a different name for your data layer, you may do.","gtm-kit")}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,a.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,a.__)("Enter domain …","gtm-kit"),help:(0,a.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,a.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,a.__)("Enter loader name …","gtm-kit"),help:(0,a.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ue,{title:(0,a.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,a.__)("Prolong cookie lifetime in Safari and other browsers with ITP. This only works if you use Stape sGTM hosting and have set up the Cookie Keeper power up.","gtm-kit"),optionName:"sgtm_cookie_keeper",disabled:n})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/google-tag-manager-server-side-tagging/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=sgtm&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Setting up server-side tracking can be challenging and costly but there is an easy and cheap solution.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Stape.io is a solution for hosting server-side Google Tag Manager containers, offering a simplified approach that demands less technical expertise than solutions like Google Cloud Platform.","gtm-kit")," ",(0,a.__)("Additionally, it provides valuable add-ons for enhanced functionality.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:"https://stape.io/?pt=tlam&rs=plugin",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Tag Manager Environment","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,a.__)("gtm_auth:","gtm-kit"),optionName:"gtm_auth",placeholder:(0,a.__)("Enter gtm_auth code","gtm-kit"),help:(0,a.__)("Enter your gtm_auth code your GTM environment.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,a.__)("gtm_preview:","gtm-kit"),optionName:"gtm_preview",placeholder:(0,a.__)("Enter gtm_preview code","gtm-kit"),help:(0,a.__)("Enter your gtm_preview code your GTM environment.","gtm-kit")})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Environments","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("In Google Tag Manager you can define different environments like Live, Dev and QA.","gtm-kit")," ",(0,a.__)('To use a specific environment in GTM Kit you must enter the "gtm_auth" and "gtm_preview" codes for that environment.',"gtm-kit")," ",(0,a.__)("If left empty the default environment will be used.","gtm-kit")),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Override settings in wp-config.php","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("You can override the values of using constants in wp-config.php, which is a very useful for setting the value in your development and staging environments.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=container-settings&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,a.__)("Container code implementation:","gtm-kit"),options:[{label:(0,a.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,a.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,a.__)("Depending on how you use Google Tag Manager you can delay the loading of the container script until the browser is idle.","gtm-kit"),optionName:"script_implementation"}),(0,e.createElement)(ge,{title:(0,a.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,a.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,a.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,a.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,a.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,a.__)('The preferred method to implement the <noscript> container code is just after the opening <body> tag. This requires that your theme uses the "body_open" hook. If your theme does not support this the script can be injected in the footer or you can use the function below.',"gtm-kit"),optionName:"noscript_implementation"}),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("code",null,"<?php if ( function_exists( 'gtmkit_the_noscript_tag' ) ) { gtmkit_the_noscript_tag(); } ?>")))))},_e=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Post Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ue,{title:(0,a.__)("Post type","gtm-kit"),id:"post-type",label:(0,a.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ue,{title:(0,a.__)("Page type","gtm-kit"),id:"page-type",label:(0,a.__)('Include the defined page type. I.e. post, page, product, category, cart, checkout etc. You may override this on page-level and set you own page type i.e. "campaign".',"gtm-kit"),optionName:"datalayer_page_type"}),(0,e.createElement)(ue,{title:(0,a.__)("Categories","gtm-kit"),id:"categories",label:(0,a.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ue,{title:(0,a.__)("Tags","gtm-kit"),id:"tags",label:(0,a.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ue,{title:(0,a.__)("Post title","gtm-kit"),id:"post-title",label:(0,a.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ue,{title:(0,a.__)("Post ID","gtm-kit"),id:"post-id",label:(0,a.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ue,{title:(0,a.__)("Post data","gtm-kit"),id:"post-date",label:(0,a.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ue,{title:(0,a.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,a.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ue,{title:(0,a.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,a.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),ke=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("User Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,a.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,a.__)("Full page caching will cache user data making it the same for all users. There are ways around this, but it depends on the chosen cache solution and is only for advanced users.","gtm-kit")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,a.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ue,{title:(0,a.__)("User ID","gtm-kit"),id:"user-id",label:(0,a.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ue,{title:(0,a.__)("User role","gtm-kit"),id:"user-role",label:(0,a.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),fe=()=>{const{useSettings:t}=(0,i.useContext)(u),n=!t.general.gcm_default_settings;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,a.__)("Warning!","gtm-kit"))),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,a.__)("Most Consent Management Platforms will handle the Google Consent Mode settings for you and applying the default settings in both GTM Kit and you CMP will lead to unexpected behaviour or errors.","gtm-kit")),(0,e.createElement)("p",null,(0,a.__)("You should only use these settings if you do not have a Consent Management Platform that supports Google Consent Mode.","gtm-kit")),(0,e.createElement)("p",{className:"!gtmkit-mt-4"},(0,a.__)("GTM Kit will only set the default Consent Mode settings and you must update the settings yourself when the user has given consent.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-color-primary !gtmkit-my-6"},(0,e.createElement)("a",{href:"https://developers.google.com/tag-platform/security/guides/consent#implementation_example",target:"_blank",rel:"noreferrer",className:"hover:gtmkit-underline gtmkit-font-semibold"},(0,a.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ue,{title:(0,a.__)("Activate GCM settings","gtm-kit"),label:(0,a.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(pe,{disabled:n},(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Ad Personalization","gtm-kit"),label:(0,a.__)("Enables personalized advertising","gtm-kit"),optionName:"gcm_ad_personalization",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Ad Storage","gtm-kit"),label:(0,a.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Ad User Data","gtm-kit"),label:(0,a.__)("Enables sending user data related to advertising to Google","gtm-kit"),optionName:"gcm_ad_user_data",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Analytics Storage","gtm-kit"),label:(0,a.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Functionality Storage","gtm-kit"),label:(0,a.__)("Enables storage that supports the functionality of the website or app such as language settings","gtm-kit"),optionName:"gcm_functionality_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Personalization Storage","gtm-kit"),label:(0,a.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Security Storage","gtm-kit"),label:(0,a.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:n}))))},Ee=({label:t,value:n,tag:a})=>(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-4 gtmkit-py-2"},(0,e.createElement)("strong",null,t)),(0,e.createElement)("td",{className:"gtmkit-px-4 gtmkit-py-2"},"code"===a?(0,e.createElement)("code",{className:"gtmkit-text-sm"},n):(0,e.createElement)("em",null,n))),ve=()=>{const{useSiteData:t}=(0,i.useContext)(u),n=Object.values(t.shared_data);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,a.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,a.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm gtmkit-my-6 gtmkit-py-6"},(0,e.createElement)("tbody",{className:"gtmkit-py-6"},n.map((function(t,n){return(0,e.createElement)(Ee,{key:n,label:t.label,value:t.value,tag:t.tag})})))))},be=()=>{const{}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Misc","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ve,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,a.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ue,{title:(0,a.__)("Share anonymous data","gtm-kit"),label:(0,a.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Console log","gtm-kit"),label:(0,a.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},ye=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(oe,{title:(0,a.__)("Integrations","gtm-kit"),data:le})),xe=({pluginName:t})=>(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.sprintf)((0,a.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,a.sprintf)((0,a.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-4 !gtmkit-px-6 gtmkit-text-sm disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.pluginInstallUrl+t}},(0,a.sprintf)((0,a.__)("Install %s","gtm-kit"),t)))),Se=({title:t,options:n,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m=!1,help:c="",notSet:g=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,i.useContext)(u),h=g?[{label:(0,a.__)("(not set)","gtm-kit"),value:""},...n]:n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(r.SelectControl,{label:t,value:d&&d[l][s],options:h,className:o,onChange:t=>p(l,s,t),disabled:m,help:c}))},we=({pluginName:t,optionName:n,pluginInactive:i})=>(0,e.createElement)(pe,{disabled:i},(0,e.createElement)(pe.Header,{title:(0,a.sprintf)((0,a.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.sprintf)((0,a.__)("Track %s","gtm-kit"),t),label:(0,a.sprintf)((0,a.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:n,disabled:i})));const Ne=[{label:(0,a.__)("Retail","gtm-kit"),value:"retail"},{label:(0,a.__)("Education","gtm-kit"),value:"education"},{label:(0,a.__)("Flights","gtm-kit"),value:"flights"},{label:(0,a.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,a.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,a.__)("Local deals","gtm-kit"),value:"local"},{label:(0,a.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,a.__)("Travel","gtm-kit"),value:"travel"},{label:(0,a.__)("Custom","gtm-kit"),value:"custom"}];var Ce=()=>{const{useSettings:t}=(0,i.useContext)(u),n="WooCommerce",r=!window.gtmkitSettings.plugins.woocommerce,o=r||!t.integrations.woocommerce_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("WooCommerce","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"woocommerce_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Basic settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,a.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,a.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Use SKU instead of ID","gtm-kit"),label:(0,a.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_use_sku",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Exclude tax","gtm-kit"),label:(0,a.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Exclude shipping from revenue","gtm-kit"),label:(0,a.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include customer data","gtm-kit"),label:(0,a.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Event customization","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:"view_item_list (with product filter)",options:[{label:(0,a.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,a.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,a.__)("Do you what to push the view_item_list event if the list is updated using a filter or just once per page view.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_view_item_list_limit",disabled:o}),(0,e.createElement)(ge,{title:"view_item",options:[{label:(0,a.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,a.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,a.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,a.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:o}),(0,e.createElement)(ge,{title:"add_shipping_info ",options:[{label:(0,a.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,a.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,a.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,a.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:o}),(0,e.createElement)(ge,{title:"add_payment_info ",options:[{label:(0,a.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,a.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,a.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,a.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,a.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Ne,help:(0,a.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,a.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,a.__)("Enter prefix …","gtm-kit"),help:(0,a.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,a.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_dequeue_script",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include permalink structure","gtm-kit"),label:(0,a.__)("Enable this option to include the permalink structure of the product base, category base, tag base and attribute base.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_permalink_structure",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include path of pages","gtm-kit"),label:(0,a.__)("Enable this option to include the path of cart, checkout, order received and my account page.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_pages",disabled:o}))))},Te=()=>{const{useSettings:t}=(0,i.useContext)(u),n="Contact Form 7",r=!window.gtmkitSettings.plugins.cf7,o=r||!t.integrations.cf7_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Contact Form 7","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"cf7_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,a.__)("Load JavaScript","gtm-kit"),options:[{label:(0,a.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,a.__)("On all pages","gtm-kit"),value:2}],help:(0,a.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:o}))))},De=()=>{const t="Easy Digital Downloads",n=!window.gtmkitSettings.plugins.edd,{useSettings:r}=(0,i.useContext)(u),o=n||!r.integrations.edd_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Easy Digital Downloads","gtm-kit")),n?(0,e.createElement)(xe,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:n}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Use SKU instead of ID","gtm-kit"),label:(0,a.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"edd_use_sku",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Exclude tax","gtm-kit"),label:(0,a.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include customer data","gtm-kit"),label:(0,a.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"edd_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,a.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Ne,help:(0,a.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,a.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,a.__)("Enter prefix …","gtm-kit"),help:(0,a.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:n},(0,e.createElement)(pe.Header,{title:(0,a.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,a.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"edd_dequeue_script",disabled:o}))))},Ge=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Help","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,a.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/"},(0,a.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,a.__)("GTM container import files:","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,a.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,a.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Tutorials","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",null,se.map(((t,n)=>(0,e.createElement)("li",{key:n,className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:t.link.url,target:"_blank",rel:"noreferrer",className:"gtmkit-font-semibold gtmkit-text-color-primary hover:gtmkit-underline"},t.title),t.text.map(((t,n)=>(0,e.createElement)("div",{key:n,className:"gtmkit-text-sm"},t)))))))))),Pe=()=>{const{useIsSending:t,useSiteData:n,useUpdateSupportTicket:o,useSupportTicket:l,useSendSystemData:s,useIsSystemDataSent:m,useSystemDataMessage:c}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Get support","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Support options","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://wordpress.org/support/plugin/gtm-kit/",target:"_blank",rel:"noreferrer"},(0,a.__)("WordPress.org Support Forum","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,a.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,a.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Share system data with the GTM Kit support team","gtm-kit")}),(0,e.createElement)(pe.Content,null,m?(0,e.createElement)("p",{className:"gtmkit-mb-2"},c):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2"},(0,a.__)("If the GTM Kit support team has asked you to send your system data you can do so by entering the support ticket below:","gtm-kit")),(0,e.createElement)(r.TextControl,{label:(0,e.createElement)("span",{className:"gtmkit-text-red-600"},c," "),placeholder:(0,a.__)("Enter support ticket","gtm-kit"),className:"gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",value:l,onChange:t=>o(t)}),(0,e.createElement)(r.Button,{variant:"primary",className:"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",onClick:()=>{s()},disabled:!l.toUpperCase().startsWith("FS")},(0,e.createElement)("span",null,(0,a.__)("Send system data","gtm-kit")),t?(0,e.createElement)(r.Spinner,null):"")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("About GTM Kit","gtm-kit"),className:"gtmkit-flex gtmkit-items-center"},(0,e.createElement)("span",{className:"gtmkit-text-sm gtmkit-text-color-grey gtmkit-font-light gtmkit-ml-2"},"(",(0,a.__)("Version:","gtm-kit")," ",n.gtmkit_version,")")),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",null,(0,a.__)("Learn about changes and follow the development of GTM Kit:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,a.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary  hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,a.__)("The Github repository","gtm-kit"))))))};const Ie={integrations:(0,a.__)("Integrations","gtm-kit"),help:(0,a.__)("Help","gtm-kit")},Me=()=>{const{useSettings:t}=(0,i.useContext)(u),n=window.gtmkitSettings.currentPage,o=function({page:t}){const e=[{to:"general",title:(0,a.__)("Dashboard","gtm-kit")},{to:"container",title:(0,a.__)("Container","gtm-kit")},{to:"post-data",title:(0,a.__)("Post data","gtm-kit")},{to:"user-data",title:(0,a.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,a.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,a.__)("Misc","gtm-kit")}],n=[{to:"integrations",title:(0,a.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],i=[{to:"help",title:(0,a.__)("Help","gtm-kit")},{to:"support",title:(0,a.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return n;case"help":return i}}({page:n}),l=Ie[n]||(0,a.__)("Settings","gtm-kit");return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ot,{title:l}),(0,e.createElement)(Ut,{NavList:o}),(0,e.createElement)("main",{className:"gtmkit-max-w-[1536px] gtmkit-px-8 gtmkit-pt-8 gtmkit-text-base"},(0,e.createElement)(kt,null,(0,e.createElement)(ht,{exact:!0,path:"/general",element:(0,e.createElement)(me,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(fe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(ye,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Te,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(De,null)}),(0,e.createElement)(ht,{exact:!0,path:"/help",element:(0,e.createElement)(Ge,null)}),(0,e.createElement)(ht,{exact:!0,path:"/support",element:(0,e.createElement)(Pe,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+n})}))),(0,e.createElement)(ne,null)):(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(r.Spinner,null))},Oe=()=>(0,e.createElement)(Ct,{basename:"/"},(0,e.createElement)(d,null,(0,e.createElement)(Me,null)));document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(window.gtmkitSettings.rootId);null!=t&&(0,i.render)((0,e.createElement)(Oe,null),t)}))}();
     1(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.React;var a=t.n(e);const n=window.wp.i18n,i=window.wp.element,r=window.wp.components,o=window.lodash,l=window.wp.apiFetch;var s=t.n(l);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const m=async(t,e,a=null,n=!1)=>{let i={};try{i=await s()({path:t,method:e,...a&&{data:a}})}catch(a){return console.log(`${e} ${t} Errors:`,a),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?i:!0===i.success?i.data:options},c=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,n.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,n.__)("An error occurred.","gtm-kit"):(0,n.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage}return a},g=(0,i.createContext)(),u=t=>{const[a,n]=(0,i.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),r=async()=>{const[t,e]=await Promise.all([m("gtmkit/v1/get-options","GET"),m("gtmkit/v1/get-site-data","GET")]),a="wizard"===window.gtmkitSettings.currentPage?await m("gtmkit/v1/get-install-data","GET"):{};n({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:a}})},l=async t=>{n({type:"UPDATE_STATE",payload:t})};(0,i.useEffect)((()=>{r()}),[]);const s={useDispatch:t=>{n(t)},useUpdateSettings:async()=>{n({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=a.stateSettings,m("gtmkit/v1/set-options","POST",e));var e;n({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:r,useUpdateState:l,useUpdateStateSettings:async(t,e,n)=>{const i=JSON.parse(JSON.stringify(a.stateSettings));let r;i[t][e]=n,r=!(0,o.isEqual)(i,a.fetchedSettings),l({stateSettings:i,canSave:r})},useImportSettings:async(t,e)=>{const n=JSON.parse(JSON.stringify(a.stateSettings));let i;const r={};r.general={...n.general,...e.general},"integrations"in e&&(r.integrations={...n.integrations,...e.integrations}),i=!(0,o.isEqual)(r,a.fetchedSettings),l({stateSettings:r,canSave:i})},useUpdateSupportTicket:async t=>{l({supportTicket:t})},useSendSystemData:async()=>{n({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=a.supportTicket,m("gtmkit/v1/send-support-data","POST",e,!0));var e;n({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:a.stateSettings,useIsPending:a.isPending,useNotice:a.notice,useHasError:a.hasError,useCanSave:a.canSave,useSiteData:a.siteData,useInstallData:a.installData,useIsSending:a.isSendingSystemData,useSupportTicket:a.supportTicket,useIsSystemDataSent:a.isSystemDataSent,useSystemDataMessage:a.systemDataMessage};return(0,e.createElement)(g.Provider,{value:s},t.children)};function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},d.apply(this,arguments)}var p;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(p||(p={}));const h="popstate";function _(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function f(t,e){return{usr:t.state,key:t.key,idx:e}}function E(t,e,a,n){return void 0===a&&(a=null),d({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?b(e):e,{state:a,key:e&&e.key||n||Math.random().toString(36).substr(2,8)})}function v(t){let{pathname:e="/",search:a="",hash:n=""}=t;return a&&"?"!==a&&(e+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function b(t){let e={};if(t){let a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var y;function x(t,e,a){void 0===a&&(a="/");let n=A(("string"==typeof e?b(e):e).pathname||"/",a);if(null==n)return null;let i=S(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,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(i);let r=null;for(let t=0;null==r&&t<i.length;++t)r=O(i[t],U(n));return r}function S(t,e,a,n){void 0===e&&(e=[]),void 0===a&&(a=[]),void 0===n&&(n="");let i=(t,i,r)=>{let o={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};o.relativePath.startsWith("/")&&(_(o.relativePath.startsWith(n),'Absolute route path "'+o.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(n.length));let l=H([n,o.relativePath]),s=a.concat(o);t.children&&t.children.length>0&&(_(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),S(t.children,e,s,l)),(null!=t.path||t.index)&&e.push({path:l,score:M(l,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of w(t.path))i(t,e,a);else i(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,i=a.endsWith("?"),r=a.replace(/\?$/,"");if(0===n.length)return i?[r,""]:[r];let o=w(n.join("/")),l=[];return l.push(...o.map((t=>""===t?r:[r,t].join("/")))),i&&l.push(...o),l.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(y||(y={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const N=/^:\w+$/,C=3,T=2,D=1,G=10,P=-2,I=t=>"*"===t;function M(t,e){let a=t.split("/"),n=a.length;return a.some(I)&&(n+=P),e&&(n+=T),a.filter((t=>!I(t))).reduce(((t,e)=>t+(N.test(e)?C:""===e?D:G)),n)}function O(t,e){let{routesMeta:a}=t,n={},i="/",r=[];for(let t=0;t<a.length;++t){let o=a[t],l=t===a.length-1,s="/"===i?e:e.slice(i.length)||"/",m=R({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},s);if(!m)return null;Object.assign(n,m.params);let c=o.route;r.push({params:n,pathname:H([i,m.pathname]),pathnameBase:B(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function R(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[a,n]=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!0),k("*"===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 n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,a)=>(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),i=e.match(a);if(!i)return null;let r=i[0],o=r.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:i}=e;if("*"===n){let t=l[a]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const s=l[a];return t[n]=i&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(a){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+a+")."),t}}(s||"",n),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function U(t){try{return decodeURI(t)}catch(e){return k(!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 A(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function L(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function j(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase)):a.map((t=>t.pathnameBase))}function F(t,e,a,n){let i;void 0===n&&(n=!1),"string"==typeof t?i=b(t):(i=d({},t),_(!i.pathname||!i.pathname.includes("?"),L("?","pathname","search",i)),_(!i.pathname||!i.pathname.includes("#"),L("#","pathname","hash",i)),_(!i.search||!i.search.includes("#"),L("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(null==l)r=a;else if(n){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t.pop();i.pathname=e.join("/")}r="/"+t.join("/")}else{let t=e.length-1;if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t-=1;i.pathname=e.join("/")}r=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:i=""}="string"==typeof t?b(t):t,r=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:r,search:W(n),hash:K(i)}}(i,r),m=l&&"/"!==l&&l.endsWith("/"),c=(o||"."===l)&&a.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const H=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",K=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const J=["post","put","patch","delete"],z=(new Set(J),["get",...J]);function $(){return $=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},$.apply(this,arguments)}new Set(z),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const q=e.createContext(null),V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Z=e.createContext(null);function tt(){return null!=e.useContext(X)}function et(){return tt()||_(!1),e.useContext(X).location}function at(t){e.useContext(Y).static||e.useLayoutEffect(t)}function nt(){let{isDataRoute:t}=e.useContext(Q);return t?function(){let{router:t}=function(t){let a=e.useContext(q);return a||_(!1),a}(ct.UseNavigateStable),a=ut(gt.UseNavigateStable),n=e.useRef(!1);return at((()=>{n.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,$({fromRouteId:a},i)))}),[t,a])}():function(){tt()||_(!1);let t=e.useContext(q),{basename:a,future:n,navigator:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(j(r,n.v7_relativeSplatPath)),s=e.useRef(!1);return at((()=>{s.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!s.current)return;if("number"==typeof e)return void i.go(e);let r=F(e,JSON.parse(l),o,"path"===n.relative);null==t&&"/"!==a&&(r.pathname="/"===r.pathname?a:H([a,r.pathname])),(n.replace?i.replace:i.push)(r,n.state,n)}),[a,i,l,o,t])}()}function it(t,a){let{relative:n}=void 0===a?{}:a,{future:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(j(r,i.v7_relativeSplatPath));return e.useMemo((()=>F(t,JSON.parse(l),o,"path"===n)),[t,l,o,n])}function rt(t,a,n,i){tt()||_(!1);let{navigator:r}=e.useContext(Y),{matches:o}=e.useContext(Q),l=o[o.length-1],s=l?l.params:{},m=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let c,g=et();if(a){var u;let t="string"==typeof a?b(a):a;"/"===m||(null==(u=t.pathname)?void 0:u.startsWith(m))||_(!1),c=t}else c=g;let d=c.pathname||"/",h=x(t,{pathname:"/"===m?d:d.slice(m.length)||"/"}),k=function(t,a,n,i){var r;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===i&&(i=null),null==t){var o;if(null==(o=n)||!o.errors)return null;t=n.matches}let l=t,s=null==(r=n)?void 0:r.errors;if(null!=s){let t=l.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||_(!1),l=l.slice(0,Math.min(l.length,t+1))}let m=!1,c=-1;if(n&&i&&i.v7_partialHydration)for(let t=0;t<l.length;t++){let e=l[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===n.loaderData[e.route.id]&&(!n.errors||void 0===n.errors[e.route.id])){m=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}return l.reduceRight(((t,i,r)=>{let o,g=!1,u=null,d=null;var p;n&&(o=s&&i.route.id?s[i.route.id]:void 0,u=i.route.errorElement||lt,m&&(c<0&&0===r?(dt[p="route-fallback"]||(dt[p]=!0),g=!0,d=null):c===r&&(g=!0,d=i.route.hydrateFallbackElement||null)));let h=a.concat(l.slice(0,r+1)),_=()=>{let a;return a=o?u:g?d:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(mt,{match:i,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:a})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(st,{location:n.location,revalidation:n.revalidation,component:u,error:o,children:_(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):_()}),null)}(h&&h.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:H([m,r.encodeLocation?r.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:H([m,r.encodeLocation?r.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),o,n,i);return a&&k?e.createElement(X.Provider,{value:{location:$({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:p.Pop}},k):k}function ot(){let t=function(){var t;let a=e.useContext(Z),n=function(t){let a=e.useContext(V);return a||_(!1),a}(gt.UseRouteError),i=ut(gt.UseRouteError);return void 0!==a?a:null==(t=n.errors)?void 0:t[i]}(),a=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},a),n?e.createElement("pre",{style:i},n):null,null)}const lt=e.createElement(ot,null);class st extends e.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?e.createElement(Q.Provider,{value:this.props.routeContext},e.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mt(t){let{routeContext:a,match:n,children:i}=t,r=e.useContext(q);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(Q.Provider,{value:a},i)}var ct=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ct||{}),gt=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}(gt||{});function ut(t){let a=function(t){let a=e.useContext(Q);return a||_(!1),a}(),n=a.matches[a.matches.length-1];return n.route.id||_(!1),n.route.id}const dt={};function pt(t){let{to:a,replace:n,state:i,relative:r}=t;tt()||_(!1);let{future:o,static:l}=e.useContext(Y),{matches:s}=e.useContext(Q),{pathname:m}=et(),c=nt(),g=F(a,j(s,o.v7_relativeSplatPath),m,"path"===r),u=JSON.stringify(g);return e.useEffect((()=>c(JSON.parse(u),{replace:n,state:i,relative:r})),[c,u,r,n,i]),null}function ht(t){_(!1)}function _t(t){let{basename:a="/",children:n=null,location:i,navigationType:r=p.Pop,navigator:o,static:l=!1,future:s}=t;tt()&&_(!1);let m=a.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:o,static:l,future:$({v7_relativeSplatPath:!1},s)})),[m,s,o,l]);"string"==typeof i&&(i=b(i));let{pathname:g="/",search:u="",hash:d="",state:h=null,key:k="default"}=i,f=e.useMemo((()=>{let t=A(g,m);return null==t?null:{location:{pathname:t,search:u,hash:d,state:h,key:k},navigationType:r}}),[m,g,u,d,h,k,r]);return null==f?null:e.createElement(Y.Provider,{value:c},e.createElement(X.Provider,{children:n,value:f}))}function kt(t){let{children:e,location:a}=t;return rt(ft(e),a)}function ft(t,a){void 0===a&&(a=[]);let n=[];return e.Children.forEach(t,((t,i)=>{if(!e.isValidElement(t))return;let r=[...a,i];if(t.type===e.Fragment)return void n.push.apply(n,ft(t.props.children,r));t.type!==ht&&_(!1),t.props.index&&t.props.children&&_(!1);let o={id:t.props.id||r.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=ft(t.props.children,r)),n.push(o)})),n}e.startTransition,new Promise((()=>{})),e.Component;const Et=window.ReactDOM;var vt=t.n(Et);function bt(){return bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},bt.apply(this,arguments)}function yt(t,e){if(null==t)return{};var a,n,i={},r=Object.keys(t);for(n=0;n<r.length;n++)a=r[n],e.indexOf(a)>=0||(i[a]=t[a]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const xt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],St=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],wt=e.createContext({isTransitioning:!1});new Map;const Nt=e.startTransition;function Ct(t){let{basename:a,children:n,future:i,window:r}=t,o=e.useRef();null==o.current&&(o.current=function(t){return void 0===t&&(t={}),function(t,e,a,n){void 0===n&&(n={});let{window:i=document.defaultView,v5Compat:r=!1}=n,o=i.history,l=p.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function g(){l=p.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:k.location,delta:e})}function u(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,a="string"==typeof t?t:v(t);return _(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==m&&(m=0,o.replaceState(d({},o.state,{idx:m}),""));let k={get action(){return l},get location(){return t(i,o)},listen(t){if(s)throw new Error("A history only accepts one active listener");return i.addEventListener(h,g),s=t,()=>{i.removeEventListener(h,g),s=null}},createHref:t=>e(i,t),createURL:u,encodeLocation(t){let e=u(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=p.Push;let n=E(k.location,t,e);a&&a(n,t),m=c()+1;let g=f(n,m),u=k.createHref(n);try{o.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(u)}r&&s&&s({action:l,location:k.location,delta:1})},replace:function(t,e){l=p.Replace;let n=E(k.location,t,e);a&&a(n,t),m=c();let i=f(n,m),g=k.createHref(n);o.replaceState(i,"",g),r&&s&&s({action:l,location:k.location,delta:0})},go:t=>o.go(t)};return k}((function(t,e){let{pathname:a="/",search:n="",hash:i=""}=b(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),E("",{pathname:a,search:n,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:v(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:r,v5Compat:!0}));let l=o.current,[s,m]=e.useState({action:l.action,location:l.location}),{v7_startTransition:c}=i||{},g=e.useCallback((t=>{c&&Nt?Nt((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>l.listen(g)),[l,g]),e.createElement(_t,{basename:a,children:n,location:s.location,navigationType:s.action,navigator:l,future:i})}Et.flushSync;const Tt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gt=e.forwardRef((function(t,a){let n,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:g,unstable_viewTransition:u}=t,d=yt(t,xt),{basename:p}=e.useContext(Y),h=!1;if("string"==typeof c&&Dt.test(c)&&(n=c,Tt))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),a=A(e.pathname,p);e.origin===t.origin&&null!=a?c=a+e.search+e.hash:h=!0}catch(t){}let k=function(t,a){let{relative:n}=void 0===a?{}:a;tt()||_(!1);let{basename:i,navigator:r}=e.useContext(Y),{hash:o,pathname:l,search:s}=it(t,{relative:n}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),f=function(t,a){let{target:n,replace:i,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s}=void 0===a?{}:a,m=nt(),c=et(),g=it(t,{relative:l});return e.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 a=void 0!==i?i:v(c)===v(g);m(t,{replace:a,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s})}}),[c,m,g,i,r,n,t,o,l,s])}(c,{replace:l,state:s,target:m,preventScrollReset:g,relative:r,unstable_viewTransition:u});return e.createElement("a",bt({},d,{href:n||k,onClick:h||o?i:function(t){i&&i(t),t.defaultPrevented||f(t)},ref:a,target:m}))})),Pt=e.forwardRef((function(t,a){let{"aria-current":n="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,unstable_viewTransition:m,children:c}=t,g=yt(t,St),u=it(s,{relative:g.relative}),d=et(),p=e.useContext(V),{navigator:h}=e.useContext(Y),k=null!=p&&function(t,a){void 0===a&&(a={});let n=e.useContext(wt);null==n&&_(!1);let{basename:i}=function(t){let a=e.useContext(q);return a||_(!1),a}(It.useViewTransitionState),r=it(t,{relative:a.relative});if(!n.isTransitioning)return!1;let o=A(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=A(n.nextLocation.pathname,i)||n.nextLocation.pathname;return null!=R(r.pathname,l)||null!=R(r.pathname,o)}(u)&&!0===m,f=h.encodeLocation?h.encodeLocation(u).pathname:u.pathname,E=d.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(E=E.toLowerCase(),v=v?v.toLowerCase():null,f=f.toLowerCase());const b="/"!==f&&f.endsWith("/")?f.length-1:f.length;let y,x=E===f||!o&&E.startsWith(f)&&"/"===E.charAt(b),S=null!=v&&(v===f||!o&&v.startsWith(f)&&"/"===v.charAt(f.length)),w={isActive:x,isPending:S,isTransitioning:k},N=x?n:void 0;y="function"==typeof r?r(w):[r,x?"active":null,S?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof l?l(w):l;return e.createElement(Gt,bt({},g,{"aria-current":N,className:y,ref:a,style:C,to:s,unstable_viewTransition:m}),"function"==typeof c?c(w):c)}));var It,Mt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(It||(It={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Mt||(Mt={}));const Ot=({title:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-sticky"},(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between"},(0,e.createElement)("h1",{className:"gtmkit-flex gtmkit-items-center gtmkit-font-medium gtmkit-text-3xl"},(0,e.createElement)("svg",{className:"gtmkit-mr-8",height:"44",viewBox:"0 0 160 54",width:"128",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("rect",{fill:"#888",height:"54",rx:"4.265",width:"160"}),(0,e.createElement)("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,e.createElement)("g",{fill:"#fff",transform:"matrix(1.465202 0 0 1.465202 -4.582436 -7.553126)"},(0,e.createElement)("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,e.createElement)("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)))),Rt=({to:t,title:a})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Pt,{to: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 ":"")},a)),Ut=({NavList:t})=>(0,e.createElement)("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"},t.map((function(t){return(0,e.createElement)(Rt,{key:t.to,to:t.to,title:t.title})})));function At(){return At=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},At.apply(this,arguments)}function Lt(t,e){if(null==t)return{};var a,n,i={},r=Object.keys(t);for(n=0;n<r.length;n++)a=r[n],e.indexOf(a)>=0||(i[a]=t[a]);return i}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}function Ft(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,jt(t,e)}function Ht(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Bt=a().createContext(null);var Wt=function(t){return t.scrollTop},Kt="unmounted",Jt="exited",zt="entering",$t="entered",qt="exiting",Vt=function(t){function e(e,a){var n;n=t.call(this,e,a)||this;var i,r=a&&!a.isMounting?e.enter:e.appear;return n.appearStatus=null,e.in?r?(i=Jt,n.appearStatus=zt):i=$t:i=e.unmountOnExit||e.mountOnEnter?Kt:Jt,n.state={status:i},n.nextCallback=null,n}Ft(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Kt?{status:Jt}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var a=this.state.status;this.props.in?a!==zt&&a!==$t&&(e=zt):a!==zt&&a!==$t||(e=qt)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,a,n=this.props.timeout;return t=e=a=n,null!=n&&"number"!=typeof n&&(t=n.exit,e=n.enter,a=void 0!==n.appear?n.appear:e),{exit:t,enter:e,appear:a}},n.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===zt){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this);a&&Wt(a)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jt&&this.setState({status:Kt})},n.performEnter=function(t){var e=this,a=this.props.enter,n=this.context?this.context.isMounting:t,i=this.props.nodeRef?[n]:[vt().findDOMNode(this),n],r=i[0],o=i[1],l=this.getTimeouts(),s=n?l.appear:l.enter;t||a?(this.props.onEnter(r,o),this.safeSetState({status:zt},(function(){e.props.onEntering(r,o),e.onTransitionEnd(s,(function(){e.safeSetState({status:$t},(function(){e.props.onEntered(r,o)}))}))}))):this.safeSetState({status:$t},(function(){e.props.onEntered(r)}))},n.performExit=function(){var t=this,e=this.props.exit,a=this.getTimeouts(),n=this.props.nodeRef?void 0:vt().findDOMNode(this);e?(this.props.onExit(n),this.safeSetState({status:qt},(function(){t.props.onExiting(n),t.onTransitionEnd(a.exit,(function(){t.safeSetState({status:Jt},(function(){t.props.onExited(n)}))}))}))):this.safeSetState({status:Jt},(function(){t.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,a=!0;return this.nextCallback=function(n){a&&(a=!1,e.nextCallback=null,t(n))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(t,e){this.setNextCallback(e);var a=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this),n=null==t&&!this.props.addEndListener;if(a&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],r=i[0],o=i[1];this.props.addEndListener(r,o)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if(t===Kt)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,Lt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a().createElement(Bt.Provider,{value:null},"function"==typeof n?n(t,i):a().cloneElement(a().Children.only(n),i))},e}(a().Component);function Yt(){}Vt.contextType=Bt,Vt.propTypes={},Vt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yt,onEntering:Yt,onEntered:Yt,onExit:Yt,onExiting:Yt,onExited:Yt},Vt.UNMOUNTED=Kt,Vt.EXITED=Jt,Vt.ENTERING=zt,Vt.ENTERED=$t,Vt.EXITING=qt;const Xt=Vt;var Qt=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return n=e,void((a=t).classList?a.classList.remove(n):"string"==typeof a.className?a.className=Ht(a.className,n):a.setAttribute("class",Ht(a.className&&a.className.baseVal||"",n)));var a,n}))},Zt=function(t){function e(){for(var e,a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(t,a){var n=e.resolveArguments(t,a),i=n[0],r=n[1];e.removeClasses(i,"exit"),e.addClass(i,r?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(t,a)},e.onEntering=function(t,a){var n=e.resolveArguments(t,a),i=n[0],r=n[1]?"appear":"enter";e.addClass(i,r,"active"),e.props.onEntering&&e.props.onEntering(t,a)},e.onEntered=function(t,a){var n=e.resolveArguments(t,a),i=n[0],r=n[1]?"appear":"enter";e.removeClasses(i,r),e.addClass(i,r,"done"),e.props.onEntered&&e.props.onEntered(t,a)},e.onExit=function(t){var a=e.resolveArguments(t)[0];e.removeClasses(a,"appear"),e.removeClasses(a,"enter"),e.addClass(a,"exit","base"),e.props.onExit&&e.props.onExit(t)},e.onExiting=function(t){var a=e.resolveArguments(t)[0];e.addClass(a,"exit","active"),e.props.onExiting&&e.props.onExiting(t)},e.onExited=function(t){var a=e.resolveArguments(t)[0];e.removeClasses(a,"exit"),e.addClass(a,"exit","done"),e.props.onExited&&e.props.onExited(t)},e.resolveArguments=function(t,a){return e.props.nodeRef?[e.props.nodeRef.current,t]:[t,a]},e.getClassNames=function(t){var a=e.props.classNames,n="string"==typeof a,i=n?(n&&a?a+"-":"")+t:a[t];return{baseClassName:i,activeClassName:n?i+"-active":a[t+"Active"],doneClassName:n?i+"-done":a[t+"Done"]}},e}Ft(e,t);var n=e.prototype;return n.addClass=function(t,e,a){var n=this.getClassNames(e)[a+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===e&&"done"===a&&i&&(n+=" "+i),"active"===a&&t&&Wt(t),n&&(this.appliedClasses[e][a]=n,function(t,e){t&&e&&e.split(" ").forEach((function(e){return n=e,void((a=t).classList?a.classList.add(n):function(t,e){return t.classList?!!e&&t.classList.contains(e):-1!==(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")}(a,n)||("string"==typeof a.className?a.className=a.className+" "+n:a.setAttribute("class",(a.className&&a.className.baseVal||"")+" "+n)));var a,n}))}(t,n))},n.removeClasses=function(t,e){var a=this.appliedClasses[e],n=a.base,i=a.active,r=a.done;this.appliedClasses[e]={},n&&Qt(t,n),i&&Qt(t,i),r&&Qt(t,r)},n.render=function(){var t=this.props,e=(t.classNames,Lt(t,["classNames"]));return a().createElement(Xt,At({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(a().Component);Zt.defaultProps={classNames:""},Zt.propTypes={};const te=Zt,ee=({title:t=(0,n.__)("Save","gtm-kit"),className:a="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{useUpdateSettings:o,useIsPending:l,useCanSave:s}=(0,i.useContext)(g);return(0,e.createElement)(r.Button,{className:a,onClick:()=>o(),variant:"primary",disabled:l||!s},s?(0,n.__)(t,"gtm-kit"):(0,n.__)("Saved","gtm-kit"),l?(0,e.createElement)(r.Spinner,null):"")},ae=()=>{const{useCanSave:t}=(0,i.useContext)(g);return(0,e.createElement)(te,{in:t,timeout:500,classNames:"slide",unmountOnExit:!0},(0,e.createElement)("footer",{className:"gtmkit-fixed gtmkit-bottom-0 gtmkit-w-full gtmkit-z-10 gtmkit-bg-color-grey gtmkit-text-white gtmkit-p-8"},(0,e.createElement)(ee,null)))},ne=({subject:t})=>{const a=!0===t||"on"===t,i=!0===a?"gtmkit-bg-color-success":"gtmkit-bg-color-button-disabled";return(0,e.createElement)("div",{className:"gtmkit-text-xs gtmkit-text-white gtmkit-font-bold gtmkit-rounded-full gtmkit-py gtmkit-px-2 gtmkit-h-5 gtmkit-leading-5 gtmkit-uppercase "+i},a?(0,n.__)("Active","gtm-kit"):(0,n.__)("Inactive","gtm-kit"))},ie=(0,i.forwardRef)((({children:t,className:a="",...n},i)=>(0,e.createElement)("div",{...n,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 gtmkit-group gtmkit-w-full "+a,ref:i},t)));ie.Header=({as:t="h3",title:a="",children:n,className:i="",...r})=>(0,e.createElement)("div",{...r,className:"gtmkit-flex gtmkit-justify-between gtmkit-items-center gtmkit-mb-5 "+i},(0,e.createElement)(t,{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading"},a),n),ie.Content=({as:t="div",children:a,className:n="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:n},a),ie.Button=({url:t,destination:a,newTab:n=!1,text:i,group:o="",...l})=>{const s=nt();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-rounded !gtmkit-py-4 !gtmkit-px-8 gtmkit-w-full sm:gtmkit-w-auto gtmkit-min-w-[225px]",onClick:()=>{a&&t&&!1===n?window.gtmkitSettings.current_poage===o?s(a,{replace:!0}):window.location.href=t+"#"+a:t?n?window.open(t):window.location.href=t:s(a,{replace:!0})}},(0,e.createElement)("span",{className:"gtmkit-mx-auto gtmkit-text-sm gtmkit-font-bold"},i)))};const re=ie,oe=({title:t,data:a,className:r=""})=>{const{useSettings:o}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8 gtmkit-mt-6"},t),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px] "+r},a.map(((t,a)=>!1===t.featured?null:(0,e.createElement)(re,{key:a},(0,e.createElement)(re.Header,{title:t.title},t.pill?(0,e.createElement)(ne,{subject:o[t.group][t.option]}):null),(0,e.createElement)(re.Content,null,t.text.map(((t,a)=>(0,e.createElement)("p",{key:a},t)))),(0,e.createElement)(re.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,n.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))},le=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,n.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,n.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,n.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,n.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,n.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,n.__)("Setup integration","gtm-kit")}}],se=[{title:"Getting started with GTM Kit",text:[(0,n.__)("How to get the most out of Google Tag Manager with GTM Kit.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!0},{title:(0,n.__)("WooCommerce integration","gtm-kit"),text:[(0,n.__)("Integrate WooCommerce with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=dashboard-tutorials"},featured:!0},{title:"Contact Form 7 Integration",text:[(0,n.__)("Integrate Contact Form 7 with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/contact-form-7-integration/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Easy Digital Downloads integration",text:[(0,n.__)("Integrate Easy Digital Downloads with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/set-up-easy-digital-downloads-for-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Advanced GTM container implementation",text:[(0,n.__)("Customization of the GTM container implementation and Server Side Tracking.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Settings, actions and filters for developers",text:[(0,n.__)("One of the things that makes GTM Kit a great tool for developers is the ability to override options in wp-config.php.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1}],me=()=>{const{useSettings:t}=(0,i.useContext)(g),[a,r]=(0,i.useState)(se),o=Boolean(t.general.sgtm_domain&&t.general.sgtm_domain.trim());return(0,i.useEffect)((()=>{r((t=>[...t,{title:(0,n.__)("See all tutorials…","gtm-kit"),text:[(0,n.__)("See all our tutorial and get the most out of GTM Kit","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=documentation&utm_content=dashboard-tutorials",text:(0,n.__)("Read articles","gtm-kit")},featured:!0}]))}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("General","gtm-kit")),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 lg:gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px]"},(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ne,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(re.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,n.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,n.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,n.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,n.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ne,{subject:o})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,n.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,n.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,n.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ne,{subject:t.general.analytics_active})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,n.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/misc",text:(0,n.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(oe,{title:(0,n.__)("Tutorials","gtm-kit"),data:a}),(0,e.createElement)(oe,{title:(0,n.__)("Integrations","gtm-kit"),data:le}))},ce=({title:t,placeholder:a,help:n,className:o="gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",optionGroup:l="general",optionName:s,isDisabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,i.useContext)(g);return(0,e.createElement)(r.TextControl,{label:t,placeholder:a,help:n,className:o,value:c[l][s],onChange:t=>u(l,s,t),disabled:m})},ge=({title:t,label:a,optionGroup:n="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(r.BaseControl,{label:t},(0,e.createElement)(r.ToggleControl,{label:a,checked:!l&&s[n][o],onChange:()=>{m(n,o,!(s&&s[n][o]))},disabled:l}))))},ue=({title:t,options:a,help:n,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,i.useContext)(g);return(0,e.createElement)(r.RadioControl,{label:t,options:a,help:n,className:o,selected:parseInt(c[l][s]),onChange:t=>u(l,s,t),disabled:m})},de=(0,i.forwardRef)((({children:t,className:a="",disabled:n=!1,...i},r)=>(0,e.createElement)("div",{...i,className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-w-3/4 gtmkit-border-color-grey "+a+(n?"gtmkit-opacity-60":""),ref:r},t)));de.Header=({as:t="h3",title:a="",children:n,className:i="",...r})=>(0,e.createElement)(t,{...r,className:"gtmkit-font-bold gtmkit-text-lg gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey "+i},a,n),de.Content=({as:t="div",children:a,className:n="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+n},a);const pe=de,he=()=>{const{useSettings:t}=(0,i.useContext)(g),a=!(t.general.sgtm_domain&&t.general.sgtm_domain.trim()&&t.general.sgtm_container_identifier&&t.general.sgtm_container_identifier.trim());return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("General Container Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit")),(0,e.createElement)(ce,{title:(0,n.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,n.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ge,{title:(0,n.__)("Inject Container Code","gtm-kit"),label:(0,n.__)("Setting this to Off will remove the Google Tag Manager container code but the data layer will remain.","gtm-kit"),optionName:"container_active"}),(0,e.createElement)(ge,{title:(0,n.__)("Just the container","gtm-kit"),label:(0,n.__)("Setting this to On will reduce the functionality to just the GTM container code. No additional data will be pushed to the datalayer regardless of any other settings.","gtm-kit"),optionName:"just_the_container"}),(0,e.createElement)(ce,{title:(0,n.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,n.__)("The default name of the data layer object is dataLayer. If you prefer to use a different name for your data layer, you may do.","gtm-kit")}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,n.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,n.__)("Enter domain …","gtm-kit"),help:(0,n.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,n.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,n.__)("Enter loader name …","gtm-kit"),help:(0,n.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ge,{title:(0,n.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,n.__)("Prolong cookie lifetime in Safari and other browsers with ITP. This only works if you use Stape sGTM hosting and have set up the Cookie Keeper power up.","gtm-kit"),optionName:"sgtm_cookie_keeper",disabled:a})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/google-tag-manager-server-side-tagging/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=sgtm&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Setting up server-side tracking can be challenging and costly but there is an easy and cheap solution.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Stape.io is a solution for hosting server-side Google Tag Manager containers, offering a simplified approach that demands less technical expertise than solutions like Google Cloud Platform.","gtm-kit")," ",(0,n.__)("Additionally, it provides valuable add-ons for enhanced functionality.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:"https://stape.io/?pt=tlam&rs=plugin",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Page Speed Optimization","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("load_js event","gtm-kit"),label:(0,n.__)("Setting this to On will push the event 'load_js' om page load.","gtm-kit"),optionName:"load_js_event"})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Delay JavaScript execution","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Page optimization plugins can delay the 'load_js' event and this can be used to delay the triggering og tags in Google Tag Manager.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/delay-javascript-execution-in-gtm/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=delay-js&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Tag Manager Environment","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,n.__)("gtm_auth:","gtm-kit"),optionName:"gtm_auth",placeholder:(0,n.__)("Enter gtm_auth code","gtm-kit"),help:(0,n.__)("Enter your gtm_auth code your GTM environment.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,n.__)("gtm_preview:","gtm-kit"),optionName:"gtm_preview",placeholder:(0,n.__)("Enter gtm_preview code","gtm-kit"),help:(0,n.__)("Enter your gtm_preview code your GTM environment.","gtm-kit")})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Environments","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("In Google Tag Manager you can define different environments like Live, Dev and QA.","gtm-kit")," ",(0,n.__)('To use a specific environment in GTM Kit you must enter the "gtm_auth" and "gtm_preview" codes for that environment.',"gtm-kit")," ",(0,n.__)("If left empty the default environment will be used.","gtm-kit")),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Override settings in wp-config.php","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("You can override the values of using constants in wp-config.php, which is a very useful for setting the value in your development and staging environments.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=container-settings&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,n.__)("Container code implementation:","gtm-kit"),options:[{label:(0,n.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,n.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,n.__)("Depending on how you use Google Tag Manager you can delay the loading of the container script until the browser is idle.","gtm-kit"),optionName:"script_implementation"}),(0,e.createElement)(ue,{title:(0,n.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,n.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,n.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,n.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,n.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,n.__)('The preferred method to implement the <noscript> container code is just after the opening <body> tag. This requires that your theme uses the "body_open" hook. If your theme does not support this the script can be injected in the footer or you can use the function below.',"gtm-kit"),optionName:"noscript_implementation"}),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("code",null,"<?php if ( function_exists( 'gtmkit_the_noscript_tag' ) ) { gtmkit_the_noscript_tag(); } ?>")))))},_e=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Post Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ge,{title:(0,n.__)("Post type","gtm-kit"),id:"post-type",label:(0,n.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ge,{title:(0,n.__)("Page type","gtm-kit"),id:"page-type",label:(0,n.__)('Include the defined page type. I.e. post, page, product, category, cart, checkout etc. You may override this on page-level and set you own page type i.e. "campaign".',"gtm-kit"),optionName:"datalayer_page_type"}),(0,e.createElement)(ge,{title:(0,n.__)("Categories","gtm-kit"),id:"categories",label:(0,n.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ge,{title:(0,n.__)("Tags","gtm-kit"),id:"tags",label:(0,n.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ge,{title:(0,n.__)("Post title","gtm-kit"),id:"post-title",label:(0,n.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ge,{title:(0,n.__)("Post ID","gtm-kit"),id:"post-id",label:(0,n.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ge,{title:(0,n.__)("Post data","gtm-kit"),id:"post-date",label:(0,n.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ge,{title:(0,n.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,n.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ge,{title:(0,n.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,n.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),ke=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("User Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,n.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,n.__)("Full page caching will cache user data making it the same for all users. There are ways around this, but it depends on the chosen cache solution and is only for advanced users.","gtm-kit")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,n.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ge,{title:(0,n.__)("User ID","gtm-kit"),id:"user-id",label:(0,n.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ge,{title:(0,n.__)("User role","gtm-kit"),id:"user-role",label:(0,n.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),fe=()=>{const{useSettings:t}=(0,i.useContext)(g),a=!t.general.gcm_default_settings;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,n.__)("Warning!","gtm-kit"))),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,n.__)("Most Consent Management Platforms will handle the Google Consent Mode settings for you and applying the default settings in both GTM Kit and you CMP will lead to unexpected behaviour or errors.","gtm-kit")),(0,e.createElement)("p",null,(0,n.__)("You should only use these settings if you do not have a Consent Management Platform that supports Google Consent Mode.","gtm-kit")),(0,e.createElement)("p",{className:"!gtmkit-mt-4"},(0,n.__)("GTM Kit will only set the default Consent Mode settings and you must update the settings yourself when the user has given consent.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-color-primary !gtmkit-my-6"},(0,e.createElement)("a",{href:"https://developers.google.com/tag-platform/security/guides/consent#implementation_example",target:"_blank",rel:"noreferrer",className:"hover:gtmkit-underline gtmkit-font-semibold"},(0,n.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ge,{title:(0,n.__)("Activate GCM settings","gtm-kit"),label:(0,n.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(pe,{disabled:a},(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Ad Personalization","gtm-kit"),label:(0,n.__)("Enables personalized advertising","gtm-kit"),optionName:"gcm_ad_personalization",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Ad Storage","gtm-kit"),label:(0,n.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Ad User Data","gtm-kit"),label:(0,n.__)("Enables sending user data related to advertising to Google","gtm-kit"),optionName:"gcm_ad_user_data",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Analytics Storage","gtm-kit"),label:(0,n.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Functionality Storage","gtm-kit"),label:(0,n.__)("Enables storage that supports the functionality of the website or app such as language settings","gtm-kit"),optionName:"gcm_functionality_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Personalization Storage","gtm-kit"),label:(0,n.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Security Storage","gtm-kit"),label:(0,n.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:a}))))},Ee=({label:t,value:a,tag:n})=>(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-4 gtmkit-py-2"},(0,e.createElement)("strong",null,t)),(0,e.createElement)("td",{className:"gtmkit-px-4 gtmkit-py-2"},"code"===n?(0,e.createElement)("code",{className:"gtmkit-text-sm"},a):(0,e.createElement)("em",null,a))),ve=()=>{const{useSiteData:t}=(0,i.useContext)(g),a=Object.values(t.shared_data);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,n.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,n.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm gtmkit-my-6 gtmkit-py-6"},(0,e.createElement)("tbody",{className:"gtmkit-py-6"},a.map((function(t,a){return(0,e.createElement)(Ee,{key:a,label:t.label,value:t.value,tag:t.tag})})))))},be=()=>{const{}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Misc","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ve,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,n.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ge,{title:(0,n.__)("Share anonymous data","gtm-kit"),label:(0,n.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Console log","gtm-kit"),label:(0,n.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},ye=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(oe,{title:(0,n.__)("Integrations","gtm-kit"),data:le})),xe=({pluginName:t})=>(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.sprintf)((0,n.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,n.sprintf)((0,n.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-4 !gtmkit-px-6 gtmkit-text-sm disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.pluginInstallUrl+t}},(0,n.sprintf)((0,n.__)("Install %s","gtm-kit"),t)))),Se=({title:t,options:a,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m=!1,help:c="",notSet:u=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,i.useContext)(g),h=u?[{label:(0,n.__)("(not set)","gtm-kit"),value:""},...a]:a;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(r.SelectControl,{label:t,value:d&&d[l][s],options:h,className:o,onChange:t=>p(l,s,t),disabled:m,help:c}))},we=({pluginName:t,optionName:a,pluginInactive:i})=>(0,e.createElement)(pe,{disabled:i},(0,e.createElement)(pe.Header,{title:(0,n.sprintf)((0,n.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.sprintf)((0,n.__)("Track %s","gtm-kit"),t),label:(0,n.sprintf)((0,n.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:a,disabled:i}))),Ne=[{label:(0,n.__)("Retail","gtm-kit"),value:"retail"},{label:(0,n.__)("Education","gtm-kit"),value:"education"},{label:(0,n.__)("Flights","gtm-kit"),value:"flights"},{label:(0,n.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,n.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,n.__)("Local deals","gtm-kit"),value:"local"},{label:(0,n.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,n.__)("Travel","gtm-kit"),value:"travel"},{label:(0,n.__)("Custom","gtm-kit"),value:"custom"}],Ce=()=>{const{useSettings:t}=(0,i.useContext)(g),a="WooCommerce",r=!window.gtmkitSettings.plugins.woocommerce,o=r||!t.integrations.woocommerce_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("WooCommerce","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:a}):null,(0,e.createElement)(we,{pluginName:a,optionName:"woocommerce_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Basic settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,n.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,n.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Use SKU instead of ID","gtm-kit"),label:(0,n.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_use_sku",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Exclude tax","gtm-kit"),label:(0,n.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Exclude shipping from revenue","gtm-kit"),label:(0,n.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include customer data","gtm-kit"),label:(0,n.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Event customization","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:"view_item_list (with product filter)",options:[{label:(0,n.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,n.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,n.__)("Do you what to push the view_item_list event if the list is updated using a filter or just once per page view.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_view_item_list_limit",disabled:o}),(0,e.createElement)(ue,{title:"view_item",options:[{label:(0,n.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,n.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,n.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,n.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:o}),(0,e.createElement)(ue,{title:"add_shipping_info ",options:[{label:(0,n.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,n.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,n.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,n.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:o}),(0,e.createElement)(ue,{title:"add_payment_info ",options:[{label:(0,n.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,n.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,n.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,n.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,n.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Ne,help:(0,n.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,n.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,n.__)("Enter prefix …","gtm-kit"),help:(0,n.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,n.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_dequeue_script",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include permalink structure","gtm-kit"),label:(0,n.__)("Enable this option to include the permalink structure of the product base, category base, tag base and attribute base.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_permalink_structure",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include path of pages","gtm-kit"),label:(0,n.__)("Enable this option to include the path of cart, checkout, order received and my account page.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_pages",disabled:o}))))},Te=()=>{const{useSettings:t}=(0,i.useContext)(g),a="Contact Form 7",r=!window.gtmkitSettings.plugins.cf7,o=r||!t.integrations.cf7_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Contact Form 7","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:a}):null,(0,e.createElement)(we,{pluginName:a,optionName:"cf7_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,n.__)("Load JavaScript","gtm-kit"),options:[{label:(0,n.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,n.__)("On all pages","gtm-kit"),value:2}],help:(0,n.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:o}))))},De=()=>{const t="Easy Digital Downloads",a=!window.gtmkitSettings.plugins.edd,{useSettings:r}=(0,i.useContext)(g),o=a||!r.integrations.edd_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Easy Digital Downloads","gtm-kit")),a?(0,e.createElement)(xe,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:a}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Use SKU instead of ID","gtm-kit"),label:(0,n.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"edd_use_sku",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Exclude tax","gtm-kit"),label:(0,n.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include customer data","gtm-kit"),label:(0,n.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"edd_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,n.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Ne,help:(0,n.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,n.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,n.__)("Enter prefix …","gtm-kit"),help:(0,n.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:a},(0,e.createElement)(pe.Header,{title:(0,n.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,n.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"edd_dequeue_script",disabled:o}))))},Ge=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Help","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,n.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/"},(0,n.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,n.__)("GTM container import files:","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,n.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,n.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Tutorials","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",null,se.map(((t,a)=>(0,e.createElement)("li",{key:a,className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:t.link.url,target:"_blank",rel:"noreferrer",className:"gtmkit-font-semibold gtmkit-text-color-primary hover:gtmkit-underline"},t.title),t.text.map(((t,a)=>(0,e.createElement)("div",{key:a,className:"gtmkit-text-sm"},t)))))))))),Pe=()=>{const{useIsSending:t,useSiteData:a,useUpdateSupportTicket:o,useSupportTicket:l,useSendSystemData:s,useIsSystemDataSent:m,useSystemDataMessage:c}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Get support","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Support options","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://wordpress.org/support/plugin/gtm-kit/",target:"_blank",rel:"noreferrer"},(0,n.__)("WordPress.org Support Forum","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,n.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,n.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Share system data with the GTM Kit support team","gtm-kit")}),(0,e.createElement)(pe.Content,null,m?(0,e.createElement)("p",{className:"gtmkit-mb-2"},c):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2"},(0,n.__)("If the GTM Kit support team has asked you to send your system data you can do so by entering the support ticket below:","gtm-kit")),(0,e.createElement)(r.TextControl,{label:(0,e.createElement)("span",{className:"gtmkit-text-red-600"},c," "),placeholder:(0,n.__)("Enter support ticket","gtm-kit"),className:"gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",value:l,onChange:t=>o(t)}),(0,e.createElement)(r.Button,{variant:"primary",className:"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",onClick:()=>{s()},disabled:!l.toUpperCase().startsWith("FS")},(0,e.createElement)("span",null,(0,n.__)("Send system data","gtm-kit")),t?(0,e.createElement)(r.Spinner,null):"")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("About GTM Kit","gtm-kit"),className:"gtmkit-flex gtmkit-items-center"},(0,e.createElement)("span",{className:"gtmkit-text-sm gtmkit-text-color-grey gtmkit-font-light gtmkit-ml-2"},"(",(0,n.__)("Version:","gtm-kit")," ",a.gtmkit_version,")")),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",null,(0,n.__)("Learn about changes and follow the development of GTM Kit:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,n.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary  hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,n.__)("The Github repository","gtm-kit"))))))};const Ie={integrations:(0,n.__)("Integrations","gtm-kit"),help:(0,n.__)("Help","gtm-kit")},Me=()=>{const{useSettings:t}=(0,i.useContext)(g),a=window.gtmkitSettings.currentPage,o=function({page:t}){const e=[{to:"general",title:(0,n.__)("Dashboard","gtm-kit")},{to:"container",title:(0,n.__)("Container","gtm-kit")},{to:"post-data",title:(0,n.__)("Post data","gtm-kit")},{to:"user-data",title:(0,n.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,n.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,n.__)("Misc","gtm-kit")}],a=[{to:"integrations",title:(0,n.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],i=[{to:"help",title:(0,n.__)("Help","gtm-kit")},{to:"support",title:(0,n.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return a;case"help":return i}}({page:a}),l=Ie[a]||(0,n.__)("Settings","gtm-kit");return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ot,{title:l}),(0,e.createElement)(Ut,{NavList:o}),(0,e.createElement)("main",{className:"gtmkit-max-w-[1536px] gtmkit-px-8 gtmkit-pt-8 gtmkit-text-base"},(0,e.createElement)(kt,null,(0,e.createElement)(ht,{exact:!0,path:"/general",element:(0,e.createElement)(me,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(fe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(ye,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Te,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(De,null)}),(0,e.createElement)(ht,{exact:!0,path:"/help",element:(0,e.createElement)(Ge,null)}),(0,e.createElement)(ht,{exact:!0,path:"/support",element:(0,e.createElement)(Pe,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+a})}))),(0,e.createElement)(ae,null)):(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(r.Spinner,null))},Oe=()=>(0,e.createElement)(Ct,{basename:"/"},(0,e.createElement)(u,null,(0,e.createElement)(Me,null)));document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(window.gtmkitSettings.rootId);null!=t&&(0,i.render)((0,e.createElement)(Oe,null),t)}))})();
  • gtm-kit/tags/1.19/assets/admin/wizard.asset.php

    r3016305 r3032523  
    1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'c9a2c63156ea6655e237');
     1<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'fa4589566d6a7e354484');
  • gtm-kit/tags/1.19/assets/admin/wizard.js

    r3016305 r3032523  
    1 !function(){"use strict";var t={n:function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,{a:a}),a},d:function(e,a){for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e=window.React,a=window.wp.element,n=window.wp.components,r=window.lodash,i=window.wp.apiFetch,l=t.n(i);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const o=async(t,e,a=null,n=!1)=>{let r={};try{r=await l()({path:t,method:e,...a&&{data:a}})}catch(a){return console.log(`${e} ${t} Errors:`,a),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?r:!0===r.success?r.data:options};var s=window.wp.i18n,m=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,s.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,s.__)("An error occurred.","gtm-kit"):(0,s.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage}return a};const c=(0,a.createContext)();var g,u=t=>{const[n,i]=(0,a.useReducer)(m,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),l=async()=>{const[t,e]=await Promise.all([o("gtmkit/v1/get-options","GET"),o("gtmkit/v1/get-site-data","GET")]),a="wizard"===window.gtmkitSettings.currentPage?await o("gtmkit/v1/get-install-data","GET"):{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:a}})},s=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{l()}),[]);const g={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,o("gtmkit/v1/set-options","POST",e));var e;i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:l,useUpdateState:s,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let l;i[t][e]=a,l=!(0,r.isEqual)(i,n.fetchedSettings),s({stateSettings:i,canSave:l})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const l={};l.general={...a.general,...e.general},"integrations"in e&&(l.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(l,n.fetchedSettings),s({stateSettings:l,canSave:i})},useUpdateSupportTicket:async t=>{s({supportTicket:t})},useSendSystemData:async()=>{i({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,o("gtmkit/v1/send-support-data","POST",e,!0));var e;i({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData,useIsSending:n.isSendingSystemData,useSupportTicket:n.supportTicket,useIsSystemDataSent:n.isSystemDataSent,useSystemDataMessage:n.systemDataMessage};return(0,e.createElement)(c.Provider,{value:g},t.children)};function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},d.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(g||(g={}));const p="popstate";function h(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function y(t,e){return{usr:t.state,key:t.key,idx:e}}function f(t,e,a,n){return void 0===a&&(a=null),d({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?S(e):e,{state:a,key:e&&e.key||n||Math.random().toString(36).substr(2,8)})}function E(t){let{pathname:e="/",search:a="",hash:n=""}=t;return a&&"?"!==a&&(e+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function S(t){let e={};if(t){let a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var x;function M(t,e,a){void 0===a&&(a="/");let n=U(("string"==typeof e?S(e):e).pathname||"/",a);if(null==n)return null;let r=N(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,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let i=null;for(let t=0;null==i&&t<r.length;++t)i=I(r[t],A(n));return i}function N(t,e,a,n){void 0===e&&(e=[]),void 0===a&&(a=[]),void 0===n&&(n="");let r=(t,r,i)=>{let l={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:r,route:t};l.relativePath.startsWith("/")&&(h(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),l.relativePath=l.relativePath.slice(n.length));let o=G([n,l.relativePath]),s=a.concat(l);t.children&&t.children.length>0&&(h(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),N(t.children,e,s,o)),(null!=t.path||t.index)&&e.push({path:o,score:C(o,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of v(t.path))r(t,e,a);else r(t,e)})),e}function v(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,r=a.endsWith("?"),i=a.replace(/\?$/,"");if(0===n.length)return r?[i,""]:[i];let l=v(n.join("/")),o=[];return o.push(...l.map((t=>""===t?i:[i,t].join("/")))),r&&o.push(...l),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const _=/^:\w+$/,b=3,w=2,T=1,j=10,L=-2,D=t=>"*"===t;function C(t,e){let a=t.split("/"),n=a.length;return a.some(D)&&(n+=L),e&&(n+=w),a.filter((t=>!D(t))).reduce(((t,e)=>t+(_.test(e)?b:""===e?T:j)),n)}function I(t,e){let{routesMeta:a}=t,n={},r="/",i=[];for(let t=0;t<a.length;++t){let l=a[t],o=t===a.length-1,s="/"===r?e:e.slice(r.length)||"/",m=O({path:l.relativePath,caseSensitive:l.caseSensitive,end:o},s);if(!m)return null;Object.assign(n,m.params);let c=l.route;i.push({params:n,pathname:G([r,m.pathname]),pathnameBase:B(G([r,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(r=G([r,m.pathnameBase]))}return i}function O(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[a,n]=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!0),k("*"===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 n=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,a)=>(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),r+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?r+="\\/*$":""!==t&&"/"!==t&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),r=e.match(a);if(!r)return null;let i=r[0],l=i.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:r}=e;if("*"===n){let t=o[a]||"";l=i.slice(0,i.length-t.length).replace(/(.)\/+$/,"$1")}const s=o[a];return t[n]=r&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(a){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+a+")."),t}}(s||"",n),t}),{}),pathname:i,pathnameBase:l,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return k(!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 U(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function z(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function P(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase)):a.map((t=>t.pathnameBase))}function R(t,e,a,n){let r;void 0===n&&(n=!1),"string"==typeof t?r=S(t):(r=d({},t),h(!r.pathname||!r.pathname.includes("?"),z("?","pathname","search",r)),h(!r.pathname||!r.pathname.includes("#"),z("#","pathname","hash",r)),h(!r.search||!r.search.includes("#"),z("#","search","hash",r)));let i,l=""===t||""===r.pathname,o=l?"/":r.pathname;if(null==o)i=a;else if(n){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t.pop();r.pathname=e.join("/")}i="/"+t.join("/")}else{let t=e.length-1;if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;r.pathname=e.join("/")}i=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:r=""}="string"==typeof t?S(t):t,i=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:i,search:W(n),hash:Y(r)}}(r,i),m=o&&"/"!==o&&o.endsWith("/"),c=(l||"."===o)&&a.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const G=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",Y=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const F=["post","put","patch","delete"],Q=(new Set(F),["get",...F]);function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},J.apply(this,arguments)}new Set(Q),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const H=e.createContext(null),$=e.createContext(null),Z=e.createContext(null),K=e.createContext(null),V=e.createContext({outlet:null,matches:[],isDataRoute:!1}),X=e.createContext(null);function q(){return null!=e.useContext(K)}function tt(){return q()||h(!1),e.useContext(K).location}function et(t){e.useContext(Z).static||e.useLayoutEffect(t)}function at(){let{isDataRoute:t}=e.useContext(V);return t?function(){let{router:t}=function(t){let a=e.useContext(H);return a||h(!1),a}(st.UseNavigateStable),a=ct(mt.UseNavigateStable),n=e.useRef(!1);return et((()=>{n.current=!0})),e.useCallback((function(e,r){void 0===r&&(r={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,J({fromRouteId:a},r)))}),[t,a])}():function(){q()||h(!1);let t=e.useContext(H),{basename:a,future:n,navigator:r}=e.useContext(Z),{matches:i}=e.useContext(V),{pathname:l}=tt(),o=JSON.stringify(P(i,n.v7_relativeSplatPath)),s=e.useRef(!1);return et((()=>{s.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!s.current)return;if("number"==typeof e)return void r.go(e);let i=R(e,JSON.parse(o),l,"path"===n.relative);null==t&&"/"!==a&&(i.pathname="/"===i.pathname?a:G([a,i.pathname])),(n.replace?r.replace:r.push)(i,n.state,n)}),[a,r,o,l,t])}()}function nt(t,a,n,r){q()||h(!1);let{navigator:i}=e.useContext(Z),{matches:l}=e.useContext(V),o=l[l.length-1],s=o?o.params:{},m=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let c,u=tt();if(a){var d;let t="string"==typeof a?S(a):a;"/"===m||(null==(d=t.pathname)?void 0:d.startsWith(m))||h(!1),c=t}else c=u;let p=c.pathname||"/",k=M(t,{pathname:"/"===m?p:p.slice(m.length)||"/"}),y=function(t,a,n,r){var i;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==t){var l;if(null==(l=n)||!l.errors)return null;t=n.matches}let o=t,s=null==(i=n)?void 0:i.errors;if(null!=s){let t=o.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||h(!1),o=o.slice(0,Math.min(o.length,t+1))}let m=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let t=0;t<o.length;t++){let e=o[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===n.loaderData[e.route.id]&&(!n.errors||void 0===n.errors[e.route.id])){m=!0,o=c>=0?o.slice(0,c+1):[o[0]];break}}return o.reduceRight(((t,r,i)=>{let l,g=!1,u=null,d=null;var p;n&&(l=s&&r.route.id?s[r.route.id]:void 0,u=r.route.errorElement||it,m&&(c<0&&0===i?(gt[p="route-fallback"]||(gt[p]=!0),g=!0,d=null):c===i&&(g=!0,d=r.route.hydrateFallbackElement||null)));let h=a.concat(o.slice(0,i+1)),k=()=>{let a;return a=l?u:g?d:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(ot,{match:r,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:a})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===i)?e.createElement(lt,{location:n.location,revalidation:n.revalidation,component:u,error:l,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:G([m,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:G([m,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),l,n,r);return a&&y?e.createElement(K.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:g.Pop}},y):y}function rt(){let t=function(){var t;let a=e.useContext(X),n=function(t){let a=e.useContext($);return a||h(!1),a}(mt.UseRouteError),r=ct(mt.UseRouteError);return void 0!==a?a:null==(t=n.errors)?void 0:t[r]}(),a=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(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 e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},a),n?e.createElement("pre",{style:r},n):null,null)}const it=e.createElement(rt,null);class lt extends e.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?e.createElement(V.Provider,{value:this.props.routeContext},e.createElement(X.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ot(t){let{routeContext:a,match:n,children:r}=t,i=e.useContext(H);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(V.Provider,{value:a},r)}var st=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(st||{}),mt=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}(mt||{});function ct(t){let a=function(t){let a=e.useContext(V);return a||h(!1),a}(),n=a.matches[a.matches.length-1];return n.route.id||h(!1),n.route.id}const gt={};function ut(t){let{to:a,replace:n,state:r,relative:i}=t;q()||h(!1);let{future:l,static:o}=e.useContext(Z),{matches:s}=e.useContext(V),{pathname:m}=tt(),c=at(),g=R(a,P(s,l.v7_relativeSplatPath),m,"path"===i),u=JSON.stringify(g);return e.useEffect((()=>c(JSON.parse(u),{replace:n,state:r,relative:i})),[c,u,i,n,r]),null}function dt(t){h(!1)}function pt(t){let{basename:a="/",children:n=null,location:r,navigationType:i=g.Pop,navigator:l,static:o=!1,future:s}=t;q()&&h(!1);let m=a.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:l,static:o,future:J({v7_relativeSplatPath:!1},s)})),[m,s,l,o]);"string"==typeof r&&(r=S(r));let{pathname:u="/",search:d="",hash:p="",state:k=null,key:y="default"}=r,f=e.useMemo((()=>{let t=U(u,m);return null==t?null:{location:{pathname:t,search:d,hash:p,state:k,key:y},navigationType:i}}),[m,u,d,p,k,y,i]);return null==f?null:e.createElement(Z.Provider,{value:c},e.createElement(K.Provider,{children:n,value:f}))}function ht(t){let{children:e,location:a}=t;return nt(kt(e),a)}function kt(t,a){void 0===a&&(a=[]);let n=[];return e.Children.forEach(t,((t,r)=>{if(!e.isValidElement(t))return;let i=[...a,r];if(t.type===e.Fragment)return void n.push.apply(n,kt(t.props.children,i));t.type!==dt&&h(!1),t.props.index&&t.props.children&&h(!1);let l={id:t.props.id||i.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&&(l.children=kt(t.props.children,i)),n.push(l)})),n}e.startTransition,new Promise((()=>{})),e.Component;var yt=window.ReactDOM;new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]),new Map;const ft=e.startTransition;function Et(t){let{basename:a,children:n,future:r,window:i}=t,l=e.useRef();null==l.current&&(l.current=function(t){return void 0===t&&(t={}),function(t,e,a,n){void 0===n&&(n={});let{window:r=document.defaultView,v5Compat:i=!1}=n,l=r.history,o=g.Pop,s=null,m=c();function c(){return(l.state||{idx:null}).idx}function u(){o=g.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:o,location:S.location,delta:e})}function k(t){let e="null"!==r.location.origin?r.location.origin:r.location.href,a="string"==typeof t?t:E(t);return h(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==m&&(m=0,l.replaceState(d({},l.state,{idx:m}),""));let S={get action(){return o},get location(){return t(r,l)},listen(t){if(s)throw new Error("A history only accepts one active listener");return r.addEventListener(p,u),s=t,()=>{r.removeEventListener(p,u),s=null}},createHref(t){return e(r,t)},createURL:k,encodeLocation(t){let e=k(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=g.Push;let n=f(S.location,t,e);a&&a(n,t),m=c()+1;let u=y(n,m),d=S.createHref(n);try{l.pushState(u,"",d)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;r.location.assign(d)}i&&s&&s({action:o,location:S.location,delta:1})},replace:function(t,e){o=g.Replace;let n=f(S.location,t,e);a&&a(n,t),m=c();let r=y(n,m),u=S.createHref(n);l.replaceState(r,"",u),i&&s&&s({action:o,location:S.location,delta:0})},go(t){return l.go(t)}};return S}((function(t,e){let{pathname:a="/",search:n="",hash:r=""}=S(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),f("",{pathname:a,search:n,hash:r},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:E(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:i,v5Compat:!0}));let o=l.current,[s,m]=e.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=e.useCallback((t=>{c&&ft?ft((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>o.listen(u)),[o,u]),e.createElement(pt,{basename:a,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var St,xt;yt.flushSync,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"}(St||(St={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(xt||(xt={}));var Mt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l}=(0,a.useContext)(c),o=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"md:gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-16 gtmkit-mb-20"},(0,e.createElement)("div",{className:""},(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-w-full !gtmkit-px-8 "},(0,e.createElement)(n.TextControl,{label:(0,s.__)("Container ID","gtm-kit"),placeholder:(0,s.__)("Enter Container ID","gtm-kit"),value:t&&t.general.gtm_id,className:"gtmkit-text-center",onChange:t=>r("general","gtm_id",t)})),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/essential-settings",{replace:!0})},disabled:l||!t.general.gtm_id.includes("-")},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):""))),(0,e.createElement)("div",{className:"gtmkit-mt-8 gtmkit-border gtmkit-p-6 gtmkit-text-left gtmkit-text-color-grey gtmkit-text-center"},(0,e.createElement)("h2",{className:"gtmkit-font-bold gtmkit-text-base gtmkit-mb-4"},"Need help?"),(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,s.__)("Find your GTM container ID on","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-underline",href:"https://tagmanager.google.com/",target:"_blank",rel:"noreferrer"},"Google Tag Manager")),(0,e.createElement)("p",null,(0,s.__)("It should look something like this:","gtm-kit")," ","GTM-12ZM7SF4"))),(0,e.createElement)("div",{className:"gtmkit-mt-3 md:gtmkit-mt-10 gtmkit-text-color-grey gtmkit-text-base"},(0,e.createElement)("span",{className:"gtmkit-block"},(0,s.__)("No thanks. I know what I'm doing.","gtm-kit")),(0,e.createElement)("a",{className:"gtmkit-underline gtmkit-ml-4",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit"))))},Nt=()=>{const{useImportSettings:t,useIsPending:r,useInstallData:i}=(0,a.useContext)(c),[l,o]=(0,a.useState)(!0),m=Object.keys(i.import_data)[0],[g,u]=(0,a.useState)(m),d=[];return Object.keys(i.import_data).forEach((t=>{d.push({value:t,label:i.import_data[t].name})})),l?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto gtmkit-border gtmkit-py-8 gtmkit-my-8"},(0,e.createElement)("h2",{className:"gtmkit-text-lg gtmkit-text-color-heading gtmkit-font-bold"},(0,s.__)("Would you like to import plugin settings?","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-my-4 gtmkit-text-color-grey"},(0,s.__)("We have found the configuration of other plugins in the database.","gtm-kit")," ",(0,s.__)("Would you like to import your settings to GTM Kit?","gtm-kit")),(0,e.createElement)(n.RadioControl,{help:(0,s.__)("Select the plugin you want to import settings from.","gtm-kit"),selected:g,options:d,onChange:t=>u(t)}),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{t(g,i.import_data[g]),o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("Yes","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):""),(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("No","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):"")))):(0,e.createElement)(Mt,null)},vt=()=>{const{useInstallData:t}=(0,a.useContext)(c),{firstInstall:n}=t,{importAvailable:r}=t;return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("You've successfully installed GTM Kit!","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit"))),n&&r?(0,e.createElement)(Nt,null):(0,e.createElement)(Mt,null))},_t=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useInstallData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("Essential Settings","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("There are a lot of settings in GTM Kit and we recommend that you uses our recommended settings but you can also choose to use the default settings and go through the settings at your convenience.","gtm-kit"))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Page type","gtm-kit"),id:"page-type"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Include the page type i.e. page, product, category, cart, checkout etc in the datalayer?","gtm-kit"),checked:t&&t.general.datalayer_page_type,onChange:()=>{r("general","datalayer_page_type",!(t&&t.general.datalayer_page_type))}}))),o.woocommerce_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track WooCommerce","gtm-kit"),id:"track-wooCommerce"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from WooCommerce?","gtm-kit"),checked:t&&t.integrations.woocommerce_integration,onChange:()=>{r("integrations","woocommerce_integration",!(t&&t.integrations.woocommerce_integration))}}))):null,o.cf7_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Contact Form 7","gtm-kit"),id:"track-cf7"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track form submissions from Contact Form 7?","gtm-kit"),checked:t&&t.integrations.cf7_integration,onChange:()=>{r("integrations","cf7_integration",!(t&&t.integrations.cf7_integration))}}))):null,o.edd_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Easy Digital Downloads","gtm-kit"),id:"track-edd"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from Easy Digital Downloads?","gtm-kit"),checked:t&&t.integrations.edd_integration,onChange:()=>{r("integrations","edd_integration",!(t&&t.integrations.edd_integration))}}))):null,(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/share-anonymous-data",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},bt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useSiteData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Help improve GTM Kit","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey"},(0,s.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm"},(0,e.createElement)("tbody",null,(0,e.createElement)("tr",{className:""},(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Server type:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.web_server))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"PHP version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.php_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.wordpress_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress multisite:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.multisite?(0,s.__)("Yes","gtm-kit"):(0,s.__)("No","gtm-kit")))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current theme:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.current_theme))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current site language:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.locale))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Active plugins:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Plugin names of all active plugins"))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Anonymized GTM Kit settings:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Which GTM Kit settings are active"))))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-max !gtmkit-px-8 gtmkit-mx-auto "},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Share anonymous data","gtm-kit"),id:"share-anonymous-data"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("I agree to share anonymous data with the development team to help improve GTM Kit. ","gtm-kit"),checked:t&&t.general.analytics_active,onChange:()=>{r("general","analytics_active",!(t&&t.general.analytics_active))}}))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/getting-started",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},wt=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Your are ready to use GTM Kit!","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Your Google Tag Manager Container is now sending data to Google Tag Manager.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-12 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit")," "),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto gtmkit-mb-8"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Google Tag Manager templates","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4"},(0,s.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit")," ",(0,e.createElement)("a",{target:"_blank",className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",rel:"noreferrer"},(0,s.__)("Read the guide","gtm-kit"))),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - eCommerce","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Tutorials","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Getting started with GTM Kit","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("WooCommerce Integration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=advanced-container-implementation&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Advanced GTM container implementation","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=settings-actions-and-filters-for-developers&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Settings, actions and filters for developers","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.dashboardUrl}},(0,s.__)("Go to the dashboard","gtm-kit"))));const Tt=[{step:1,path:"/welcome",element:"Welcome",title:(0,s.__)("Welcome","gtm-kit")},{step:2,path:"/essential-settings",element:"EssentialSettings",title:(0,s.__)("Essential Settings","gtm-kit")},{step:3,path:"/share-anonymous-data",element:"ShareAnonymousData",title:(0,s.__)("Help improve GTM Kit","gtm-kit")},{step:4,path:"/getting-started",element:"GettingStarted",title:(0,s.__)("Getting Started","gtm-kit")}];var jt=({step:t,currentStep:a,totalSteps:n})=>{if(t===n)return;let r="gtmkit-h-0.5 gtmkit-w-full";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-color-border",(0,e.createElement)("div",{className:r})},Lt=({step:t,currentStep:a})=>t<a?(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"gtmkit-w-5 gtmkit-h-5 gtmkit-text-white"},(0,e.createElement)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})):t===a?(0,e.createElement)("span",{className:"gtmkit-h-2.5 gtmkit-w-2.5 gtmkit-rounded-full gtmkit-bg-color-primary"}):void 0,Dt=({step:t,currentStep:a,totalSteps:n})=>{if(0===t)return;let r="gtmkit-transition-opacity gtmkit-duration-500 gtmkit-absolute gtmkit-inset-0 gtmkit-border-2 gtmkit-flex gtmkit-items-center gtmkit-justify-center gtmkit-rounded-full gtmkit-opacity-100";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-white",r+=t>a?" gtmkit-border-color-border":" gtmkit-border-color-primary",(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"gtmkit-relative gtmkit-shrink-0 gtmkit-z-10 gtmkit-w-8 gtmkit-h-8 gtmkit-rounded-full"},(0,e.createElement)("span",{className:r},(0,e.createElement)(Lt,{step:t,currentStep:a,totalSteps:n}))),(0,e.createElement)(jt,{step:t,currentStep:a,totalSteps:n}))},Ct=()=>{const t=Tt.length-1+Tt[0].step;let a=((t,e)=>{const a=Object.keys(e);return t.filter((function(t){for(let n=0;n<a.length;n++)if(!t.hasOwnProperty(a[n])||t[a[n]]!==e[a[n]])return!1;return!0}))})(Tt,{path:tt().pathname});return a=a.length?a[0].step:0,0===a?(0,e.createElement)("div",{className:"gtmkit-my-16"}):(0,e.createElement)("div",{className:"gtmkit-mt-6 gtmkit-inset-0 gtmkit-mx-auto gtmkit-my-6 gtmkit-flex gtmkit-items-center gtmkit-max-w-xl","aria-hidden":"true"},Tt.map((function(n){return(0,e.createElement)(Dt,{key:n.step,step:n.step,currentStep:a,totalSteps:t})})))},It=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-text-center gtmkit-px-3"},(0,e.createElement)("h1",{className:"gtmkit-mt-3 md:gtmkit-mt-8 gtmkit-mb-4 gtmkit-w-[225px] gtmkit-inline-block"},(0,e.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNDY3LjEgMTU4Ni40IiBoZWlnaHQ9IjU0IiB2aWV3Qm94PSIwIDAgMTYwIDU0IiB3aWR0aD0iMTYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IGZpbGw9IiM4ODgiIGhlaWdodD0iNTQiIHJ4PSI0LjI2NSIgd2lkdGg9IjE2MCIvPjxwYXRoIGQ9Im04OC42NTkgNy4wMDJoLTQ5LjI2NmMtMi45MTUgMC01LjM3OC0uMTg0LTkuMjMgMi41OTZsLTE4Ljc0MyAxMi43NTJjLTQuNTQ5IDMuMjkyLTQuNTcxIDYuMDAxIDAgOS4zMDJsMTguNzQzIDEyLjc1MWMzLjY1MiAyLjY0NiA2LjI5OSAyLjU5NyA5LjIzIDIuNTk3aDE1LjY4NiAzMy41OGMyLjkzMS0uMDU3IDUuMzk0LTEuNzg0IDUuMzQtMy45MjN2LTMyLjIxYy0uMDEyLTIuMTM0LTIuNDA5LTMuODY1LTUuMzQtMy44NjV6IiBmaWxsPSIjMzk2OWJiIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgLTEgMTAxLjk5OTg2NyA1My45OTk1NDcpIi8+PGcgZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJtYXRyaXgoMS40NjUyMDIgMCAwIDEuNDY1MjAyIC00LjU4MjQzNiAtNy41NTMxMjYpIj48cGF0aCBkPSJtMTguMzE2IDIzLjA4Nmg0LjYzMnY2LjA1MmMtLjc1LjI0NS0xLjQ1OS40MTUtMi4xMjEuNTE0LS42NjMuMDk4LTEuMzQxLjE0OC0yLjAzMy4xNDgtMS43NjQgMC0zLjEwNi0uNTE3LTQuMDM1LTEuNTU0LS45MjktMS4wMzQtMS4zOTUtMi41MTktMS4zOTUtNC40NTcgMC0xLjg4Ni41MzgtMy4zNTYgMS42MTctNC40MSAxLjA3OC0xLjA1NCAyLjU3My0xLjU3OSA0LjQ4MS0xLjU3OSAxLjIgMCAyLjM1Ny4yMzkgMy40NjkuNzE4bC0uODIzIDEuOTc5Yy0uODUtLjQyNS0xLjczNy0uNjM3LTIuNjU3LS42MzctMS4wNzEgMC0xLjkzMi4zNTgtMi41NzIgMS4wNzctLjY0NS43MTgtLjk2OCAxLjY4NS0uOTY4IDIuODk5IDAgMS4yNjcuMjYgMi4yMzMuNzggMi45MDQuNTE2LjY2NyAxLjI3MS45OTkgMi4yNjIuOTk5LjUxNyAwIDEuMDQxLS4wNTIgMS41NzItLjE1OHYtMi40MzVoLTIuMjA5em0xMS45MTIgNi41NTVoLTIuNDc0di05LjYxNGgtMy4xNzN2LTIuMDZoOC44MTZ2Mi4wNmgtMy4xNjl6bTkuOTA4IDAtMi44MTEtOS4xNThoLS4wNzJjLjEwMyAxLjg2My4xNTQgMy4xMDUuMTU0IDMuNzI4djUuNDNoLTIuMjEzdi0xMS42NzRoMy4zNjhsMi43NjQgOC45MjdoLjA0OGwyLjkzNC04LjkyN2gzLjM2OXYxMS42NzRoLTIuMzA4di01LjUyNWMwLS4yNjEgMC0uNTYxLjAwOS0uOTAzLjAwOS0uMzQxLjA0OC0xLjI0Ni4xMTItMi43MTZoLS4wNzRsLTMuMDExIDkuMTQ0eiIvPjxwYXRoIGQ9Im04OC44ODMgMzEuODk4aC0zLjgxMWwtNC4xNDctNi42Ny0xLjQxNyAxLjAxOHY1LjY1MmgtMy4zNTd2LTE1LjgzaDMuMzU3djcuMjQybDEuMzE4LTEuODYxIDQuMjkzLTUuMzgxaDMuNzI0bC01LjUyMyA3LjAwNnptMS41ODktMTUuMjMzYzAtMS4wNzUuNi0xLjYxNCAxLjgtMS42MTQgMS4xOTkgMCAxLjc5OC41MzkgMS43OTggMS42MTQgMCAuNTEyLS4xNDguOTEtLjQ1IDEuMTk2LS4yOTcuMjg0LS43NDkuNDI5LTEuMzQ4LjQyOS0xLjIgMC0xLjgtLjU0My0xLjgtMS42MjV6bTMuNDQ5IDE1LjIzM2gtMy4zMDJ2LTEyLjEwNGgzLjMwMnptOC41NjMtMi40MTNjLjU3OCAwIDEuMjcxLS4xMjggMi4wNzctLjM4djIuNDU2Yy0uODIuMzctMS44MzEuNTUyLTMuMDMxLjU1Mi0xLjMyNCAwLTIuMjgtLjMzMy0yLjg4NS0xLjAwMS0uNjAyLS42NjctLjkwMi0xLjY2OC0uOTAyLTMuMDAzdi01LjgzNWgtMS41ODV2LTEuMzk5bDEuODIzLTEuMTAzLjk0OS0yLjU1N2gyLjExNXYyLjU3OWgzLjM4OHYyLjQ4aC0zLjM4OHY1LjgzNWMwIC40NjcuMTI5LjgxNS4zOTMgMS4wNDEuMjY0LjIyMi42MTQuMzM1IDEuMDQ2LjMzNXoiLz48L2c+PC9zdmc+",alt:(0,s.__)("GTM Kit","gtm-kit"),className:"gtmkit-w-full"}))),(0,e.createElement)(Ct,null)),Ot=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("footer",{className:"gtm-kit-settings-footer gtmkit-my-8 gtmkit-text-color-grey"},(0,e.createElement)("p",{className:"gtmkit-mx-auto gtmkit-max-w-max"},(0,e.createElement)("a",{className:"gtmkit-underline",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit")))));const At=()=>{const{useSettings:t}=(0,a.useContext)(c);return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,null),(0,e.createElement)("main",{className:"gtmkit-max-w-3xl gtmkit-bg-white gtmkit-border-1 gtmkit-border-color-border gtmkit-rounded-md gtmkit-mx-auto gtmkit-py-12 gtmkit-px-16 gtmkit-text-base"},(0,e.createElement)(ht,null,(0,e.createElement)(dt,{exact:!0,path:"/welcome",element:(0,e.createElement)(vt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/essential-settings",element:(0,e.createElement)(_t,null)}),(0,e.createElement)(dt,{exact:!0,path:"/share-anonymous-data",element:(0,e.createElement)(bt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/getting-started",element:(0,e.createElement)(wt,null)}),(0,e.createElement)(dt,{path:"/",element:(0,e.createElement)(ut,{replace:!0,to:"/welcome"})}))),(0,e.createElement)(Ot,null)):(0,e.createElement)(n.Spinner,{className:"gtm-kit-settings-page-loader"})},Ut=()=>(0,e.createElement)(Et,{basename:"/"},(0,e.createElement)(u,null,(0,e.createElement)(At,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Ut,null),document.getElementById(window.gtmkitSettings.rootId))}))}();
     1(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.React,a=window.wp.element,n=window.wp.components,r=window.lodash,i=window.wp.apiFetch;var l=t.n(i);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const o=async(t,e,a=null,n=!1)=>{let r={};try{r=await l()({path:t,method:e,...a&&{data:a}})}catch(a){return console.log(`${e} ${t} Errors:`,a),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?r:!0===r.success?r.data:options},s=window.wp.i18n,m=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,s.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,s.__)("An error occurred.","gtm-kit"):(0,s.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage}return a},c=(0,a.createContext)(),g=t=>{const[n,i]=(0,a.useReducer)(m,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),l=async()=>{const[t,e]=await Promise.all([o("gtmkit/v1/get-options","GET"),o("gtmkit/v1/get-site-data","GET")]),a="wizard"===window.gtmkitSettings.currentPage?await o("gtmkit/v1/get-install-data","GET"):{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:a}})},s=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{l()}),[]);const g={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,o("gtmkit/v1/set-options","POST",e));var e;i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:l,useUpdateState:s,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let l;i[t][e]=a,l=!(0,r.isEqual)(i,n.fetchedSettings),s({stateSettings:i,canSave:l})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const l={};l.general={...a.general,...e.general},"integrations"in e&&(l.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(l,n.fetchedSettings),s({stateSettings:l,canSave:i})},useUpdateSupportTicket:async t=>{s({supportTicket:t})},useSendSystemData:async()=>{i({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,o("gtmkit/v1/send-support-data","POST",e,!0));var e;i({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData,useIsSending:n.isSendingSystemData,useSupportTicket:n.supportTicket,useIsSystemDataSent:n.isSystemDataSent,useSystemDataMessage:n.systemDataMessage};return(0,e.createElement)(c.Provider,{value:g},t.children)};function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},u.apply(this,arguments)}var d;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(d||(d={}));const p="popstate";function h(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function y(t,e){return{usr:t.state,key:t.key,idx:e}}function f(t,e,a,n){return void 0===a&&(a=null),u({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?S(e):e,{state:a,key:e&&e.key||n||Math.random().toString(36).substr(2,8)})}function E(t){let{pathname:e="/",search:a="",hash:n=""}=t;return a&&"?"!==a&&(e+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function S(t){let e={};if(t){let a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var x;function M(t,e,a){void 0===a&&(a="/");let n=U(("string"==typeof e?S(e):e).pathname||"/",a);if(null==n)return null;let r=N(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,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let i=null;for(let t=0;null==i&&t<r.length;++t)i=I(r[t],A(n));return i}function N(t,e,a,n){void 0===e&&(e=[]),void 0===a&&(a=[]),void 0===n&&(n="");let r=(t,r,i)=>{let l={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:r,route:t};l.relativePath.startsWith("/")&&(h(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),l.relativePath=l.relativePath.slice(n.length));let o=G([n,l.relativePath]),s=a.concat(l);t.children&&t.children.length>0&&(h(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),N(t.children,e,s,o)),(null!=t.path||t.index)&&e.push({path:o,score:C(o,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of v(t.path))r(t,e,a);else r(t,e)})),e}function v(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,r=a.endsWith("?"),i=a.replace(/\?$/,"");if(0===n.length)return r?[i,""]:[i];let l=v(n.join("/")),o=[];return o.push(...l.map((t=>""===t?i:[i,t].join("/")))),r&&o.push(...l),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const _=/^:\w+$/,b=3,w=2,T=1,j=10,L=-2,D=t=>"*"===t;function C(t,e){let a=t.split("/"),n=a.length;return a.some(D)&&(n+=L),e&&(n+=w),a.filter((t=>!D(t))).reduce(((t,e)=>t+(_.test(e)?b:""===e?T:j)),n)}function I(t,e){let{routesMeta:a}=t,n={},r="/",i=[];for(let t=0;t<a.length;++t){let l=a[t],o=t===a.length-1,s="/"===r?e:e.slice(r.length)||"/",m=O({path:l.relativePath,caseSensitive:l.caseSensitive,end:o},s);if(!m)return null;Object.assign(n,m.params);let c=l.route;i.push({params:n,pathname:G([r,m.pathname]),pathnameBase:B(G([r,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(r=G([r,m.pathnameBase]))}return i}function O(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[a,n]=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!0),k("*"===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 n=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,a)=>(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),r+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?r+="\\/*$":""!==t&&"/"!==t&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),r=e.match(a);if(!r)return null;let i=r[0],l=i.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:r}=e;if("*"===n){let t=o[a]||"";l=i.slice(0,i.length-t.length).replace(/(.)\/+$/,"$1")}const s=o[a];return t[n]=r&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(a){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+a+")."),t}}(s||"",n),t}),{}),pathname:i,pathnameBase:l,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return k(!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 U(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function z(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function P(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase)):a.map((t=>t.pathnameBase))}function R(t,e,a,n){let r;void 0===n&&(n=!1),"string"==typeof t?r=S(t):(r=u({},t),h(!r.pathname||!r.pathname.includes("?"),z("?","pathname","search",r)),h(!r.pathname||!r.pathname.includes("#"),z("#","pathname","hash",r)),h(!r.search||!r.search.includes("#"),z("#","search","hash",r)));let i,l=""===t||""===r.pathname,o=l?"/":r.pathname;if(null==o)i=a;else if(n){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t.pop();r.pathname=e.join("/")}i="/"+t.join("/")}else{let t=e.length-1;if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;r.pathname=e.join("/")}i=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:r=""}="string"==typeof t?S(t):t,i=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:i,search:W(n),hash:Y(r)}}(r,i),m=o&&"/"!==o&&o.endsWith("/"),c=(l||"."===o)&&a.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const G=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",Y=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const F=["post","put","patch","delete"],Q=(new Set(F),["get",...F]);function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},J.apply(this,arguments)}new Set(Q),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const H=e.createContext(null),$=e.createContext(null),Z=e.createContext(null),K=e.createContext(null),V=e.createContext({outlet:null,matches:[],isDataRoute:!1}),X=e.createContext(null);function q(){return null!=e.useContext(K)}function tt(){return q()||h(!1),e.useContext(K).location}function et(t){e.useContext(Z).static||e.useLayoutEffect(t)}function at(){let{isDataRoute:t}=e.useContext(V);return t?function(){let{router:t}=function(t){let a=e.useContext(H);return a||h(!1),a}(st.UseNavigateStable),a=ct(mt.UseNavigateStable),n=e.useRef(!1);return et((()=>{n.current=!0})),e.useCallback((function(e,r){void 0===r&&(r={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,J({fromRouteId:a},r)))}),[t,a])}():function(){q()||h(!1);let t=e.useContext(H),{basename:a,future:n,navigator:r}=e.useContext(Z),{matches:i}=e.useContext(V),{pathname:l}=tt(),o=JSON.stringify(P(i,n.v7_relativeSplatPath)),s=e.useRef(!1);return et((()=>{s.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!s.current)return;if("number"==typeof e)return void r.go(e);let i=R(e,JSON.parse(o),l,"path"===n.relative);null==t&&"/"!==a&&(i.pathname="/"===i.pathname?a:G([a,i.pathname])),(n.replace?r.replace:r.push)(i,n.state,n)}),[a,r,o,l,t])}()}function nt(t,a,n,r){q()||h(!1);let{navigator:i}=e.useContext(Z),{matches:l}=e.useContext(V),o=l[l.length-1],s=o?o.params:{},m=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let c,g=tt();if(a){var u;let t="string"==typeof a?S(a):a;"/"===m||(null==(u=t.pathname)?void 0:u.startsWith(m))||h(!1),c=t}else c=g;let p=c.pathname||"/",k=M(t,{pathname:"/"===m?p:p.slice(m.length)||"/"}),y=function(t,a,n,r){var i;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==t){var l;if(null==(l=n)||!l.errors)return null;t=n.matches}let o=t,s=null==(i=n)?void 0:i.errors;if(null!=s){let t=o.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||h(!1),o=o.slice(0,Math.min(o.length,t+1))}let m=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let t=0;t<o.length;t++){let e=o[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===n.loaderData[e.route.id]&&(!n.errors||void 0===n.errors[e.route.id])){m=!0,o=c>=0?o.slice(0,c+1):[o[0]];break}}return o.reduceRight(((t,r,i)=>{let l,g=!1,u=null,d=null;var p;n&&(l=s&&r.route.id?s[r.route.id]:void 0,u=r.route.errorElement||it,m&&(c<0&&0===i?(gt[p="route-fallback"]||(gt[p]=!0),g=!0,d=null):c===i&&(g=!0,d=r.route.hydrateFallbackElement||null)));let h=a.concat(o.slice(0,i+1)),k=()=>{let a;return a=l?u:g?d:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(ot,{match:r,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:a})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===i)?e.createElement(lt,{location:n.location,revalidation:n.revalidation,component:u,error:l,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:G([m,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:G([m,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),l,n,r);return a&&y?e.createElement(K.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:d.Pop}},y):y}function rt(){let t=function(){var t;let a=e.useContext(X),n=function(t){let a=e.useContext($);return a||h(!1),a}(mt.UseRouteError),r=ct(mt.UseRouteError);return void 0!==a?a:null==(t=n.errors)?void 0:t[r]}(),a=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(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 e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},a),n?e.createElement("pre",{style:r},n):null,null)}const it=e.createElement(rt,null);class lt extends e.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?e.createElement(V.Provider,{value:this.props.routeContext},e.createElement(X.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ot(t){let{routeContext:a,match:n,children:r}=t,i=e.useContext(H);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(V.Provider,{value:a},r)}var st=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(st||{}),mt=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}(mt||{});function ct(t){let a=function(t){let a=e.useContext(V);return a||h(!1),a}(),n=a.matches[a.matches.length-1];return n.route.id||h(!1),n.route.id}const gt={};function ut(t){let{to:a,replace:n,state:r,relative:i}=t;q()||h(!1);let{future:l,static:o}=e.useContext(Z),{matches:s}=e.useContext(V),{pathname:m}=tt(),c=at(),g=R(a,P(s,l.v7_relativeSplatPath),m,"path"===i),u=JSON.stringify(g);return e.useEffect((()=>c(JSON.parse(u),{replace:n,state:r,relative:i})),[c,u,i,n,r]),null}function dt(t){h(!1)}function pt(t){let{basename:a="/",children:n=null,location:r,navigationType:i=d.Pop,navigator:l,static:o=!1,future:s}=t;q()&&h(!1);let m=a.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:l,static:o,future:J({v7_relativeSplatPath:!1},s)})),[m,s,l,o]);"string"==typeof r&&(r=S(r));let{pathname:g="/",search:u="",hash:p="",state:k=null,key:y="default"}=r,f=e.useMemo((()=>{let t=U(g,m);return null==t?null:{location:{pathname:t,search:u,hash:p,state:k,key:y},navigationType:i}}),[m,g,u,p,k,y,i]);return null==f?null:e.createElement(Z.Provider,{value:c},e.createElement(K.Provider,{children:n,value:f}))}function ht(t){let{children:e,location:a}=t;return nt(kt(e),a)}function kt(t,a){void 0===a&&(a=[]);let n=[];return e.Children.forEach(t,((t,r)=>{if(!e.isValidElement(t))return;let i=[...a,r];if(t.type===e.Fragment)return void n.push.apply(n,kt(t.props.children,i));t.type!==dt&&h(!1),t.props.index&&t.props.children&&h(!1);let l={id:t.props.id||i.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&&(l.children=kt(t.props.children,i)),n.push(l)})),n}e.startTransition,new Promise((()=>{})),e.Component;const yt=window.ReactDOM;new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]),new Map;const ft=e.startTransition;function Et(t){let{basename:a,children:n,future:r,window:i}=t,l=e.useRef();null==l.current&&(l.current=function(t){return void 0===t&&(t={}),function(t,e,a,n){void 0===n&&(n={});let{window:r=document.defaultView,v5Compat:i=!1}=n,l=r.history,o=d.Pop,s=null,m=c();function c(){return(l.state||{idx:null}).idx}function g(){o=d.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:o,location:S.location,delta:e})}function k(t){let e="null"!==r.location.origin?r.location.origin:r.location.href,a="string"==typeof t?t:E(t);return h(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==m&&(m=0,l.replaceState(u({},l.state,{idx:m}),""));let S={get action(){return o},get location(){return t(r,l)},listen(t){if(s)throw new Error("A history only accepts one active listener");return r.addEventListener(p,g),s=t,()=>{r.removeEventListener(p,g),s=null}},createHref:t=>e(r,t),createURL:k,encodeLocation(t){let e=k(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=d.Push;let n=f(S.location,t,e);a&&a(n,t),m=c()+1;let g=y(n,m),u=S.createHref(n);try{l.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;r.location.assign(u)}i&&s&&s({action:o,location:S.location,delta:1})},replace:function(t,e){o=d.Replace;let n=f(S.location,t,e);a&&a(n,t),m=c();let r=y(n,m),g=S.createHref(n);l.replaceState(r,"",g),i&&s&&s({action:o,location:S.location,delta:0})},go:t=>l.go(t)};return S}((function(t,e){let{pathname:a="/",search:n="",hash:r=""}=S(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),f("",{pathname:a,search:n,hash:r},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:E(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:i,v5Compat:!0}));let o=l.current,[s,m]=e.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},g=e.useCallback((t=>{c&&ft?ft((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>o.listen(g)),[o,g]),e.createElement(pt,{basename:a,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var St,xt;yt.flushSync,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"}(St||(St={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(xt||(xt={}));const Mt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l}=(0,a.useContext)(c),o=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"md:gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-16 gtmkit-mb-20"},(0,e.createElement)("div",{className:""},(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-w-full !gtmkit-px-8 "},(0,e.createElement)(n.TextControl,{label:(0,s.__)("Container ID","gtm-kit"),placeholder:(0,s.__)("Enter Container ID","gtm-kit"),value:t&&t.general.gtm_id,className:"gtmkit-text-center",onChange:t=>r("general","gtm_id",t)})),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/essential-settings",{replace:!0})},disabled:l||!t.general.gtm_id.includes("-")},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):""))),(0,e.createElement)("div",{className:"gtmkit-mt-8 gtmkit-border gtmkit-p-6 gtmkit-text-left gtmkit-text-color-grey gtmkit-text-center"},(0,e.createElement)("h2",{className:"gtmkit-font-bold gtmkit-text-base gtmkit-mb-4"},"Need help?"),(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,s.__)("Find your GTM container ID on","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-underline",href:"https://tagmanager.google.com/",target:"_blank",rel:"noreferrer"},"Google Tag Manager")),(0,e.createElement)("p",null,(0,s.__)("It should look something like this:","gtm-kit")," ","GTM-12ZM7SF4"))),(0,e.createElement)("div",{className:"gtmkit-mt-3 md:gtmkit-mt-10 gtmkit-text-color-grey gtmkit-text-base"},(0,e.createElement)("span",{className:"gtmkit-block"},(0,s.__)("No thanks. I know what I'm doing.","gtm-kit")),(0,e.createElement)("a",{className:"gtmkit-underline gtmkit-ml-4",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit"))))},Nt=()=>{const{useImportSettings:t,useIsPending:r,useInstallData:i}=(0,a.useContext)(c),[l,o]=(0,a.useState)(!0),m=Object.keys(i.import_data)[0],[g,u]=(0,a.useState)(m),d=[];return Object.keys(i.import_data).forEach((t=>{d.push({value:t,label:i.import_data[t].name})})),l?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto gtmkit-border gtmkit-py-8 gtmkit-my-8"},(0,e.createElement)("h2",{className:"gtmkit-text-lg gtmkit-text-color-heading gtmkit-font-bold"},(0,s.__)("Would you like to import plugin settings?","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-my-4 gtmkit-text-color-grey"},(0,s.__)("We have found the configuration of other plugins in the database.","gtm-kit")," ",(0,s.__)("Would you like to import your settings to GTM Kit?","gtm-kit")),(0,e.createElement)(n.RadioControl,{help:(0,s.__)("Select the plugin you want to import settings from.","gtm-kit"),selected:g,options:d,onChange:t=>u(t)}),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{t(g,i.import_data[g]),o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("Yes","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):""),(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("No","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):"")))):(0,e.createElement)(Mt,null)},vt=()=>{const{useInstallData:t}=(0,a.useContext)(c),{firstInstall:n}=t,{importAvailable:r}=t;return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("You've successfully installed GTM Kit!","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit"))),n&&r?(0,e.createElement)(Nt,null):(0,e.createElement)(Mt,null))},_t=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useInstallData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("Essential Settings","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("There are a lot of settings in GTM Kit and we recommend that you uses our recommended settings but you can also choose to use the default settings and go through the settings at your convenience.","gtm-kit"))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Page type","gtm-kit"),id:"page-type"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Include the page type i.e. page, product, category, cart, checkout etc in the datalayer?","gtm-kit"),checked:t&&t.general.datalayer_page_type,onChange:()=>{r("general","datalayer_page_type",!(t&&t.general.datalayer_page_type))}}))),o.woocommerce_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track WooCommerce","gtm-kit"),id:"track-wooCommerce"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from WooCommerce?","gtm-kit"),checked:t&&t.integrations.woocommerce_integration,onChange:()=>{r("integrations","woocommerce_integration",!(t&&t.integrations.woocommerce_integration))}}))):null,o.cf7_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Contact Form 7","gtm-kit"),id:"track-cf7"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track form submissions from Contact Form 7?","gtm-kit"),checked:t&&t.integrations.cf7_integration,onChange:()=>{r("integrations","cf7_integration",!(t&&t.integrations.cf7_integration))}}))):null,o.edd_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Easy Digital Downloads","gtm-kit"),id:"track-edd"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from Easy Digital Downloads?","gtm-kit"),checked:t&&t.integrations.edd_integration,onChange:()=>{r("integrations","edd_integration",!(t&&t.integrations.edd_integration))}}))):null,(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/share-anonymous-data",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},bt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useSiteData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Help improve GTM Kit","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey"},(0,s.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm"},(0,e.createElement)("tbody",null,(0,e.createElement)("tr",{className:""},(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Server type:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.web_server))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"PHP version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.php_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.wordpress_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress multisite:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.multisite?(0,s.__)("Yes","gtm-kit"):(0,s.__)("No","gtm-kit")))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current theme:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.current_theme))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current site language:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.locale))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Active plugins:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Plugin names of all active plugins"))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Anonymized GTM Kit settings:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Which GTM Kit settings are active"))))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-max !gtmkit-px-8 gtmkit-mx-auto "},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Share anonymous data","gtm-kit"),id:"share-anonymous-data"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("I agree to share anonymous data with the development team to help improve GTM Kit. ","gtm-kit"),checked:t&&t.general.analytics_active,onChange:()=>{r("general","analytics_active",!(t&&t.general.analytics_active))}}))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/getting-started",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},wt=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Your are ready to use GTM Kit!","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Your Google Tag Manager Container is now sending data to Google Tag Manager.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-12 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit")," "),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto gtmkit-mb-8"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Google Tag Manager templates","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4"},(0,s.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit")," ",(0,e.createElement)("a",{target:"_blank",className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",rel:"noreferrer"},(0,s.__)("Read the guide","gtm-kit"))),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - eCommerce","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Tutorials","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Getting started with GTM Kit","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("WooCommerce Integration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=advanced-container-implementation&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Advanced GTM container implementation","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=settings-actions-and-filters-for-developers&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Settings, actions and filters for developers","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.dashboardUrl}},(0,s.__)("Go to the dashboard","gtm-kit")))),Tt=[{step:1,path:"/welcome",element:"Welcome",title:(0,s.__)("Welcome","gtm-kit")},{step:2,path:"/essential-settings",element:"EssentialSettings",title:(0,s.__)("Essential Settings","gtm-kit")},{step:3,path:"/share-anonymous-data",element:"ShareAnonymousData",title:(0,s.__)("Help improve GTM Kit","gtm-kit")},{step:4,path:"/getting-started",element:"GettingStarted",title:(0,s.__)("Getting Started","gtm-kit")}],jt=({step:t,currentStep:a,totalSteps:n})=>{if(t===n)return;let r="gtmkit-h-0.5 gtmkit-w-full";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-color-border",(0,e.createElement)("div",{className:r})},Lt=({step:t,currentStep:a})=>t<a?(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"gtmkit-w-5 gtmkit-h-5 gtmkit-text-white"},(0,e.createElement)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})):t===a?(0,e.createElement)("span",{className:"gtmkit-h-2.5 gtmkit-w-2.5 gtmkit-rounded-full gtmkit-bg-color-primary"}):void 0,Dt=({step:t,currentStep:a,totalSteps:n})=>{if(0===t)return;let r="gtmkit-transition-opacity gtmkit-duration-500 gtmkit-absolute gtmkit-inset-0 gtmkit-border-2 gtmkit-flex gtmkit-items-center gtmkit-justify-center gtmkit-rounded-full gtmkit-opacity-100";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-white",r+=t>a?" gtmkit-border-color-border":" gtmkit-border-color-primary",(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"gtmkit-relative gtmkit-shrink-0 gtmkit-z-10 gtmkit-w-8 gtmkit-h-8 gtmkit-rounded-full"},(0,e.createElement)("span",{className:r},(0,e.createElement)(Lt,{step:t,currentStep:a,totalSteps:n}))),(0,e.createElement)(jt,{step:t,currentStep:a,totalSteps:n}))},Ct=()=>{const t=Tt.length-1+Tt[0].step;let a=((t,e)=>{const a=Object.keys(e);return t.filter((function(t){for(let n=0;n<a.length;n++)if(!t.hasOwnProperty(a[n])||t[a[n]]!==e[a[n]])return!1;return!0}))})(Tt,{path:tt().pathname});return a=a.length?a[0].step:0,0===a?(0,e.createElement)("div",{className:"gtmkit-my-16"}):(0,e.createElement)("div",{className:"gtmkit-mt-6 gtmkit-inset-0 gtmkit-mx-auto gtmkit-my-6 gtmkit-flex gtmkit-items-center gtmkit-max-w-xl","aria-hidden":"true"},Tt.map((function(n){return(0,e.createElement)(Dt,{key:n.step,step:n.step,currentStep:a,totalSteps:t})})))},It=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-text-center gtmkit-px-3"},(0,e.createElement)("h1",{className:"gtmkit-mt-3 md:gtmkit-mt-8 gtmkit-mb-4 gtmkit-w-[225px] gtmkit-inline-block"},(0,e.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNDY3LjEgMTU4Ni40IiBoZWlnaHQ9IjU0IiB2aWV3Qm94PSIwIDAgMTYwIDU0IiB3aWR0aD0iMTYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IGZpbGw9IiM4ODgiIGhlaWdodD0iNTQiIHJ4PSI0LjI2NSIgd2lkdGg9IjE2MCIvPjxwYXRoIGQ9Im04OC42NTkgNy4wMDJoLTQ5LjI2NmMtMi45MTUgMC01LjM3OC0uMTg0LTkuMjMgMi41OTZsLTE4Ljc0MyAxMi43NTJjLTQuNTQ5IDMuMjkyLTQuNTcxIDYuMDAxIDAgOS4zMDJsMTguNzQzIDEyLjc1MWMzLjY1MiAyLjY0NiA2LjI5OSAyLjU5NyA5LjIzIDIuNTk3aDE1LjY4NiAzMy41OGMyLjkzMS0uMDU3IDUuMzk0LTEuNzg0IDUuMzQtMy45MjN2LTMyLjIxYy0uMDEyLTIuMTM0LTIuNDA5LTMuODY1LTUuMzQtMy44NjV6IiBmaWxsPSIjMzk2OWJiIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgLTEgMTAxLjk5OTg2NyA1My45OTk1NDcpIi8+PGcgZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJtYXRyaXgoMS40NjUyMDIgMCAwIDEuNDY1MjAyIC00LjU4MjQzNiAtNy41NTMxMjYpIj48cGF0aCBkPSJtMTguMzE2IDIzLjA4Nmg0LjYzMnY2LjA1MmMtLjc1LjI0NS0xLjQ1OS40MTUtMi4xMjEuNTE0LS42NjMuMDk4LTEuMzQxLjE0OC0yLjAzMy4xNDgtMS43NjQgMC0zLjEwNi0uNTE3LTQuMDM1LTEuNTU0LS45MjktMS4wMzQtMS4zOTUtMi41MTktMS4zOTUtNC40NTcgMC0xLjg4Ni41MzgtMy4zNTYgMS42MTctNC40MSAxLjA3OC0xLjA1NCAyLjU3My0xLjU3OSA0LjQ4MS0xLjU3OSAxLjIgMCAyLjM1Ny4yMzkgMy40NjkuNzE4bC0uODIzIDEuOTc5Yy0uODUtLjQyNS0xLjczNy0uNjM3LTIuNjU3LS42MzctMS4wNzEgMC0xLjkzMi4zNTgtMi41NzIgMS4wNzctLjY0NS43MTgtLjk2OCAxLjY4NS0uOTY4IDIuODk5IDAgMS4yNjcuMjYgMi4yMzMuNzggMi45MDQuNTE2LjY2NyAxLjI3MS45OTkgMi4yNjIuOTk5LjUxNyAwIDEuMDQxLS4wNTIgMS41NzItLjE1OHYtMi40MzVoLTIuMjA5em0xMS45MTIgNi41NTVoLTIuNDc0di05LjYxNGgtMy4xNzN2LTIuMDZoOC44MTZ2Mi4wNmgtMy4xNjl6bTkuOTA4IDAtMi44MTEtOS4xNThoLS4wNzJjLjEwMyAxLjg2My4xNTQgMy4xMDUuMTU0IDMuNzI4djUuNDNoLTIuMjEzdi0xMS42NzRoMy4zNjhsMi43NjQgOC45MjdoLjA0OGwyLjkzNC04LjkyN2gzLjM2OXYxMS42NzRoLTIuMzA4di01LjUyNWMwLS4yNjEgMC0uNTYxLjAwOS0uOTAzLjAwOS0uMzQxLjA0OC0xLjI0Ni4xMTItMi43MTZoLS4wNzRsLTMuMDExIDkuMTQ0eiIvPjxwYXRoIGQ9Im04OC44ODMgMzEuODk4aC0zLjgxMWwtNC4xNDctNi42Ny0xLjQxNyAxLjAxOHY1LjY1MmgtMy4zNTd2LTE1LjgzaDMuMzU3djcuMjQybDEuMzE4LTEuODYxIDQuMjkzLTUuMzgxaDMuNzI0bC01LjUyMyA3LjAwNnptMS41ODktMTUuMjMzYzAtMS4wNzUuNi0xLjYxNCAxLjgtMS42MTQgMS4xOTkgMCAxLjc5OC41MzkgMS43OTggMS42MTQgMCAuNTEyLS4xNDguOTEtLjQ1IDEuMTk2LS4yOTcuMjg0LS43NDkuNDI5LTEuMzQ4LjQyOS0xLjIgMC0xLjgtLjU0My0xLjgtMS42MjV6bTMuNDQ5IDE1LjIzM2gtMy4zMDJ2LTEyLjEwNGgzLjMwMnptOC41NjMtMi40MTNjLjU3OCAwIDEuMjcxLS4xMjggMi4wNzctLjM4djIuNDU2Yy0uODIuMzctMS44MzEuNTUyLTMuMDMxLjU1Mi0xLjMyNCAwLTIuMjgtLjMzMy0yLjg4NS0xLjAwMS0uNjAyLS42NjctLjkwMi0xLjY2OC0uOTAyLTMuMDAzdi01LjgzNWgtMS41ODV2LTEuMzk5bDEuODIzLTEuMTAzLjk0OS0yLjU1N2gyLjExNXYyLjU3OWgzLjM4OHYyLjQ4aC0zLjM4OHY1LjgzNWMwIC40NjcuMTI5LjgxNS4zOTMgMS4wNDEuMjY0LjIyMi42MTQuMzM1IDEuMDQ2LjMzNXoiLz48L2c+PC9zdmc+",alt:(0,s.__)("GTM Kit","gtm-kit"),className:"gtmkit-w-full"}))),(0,e.createElement)(Ct,null)),Ot=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("footer",{className:"gtm-kit-settings-footer gtmkit-my-8 gtmkit-text-color-grey"},(0,e.createElement)("p",{className:"gtmkit-mx-auto gtmkit-max-w-max"},(0,e.createElement)("a",{className:"gtmkit-underline",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit"))))),At=()=>{const{useSettings:t}=(0,a.useContext)(c);return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,null),(0,e.createElement)("main",{className:"gtmkit-max-w-3xl gtmkit-bg-white gtmkit-border-1 gtmkit-border-color-border gtmkit-rounded-md gtmkit-mx-auto gtmkit-py-12 gtmkit-px-16 gtmkit-text-base"},(0,e.createElement)(ht,null,(0,e.createElement)(dt,{exact:!0,path:"/welcome",element:(0,e.createElement)(vt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/essential-settings",element:(0,e.createElement)(_t,null)}),(0,e.createElement)(dt,{exact:!0,path:"/share-anonymous-data",element:(0,e.createElement)(bt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/getting-started",element:(0,e.createElement)(wt,null)}),(0,e.createElement)(dt,{path:"/",element:(0,e.createElement)(ut,{replace:!0,to:"/welcome"})}))),(0,e.createElement)(Ot,null)):(0,e.createElement)(n.Spinner,{className:"gtm-kit-settings-page-loader"})},Ut=()=>(0,e.createElement)(Et,{basename:"/"},(0,e.createElement)(g,null,(0,e.createElement)(At,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Ut,null),document.getElementById(window.gtmkitSettings.rootId))}))})();
  • gtm-kit/tags/1.19/assets/integration/woocommerce.js

    r3018660 r3032523  
    1 function gtmkitLoad(){const d=window.gtmkit_settings.datalayer_name;let a;const n={"wp-block-handpicked-products":1,"wp-block-product-best-sellers":1,"wp-block-product-category":1,"wp-block-product-new":1,"wp-block-product-on-sale":1,"wp-block-products-by-attribute":1,"wp-block-product-tag":1,"wp-block-product-top-rated":1};document.querySelectorAll(".wc-block-grid .wc-block-grid__product").forEach(function(t){var e=t.closest(".wc-block-grid"),i=t.querySelector(".gtmkit_product_data");if(e&&i){var o,r=e.classList;if(r)for(const c in n)r.contains(c)&&((o=JSON.parse(i.getAttribute("data-gtmkit_product_data"))).item_list_name=window.gtmkit_settings.wc.text[c],o.index=n[c],i.setAttribute("data-gtmkit_product_data",JSON.stringify(o)),n[c]++)}});var t=document.querySelectorAll(".gtmkit_product_data");if(t.length){const i=[];let e;t.forEach(function(t){e=JSON.parse(t.getAttribute("data-gtmkit_product_data")),i.push(e)}),window[d].push({ecommerce:null}),window[d].push({event:"view_item_list",ecommerce:{items:i}})}document.addEventListener("click",function(t){t=t.target;let e;if(!t)return!0;if(t.closest(".add_to_cart_button.ajax_add_to_cart:not(.single_add_to_cart_button)"))e="add_to_cart";else{if(!t.closest(".products")&&!t.closest(".wc-block-grid__products")||!t.closest(".add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list)"))return!0;e="add_to_wishlist"}t=t.closest(".product,.wc-block-grid__product"),t=t&&t.querySelector(".gtmkit_product_data");if(!t)return!0;t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=1,window[d].push({ecommerce:null}),window[d].push({event:e,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}})}),document.addEventListener("click",function(o){o=o.target;if(!o)return!0;let r,i=o.closest("form.cart");if(!i){let t=o.parentNode;for(;!i&&t;)i=t.querySelector("form.cart"),t=t.parentNode}if(!i)return!0;if(o.closest(".single_add_to_cart_button:not(.disabled,.input-needed)"))r="add_to_cart";else{if(!o.closest(".add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list,.disabled-add-wishlist)"))return!0;r="add_to_wishlist"}var o=i.querySelectorAll("[name=variation_id]"),t=i.classList&&i.classList.contains("grouped_form")&&!i.classList.contains("bundle_form");if(o.length){let t=1,e;a&&(o=i.querySelector("[name=quantity]"),a.quantity=o&&o.value||1,t=a.quantity,e=a.price),(a&&"add_to_cart"===r||"add_to_wishlist"===r)&&(window[d].push({ecommerce:null}),window[d].push({event:r,ecommerce:{currency:window.gtmkit_data.wc.currency,value:e*t,items:[a]}}))}else if(t){o=document.querySelectorAll(".grouped_form .gtmkit_product_data");const c=[];let i=0;if(o.forEach(function(t){let e=document.querySelectorAll("input[name=quantity\\["+t.getAttribute("data-gtmkit_product_id")+"\\]]");if(e=Number(e[0].value),0===(e=isNaN(e)?0:e)&&"add_to_cart"===r)return!0;0===e&&"add_to_wishlist"===r&&(e=1);t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=e,c.push(t),i+=t.price*t.quantity}),0===c.length)return!0;window[d].push({ecommerce:null}),window[d].push({event:r,ecommerce:{currency:window.gtmkit_data.wc.currency,value:i,items:c}})}else{t=JSON.parse(i.querySelector("[name=gtmkit_product_data]")&&i.querySelector("[name=gtmkit_product_data]").value);t.quantity=i.querySelector("[name=quantity]")&&i.querySelector("[name=quantity]").value,window[d].push({ecommerce:null}),window[d].push({event:r,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price*t.quantity,items:[t]}})}}),document.addEventListener("click",function(t){var t=t.target;return!t||!t.closest(".mini_cart_item a.remove,.product-remove a.remove")||!(t=JSON.parse(t.getAttribute("data-gtmkit_product_data")))||(window[d].push({ecommerce:null}),void window[d].push({event:"remove_from_cart",ecommerce:{items:[t]}}))});document.addEventListener("click",function(t){t=t.target;if(!t.closest(".products .product:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),.wc-block-grid__products li:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),.woocommerce-grouped-product-list-item__label a:not(.add_to_wishlist,.tinvwl_add_to_wishlist_button)"))return!0;var t=t.closest(".product,.wc-block-grid__product");let e;return!t||!(e=t.querySelector(".gtmkit_product_data"))||void 0===e.getAttribute("data-gtmkit_product_data")||!(t=JSON.parse(e.getAttribute("data-gtmkit_product_data")))||(window[d].push({ecommerce:null}),void window[d].push({event:"select_item",ecommerce:{items:[t]}}))}),jQuery(document).on("found_variation",function(t,e){if(void 0!==e){t=t.target;if(t.querySelector("[name=gtmkit_product_data]")){var t=JSON.parse(t.querySelector("[name=gtmkit_product_data]")&&t.querySelector("[name=gtmkit_product_data]").value),i=(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.variation_id,window.gtmkit_settings.wc.use_sku&&e.sku&&""!==e.sku&&(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.sku),t.price=e.display_price,[]);for(const o in e.attributes)i.push(e.attributes[o]);t.item_variant=i.filter(t=>t).join("|"),a=t,0!==window.gtmkit_settings.wc.view_item.config&&(window[d].push({ecommerce:null}),window[d].push({event:"view_item",ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}}))}}})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",gtmkitLoad):gtmkitLoad();
     1function gtmkitLoad(){const a=window.gtmkit_settings.datalayer_name;let d;const n={"wp-block-handpicked-products":1,"wp-block-product-best-sellers":1,"wp-block-product-category":1,"wp-block-product-new":1,"wp-block-product-on-sale":1,"wp-block-products-by-attribute":1,"wp-block-product-tag":1,"wp-block-product-top-rated":1};document.querySelectorAll(".wc-block-grid .wc-block-grid__product").forEach(function(t){var e=t.closest(".wc-block-grid"),i=t.querySelector(".gtmkit_product_data");if(e&&i){var r,c=e.classList;if(c)for(const o in n)c.contains(o)&&((r=JSON.parse(i.getAttribute("data-gtmkit_product_data"))).item_list_name=window.gtmkit_settings.wc.text[o],r.index=n[o],i.setAttribute("data-gtmkit_product_data",JSON.stringify(r)),n[o]++)}});var t=document.querySelectorAll(".gtmkit_product_data");if(t.length){const i=[];let e;t.forEach(function(t){e=JSON.parse(t.getAttribute("data-gtmkit_product_data")),i.push(e)}),window[a].push({ecommerce:null}),window[a].push({event:"view_item_list",ecommerce:{items:i}})}document.addEventListener("click",function(t){t=t.target;let e;if(!t)return!0;if(t.closest(".add_to_cart_button.ajax_add_to_cart:not(.single_add_to_cart_button)"))e="add_to_cart";else{if(!t.closest(".products")&&!t.closest(".wc-block-grid__products")||!t.closest(window.gtmkit_settings.wc.css_selectors.product_list_wishlist))return!0;e="add_to_wishlist"}t=t.closest(".product,.wc-block-grid__product"),t=t&&t.querySelector(".gtmkit_product_data");if(!t)return!0;t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=1,window[a].push({ecommerce:null}),window[a].push({event:e,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}})}),document.addEventListener("click",function(r){r=r.target;if(!r)return!0;let c,i=r.closest("form.cart");if(!i){let t=r.parentNode;for(;!i&&t;)i=t.querySelector("form.cart"),t=t.parentNode}if(!i)return!0;if(r.closest(".single_add_to_cart_button:not(.disabled,.input-needed)"))c="add_to_cart";else{if(!r.closest(window.gtmkit_settings.wc.css_selectors.single_product_wishlist))return!0;c="add_to_wishlist"}var r=i.querySelectorAll("[name=variation_id]"),t=i.classList&&i.classList.contains("grouped_form")&&!i.classList.contains("bundle_form");if(r.length){let t=1,e;d&&(r=i.querySelector("[name=quantity]"),d.quantity=r&&r.value||1,t=d.quantity,e=d.price),(d&&"add_to_cart"===c||"add_to_wishlist"===c)&&(window[a].push({ecommerce:null}),window[a].push({event:c,ecommerce:{currency:window.gtmkit_data.wc.currency,value:e*t,items:[d]}}))}else if(t){r=document.querySelectorAll(".grouped_form .gtmkit_product_data");const o=[];let i=0;if(r.forEach(function(t){let e=document.querySelectorAll("input[name=quantity\\["+t.getAttribute("data-gtmkit_product_id")+"\\]]");if(e=Number(e[0].value),0===(e=isNaN(e)?0:e)&&"add_to_cart"===c)return!0;0===e&&"add_to_wishlist"===c&&(e=1);t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=e,o.push(t),i+=t.price*t.quantity}),0===o.length)return!0;window[a].push({ecommerce:null}),window[a].push({event:c,ecommerce:{currency:window.gtmkit_data.wc.currency,value:i,items:o}})}else{t=JSON.parse(i.querySelector("[name=gtmkit_product_data]")&&i.querySelector("[name=gtmkit_product_data]").value);t.quantity=i.querySelector("[name=quantity]")&&i.querySelector("[name=quantity]").value,window[a].push({ecommerce:null}),window[a].push({event:c,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price*t.quantity,items:[t]}})}}),document.addEventListener("click",function(t){var t=t.target;return!t||!t.closest(".mini_cart_item a.remove,.product-remove a.remove")||!(t=JSON.parse(t.getAttribute("data-gtmkit_product_data")))||(window[a].push({ecommerce:null}),void window[a].push({event:"remove_from_cart",ecommerce:{items:[t]}}))}),document.addEventListener("click",function(t){t=t.target;if(!t.closest(window.gtmkit_settings.wc.css_selectors.product_list_select_item))return!0;var t=t.closest(".product,.wc-block-grid__product");let e;return!t||!(e=t.querySelector(".gtmkit_product_data"))||void 0===e.getAttribute("data-gtmkit_product_data")||!(t=JSON.parse(e.getAttribute("data-gtmkit_product_data")))||(window[a].push({ecommerce:null}),void window[a].push({event:"select_item",ecommerce:{items:[t]}}))}),jQuery(document).on("found_variation",function(t,e){if(void 0!==e){t=t.target;if(t.querySelector("[name=gtmkit_product_data]")){var t=JSON.parse(t.querySelector("[name=gtmkit_product_data]")&&t.querySelector("[name=gtmkit_product_data]").value),i=(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.variation_id,window.gtmkit_settings.wc.use_sku&&e.sku&&""!==e.sku&&(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.sku),t.price=e.display_price,[]);for(const r in e.attributes)i.push(e.attributes[r]);t.item_variant=i.filter(t=>t).join("|"),d=t,0!==window.gtmkit_settings.wc.view_item.config&&(window[a].push({ecommerce:null}),window[a].push({event:"view_item",ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}}))}}})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",gtmkitLoad):gtmkitLoad();
  • gtm-kit/tags/1.19/gtm-kit.php

    r3018660 r3032523  
    44 *
    55 * Plugin Name: GTM Kit
    6  * Version:     1.18.1
     6 * Version:     1.19
    77 * Plugin URI:  https://gtmkit.com/
    88 * Description: Google Tag Manager implementation focusing on flexibility and pagespeed.
    9  * Author:      TLA Media
    10  * Author URI:  https://www.tlamedia.dk/
     9 * Author:      GTM Kit
     10 * Author URI:  https://gtmkit.com/
    1111 * Text Domain: gtm-kit
    1212 * Domain Path: /languages/
     
    1919 *
    2020 * @package GTM Kit
    21  * @copyright Copyright (C) 2023, TLA Media ApS
     21 * @copyright Copyright (C) 2021-2024, TLA Media ApS
    2222 */
    2323
     
    2828}
    2929
    30 const GTMKIT_VERSION = '1.18.1';
     30const GTMKIT_VERSION = '1.19';
    3131
    3232if ( ! defined( 'GTMKIT_FILE' ) ) {
  • gtm-kit/tags/1.19/languages/gtm-kit.pot

    r3018660 r3032523  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: GTM Kit 1.18.1\n"
     5"Project-Id-Version: GTM Kit 1.19\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gtm-kit\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-01-05T14:48:44+00:00\n"
     12"POT-Creation-Date: 2024-02-06T14:22:05+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.9.0\n"
     
    4646msgstr ""
    4747
    48 #: src/Admin/AbstractOptionsPage.php:228
     48#: src/Admin/AbstractOptionsPage.php:232
    4949#: src/Admin/SetupWizard.php:179
    5050msgid "Whoops, something's not working."
    5151msgstr ""
    5252
    53 #: src/Admin/AbstractOptionsPage.php:231
     53#: src/Admin/AbstractOptionsPage.php:235
    5454#: src/Admin/SetupWizard.php:182
    5555msgid "It looks like something is preventing JavaScript from loading on your website. GTM Kit requires JavaScript in order to give you the best possible experience."
    5656msgstr ""
    5757
    58 #: src/Admin/AbstractOptionsPage.php:236
     58#: src/Admin/AbstractOptionsPage.php:240
    5959#: src/Admin/SetupWizard.php:130
    6060#: src/Admin/SetupWizard.php:187
     
    112112msgstr ""
    113113
    114 #: src/Common/Util.php:102
     114#: src/Common/Util.php:122
    115115msgid "Server type:"
    116116msgstr ""
    117117
    118 #: src/Common/Util.php:107
     118#: src/Common/Util.php:127
    119119msgid "PHP version number:"
    120120msgstr ""
    121121
    122 #: src/Common/Util.php:112
     122#: src/Common/Util.php:132
    123123msgid "WordPress version number:"
    124124msgstr ""
    125125
    126 #: src/Common/Util.php:117
     126#: src/Common/Util.php:137
    127127msgid "WordPress multisite:"
    128128msgstr ""
    129129
    130 #: src/Common/Util.php:118
     130#: src/Common/Util.php:138
    131131#: assets/admin/wizard.js:1
    132132msgid "Yes"
    133133msgstr ""
    134134
    135 #: src/Common/Util.php:118
     135#: src/Common/Util.php:138
    136136#: assets/admin/wizard.js:1
    137137msgid "No"
    138138msgstr ""
    139139
    140 #: src/Common/Util.php:122
     140#: src/Common/Util.php:142
    141141msgid "Current theme:"
    142142msgstr ""
    143143
    144 #: src/Common/Util.php:127
     144#: src/Common/Util.php:147
    145145msgid "Current site language:"
    146146msgstr ""
    147147
    148 #: src/Common/Util.php:132
     148#: src/Common/Util.php:152
    149149msgid "Active plugins:"
    150150msgstr ""
    151151
    152 #: src/Common/Util.php:133
     152#: src/Common/Util.php:153
    153153msgid "Plugin name and version of all active plugins"
    154154msgstr ""
    155155
    156 #: src/Common/Util.php:137
     156#: src/Common/Util.php:157
    157157msgid "Anonymized GTM Kit settings:"
    158158msgstr ""
    159159
    160 #: src/Common/Util.php:138
     160#: src/Common/Util.php:158
    161161msgid "Which GTM Kit settings are active"
    162162msgstr ""
     
    176176
    177177#: src/Integration/WooCommerce.php:249
    178 #: src/Integration/WooCommerce.php:948
     178#: src/Integration/WooCommerce.php:955
    179179msgid "Product Category"
    180180msgstr ""
     
    193193
    194194#: src/Integration/WooCommerce.php:253
    195 #: src/Integration/WooCommerce.php:950
     195#: src/Integration/WooCommerce.php:957
    196196msgid "Product Tag"
    197197msgstr ""
     
    205205msgstr ""
    206206
    207 #: src/Integration/WooCommerce.php:807
     207#: src/Integration/WooCommerce.php:814
    208208msgid "Grouped Product"
    209209msgstr ""
    210210
    211 #: src/Integration/WooCommerce.php:841
     211#: src/Integration/WooCommerce.php:848
    212212msgid "Search Results"
    213213msgstr ""
    214214
    215 #: src/Integration/WooCommerce.php:841
    216 #: src/Integration/WooCommerce.php:882
    217 #: src/Integration/WooCommerce.php:915
     215#: src/Integration/WooCommerce.php:848
     216#: src/Integration/WooCommerce.php:889
     217#: src/Integration/WooCommerce.php:922
    218218msgid "General Product List"
    219219msgstr ""
    220220
    221 #: src/Integration/WooCommerce.php:1099
     221#: src/Integration/WooCommerce.php:1106
    222222msgid "GTM Kit data."
    223223msgstr ""
     
    455455#: assets/admin/settings.js:1
    456456msgid "Learn more about Stape.io"
     457msgstr ""
     458
     459#: assets/admin/settings.js:1
     460msgid "Page Speed Optimization"
     461msgstr ""
     462
     463#: assets/admin/settings.js:1
     464msgid "load_js event"
     465msgstr ""
     466
     467#: assets/admin/settings.js:1
     468msgid "Setting this to On will push the event 'load_js' om page load."
     469msgstr ""
     470
     471#: assets/admin/settings.js:1
     472msgid "Delay JavaScript execution"
     473msgstr ""
     474
     475#: assets/admin/settings.js:1
     476msgid "Page optimization plugins can delay the 'load_js' event and this can be used to delay the triggering og tags in Google Tag Manager."
    457477msgstr ""
    458478
  • gtm-kit/tags/1.19/readme.txt

    r3018660 r3032523  
    1 === GTM Kit - Google Tag Manager integration ===
    2 Contributors: tlamedia, torbenlundsgaard
     1=== GTM Kit - Google Tag Manager & GA4 integration ===
     2Contributors: tlamedia, torbenlundsgaard, gtmkit
    33Donate link: https://github.com/tlamedia/gtm-kit
    44Tags: google tag manager, gtm, woocommerce, analytics, ga4, gtag, easy digital downloads
    55Tested up to: 6.4
    6 Stable tag: 1.18.1
     6Stable tag: 1.19
    77License: GPLv3
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
    99
    10 Flexible tool for generating the data layer for Google Tag Manager. Including WooCommerce data for Google Analytics 4 and support for server side GTM.
     10Flexible tool for generating the data layer for Google Tag Manager and GA4. Including WooCommerce data for Google Analytics 4 and support for server side GTM.
    1111
    1212== Description ==
     
    8989== Changelog ==
    9090
     91= 1.19 =
     92
     93Release date: 2024-02-07
     94
     95Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-1-19/).
     96
     97#### Enhancements:
     98* Add option to fire a 'load_delayed_js' event, which can be used to delay JavaScript execution in Google Tag Manager.
     99* This release comes with many behind-the-scenes improvements and general enhancements.
     100* The script settings are the same on all pages and are now cached in the object cache for better performance.
     101* The function to share system data with the support team has been improved with more data.
     102* The code has been refactored for extendability.
     103
    91104= 1.18.1 =
    92105
     
    156169* Refactoring code for simplicity and maintainability
    157170
    158 = 1.16.2 =
    159 
    160 Release date: 2023-11-15
    161 
    162 #### Bugfixes:
    163 
    164 * Fix critical JS bug.
    165 
    166 = 1.16 =
    167 
    168 Release date: 2023-11-15
    169 
    170 Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-1-16/).
    171 
    172 #### Enhancements:
    173 
    174 * Add option to include customer data from Easy Digital Downloads on the purchase event.
    175 * Added the filter 'gtmkit_datalayer_script', which allows you to filter the datalayer script.
    176 * Added the constant 'GTMKIT_EDD_DEBUG_TRACK_PURCHASE', which allows users of Easy Digital Downloads to force tracking of purchase event on every page refresh for debugging.
    177 
    178 #### Bugfixes:
    179 
    180 * Billing state and shipping stat was not included in the customer data on the 'purchase' event.
    181 
    182 #### Other:
    183 
    184 * Tested up to WordPress 6.4
    185 * Tested up to WooCommerce 8.3
    186 
    187171= Earlier versions =
    188172For the changelog of earlier versions, please refer to [the changelog on gtmkit.com](https://gtmkit.com/changelog/).
  • gtm-kit/tags/1.19/src/Admin/AbstractOptionsPage.php

    r2974164 r3032523  
    4040
    4141        add_filter( 'admin_body_class', [ $page, 'admin_body_class' ] );
     42
     43        add_action( 'activated_plugin', [ $page, 'clear_script_settings_cache' ] );
     44        add_action( 'deactivated_plugin', [ $page, 'clear_script_settings_cache' ] );
     45        add_action( 'switch_theme', [ $page, 'clear_script_settings_cache' ] );
    4246    }
    4347
     
    246250        <?php
    247251    }
     252
     253    /**
     254     * Clear the script settings cache.
     255     *
     256     * @return void
     257     */
     258    public function clear_script_settings_cache(): void {
     259        wp_cache_delete( 'gtmkit_script_settings', 'gtmkit' );
     260    }
    248261}
  • gtm-kit/tags/1.19/src/Common/Util.php

    r3016305 r3032523  
    88namespace TLA_Media\GTM_Kit\Common;
    99
     10use TLA_Media\GTM_Kit\Integration\WooCommerce;
     11
    1012/**
    1113 * Class for common utilities.
     
    2123
    2224    /**
     25     * Asset path
     26     *
     27     * @var string
     28     */
     29    public $asset_path;
     30
     31    /**
     32     * Asset URL
     33     *
     34     * @var string
     35     */
     36    public $asset_url;
     37
     38    /**
    2339     * Constructor.
    2440     *
    2541     * @param RestAPIServer $rest_api_server Instance of RestAPIServer.
    26      */
    27     public function __construct( RestAPIServer $rest_api_server ) {
     42     * @param string        $path The plugin path.
     43     * @param string        $url The plugin URL.
     44     */
     45    public function __construct( RestAPIServer $rest_api_server, string $path = GTMKIT_PATH, string $url = GTMKIT_URL ) {
    2846        $this->rest_api_server = $rest_api_server;
     47        $this->asset_path      = $path . 'assets/';
     48        $this->asset_url       = $url . 'assets/';
    2949    }
    3050
     
    5474            $data = $this->add_active_plugin_and_version( $plugin, $key, $data );
    5575        }
    56 
    5776        $data['locale'] = explode( '_', get_locale() )[0];
    5877        if ( $anonymize ) {
    5978            $data = $this->add_shared_data( $data, $wp_version );
    6079        } else {
    61             $data['support_data'] = [
    62                 'site_url' => site_url(),
    63             ];
     80            $data['support_data']['site_url'] = site_url();
     81            if ( function_exists( 'WC' ) ) {
     82                $data['support_data']['pages'] = WooCommerce::instance()->get_pages_property( [] )['pages'];
     83            }
    6484        }
    6585
     
    82102        $data['php_version']       = $this->shorten_version( phpversion() );
    83103        $data['wordpress_version'] = $this->shorten_version( $wp_version );
    84         $data['current_theme']     = \wp_get_theme()->get( 'Name' );
     104        $data['current_theme']     = ( wp_get_theme()->get( 'Template' ) ) ? ucwords( wp_get_theme()->get( 'Template' ) ) : \wp_get_theme()->get( 'Name' );
    85105        $data['active_plugins']    = $this->get_active_plugins();
    86106        $data['multisite']         = \is_multisite();
     
    121141            5 => [
    122142                'label' => __( 'Current theme:', 'gtm-kit' ),
    123                 'value' => \wp_get_theme()->get( 'Name' ),
     143                'value' => ( wp_get_theme()->get( 'Template' ) ) ? ucwords( wp_get_theme()->get( 'Template' ) ) : \wp_get_theme()->get( 'Name' ),
    124144                'tag'   => 'code',
    125145            ],
     
    266286
    267287        if ( $has_asset_file ) {
    268             $file = GTMKIT_PATH . 'assets/' . substr_replace( $script, '.asset.php', - strlen( '.js' ) );
     288            $file = $this->asset_path . substr_replace( $script, '.asset.php', - strlen( '.js' ) );
    269289            if ( file_exists( $file ) ) {
    270290                $deps_file = require $file;
     
    277297        $deps[] = 'gtmkit-container';
    278298
    279         \wp_enqueue_script( $handle, GTMKIT_URL . 'assets/' . $script, $deps, $ver, $args );
     299        \wp_enqueue_script( $handle, $this->asset_url . $script, $deps, $ver, $args );
    280300    }
    281301}
  • gtm-kit/tags/1.19/src/Frontend/Frontend.php

    r3016305 r3032523  
    6060        }
    6161
     62        if ( $options->get( 'general', 'load_js_event' ) ) {
     63            add_action( 'wp_enqueue_scripts', [ $page, 'enqueue_delay_js_script' ] );
     64        }
     65
    6266        if ( $noscript_implementation === '0' && $container_active ) {
    6367            add_action( 'wp_body_open', [ $page, 'get_body_script' ] );
     
    7579     */
    7680    public function enqueue_settings_and_data_script(): void {
    77         $settings = [
    78             'datalayer_name' => $this->datalayer_name,
    79             'console_log'    => $this->options->get( 'general', 'console_log' ),
    80         ];
     81        $settings = wp_cache_get( 'gtmkit_script_settings', 'gtmkit' );
     82        if ( ! $settings ) {
     83
     84            $settings = apply_filters(
     85                'gtmkit_header_script_settings',
     86                [
     87                    'datalayer_name' => $this->datalayer_name,
     88                    'console_log'    => $this->options->get( 'general', 'console_log' ),
     89                ]
     90            );
     91
     92            wp_cache_set( 'gtmkit_script_settings', $settings, 'gtmkit' );
     93        }
    8194
    8295        ob_start();
    8396        ?>
    84         window.gtmkit_settings = <?php echo wp_json_encode( apply_filters( 'gtmkit_header_script_settings', $settings ), JSON_FORCE_OBJECT ); ?>;
     97        window.gtmkit_settings = <?php echo wp_json_encode( $settings, JSON_FORCE_OBJECT ); ?>;
    8598        window.gtmkit_data = <?php echo wp_json_encode( apply_filters( 'gtmkit_header_script_data', [] ), JSON_FORCE_OBJECT ); ?>;
    8699        window.<?php echo esc_js( $this->datalayer_name ); ?> = window.<?php echo esc_js( $this->datalayer_name ); ?> || [];
     
    169182
    170183    /**
     184     * This script fires the 'delay_js' event in Google Tag Manager
     185     */
     186    public function enqueue_delay_js_script(): void {
     187
     188        $script = esc_attr( $this->datalayer_name ) . '.push({"event" : "load_delayed_js"});' . "\n";
     189
     190        wp_register_script( 'gtmkit-delay', '', [ 'gtmkit-container' ], GTMKIT_VERSION, [ 'strategy' => 'defer' ] );
     191        wp_enqueue_script( 'gtmkit-delay' );
     192        wp_add_inline_script( 'gtmkit-delay', $script, 'before' );
     193    }
     194
     195    /**
    171196     * Get GTM script
    172197     *
     
    204229    public function set_inline_script_attributes( array $attributes, string $script ): array { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
    205230        if ( isset( $attributes['id'] ) && strpos( $attributes['id'], 'gtmkit-' ) === 0 ) {
     231
     232            if ( strpos( $attributes['id'], 'gtmkit-delay' ) === 0 ) {
     233                return $attributes;
     234            }
     235
    206236            $script_attributes = apply_filters(
    207237                'gtmkit_header_script_attributes',
  • gtm-kit/tags/1.19/src/Integration/WooCommerce.php

    r3018660 r3032523  
    256256            'payment-method-not-found'       => __( 'Payment method not found', 'gtm-kit' ),
    257257        ];
     258        $global_settings['wc']['css_selectors']               = [
     259            'single_product_wishlist'  => '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list,.disabled-add-wishlist)',
     260            'product_list_select_item' => '.products .product:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' .
     261                                        '.wc-block-grid__products li:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' .
     262                                        '.woocommerce-grouped-product-list-item__label a:not(.add_to_wishlist,.tinvwl_add_to_wishlist_button)',
     263            'product_list_wishlist'    => '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list)',
     264        ];
    258265
    259266        return $global_settings;
     
    601608     * @return array The datalayer content
    602609     */
    603     private function get_pages_property( array $data_layer ): array {
     610    public function get_pages_property( array $data_layer ): array {
    604611        $data_layer['pages'] = [
    605612            'cart'          => str_replace( \home_url(), '', \wc_get_cart_url() ),
  • gtm-kit/tags/1.19/src/Options.php

    r3004949 r3032523  
    249249        // Now we need to re-cache values.
    250250        wp_cache_delete( self::OPTION_NAME, 'options' );
     251        wp_cache_delete( 'gtmkit_script_settings', 'gtmkit' );
    251252        $this->options = get_option( self::OPTION_NAME, [] );
    252253    }
  • gtm-kit/tags/1.19/src/js/woocommerce.js

    r3018660 r3032523  
    9191                eventTargetElement.closest('.wc-block-grid__products')) &&
    9292            eventTargetElement.closest(
    93                 '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list)'
     93                window.gtmkit_settings.wc.css_selectors.product_list_wishlist
    9494            )
    9595        ) {
     
    149149            if ( eventTargetElement.closest( '.single_add_to_cart_button:not(.disabled,.input-needed)' ) ) {
    150150                event = 'add_to_cart';
    151             } else if ( eventTargetElement.closest( '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list,.disabled-add-wishlist)' ) ) {
     151            } else if ( eventTargetElement.closest( window.gtmkit_settings.wc.css_selectors.single_product_wishlist ) ) {
    152152                event = 'add_to_wishlist';
    153153            } else {
     
    288288
    289289    // select_item event on clicks in product lists
    290     const productListItemSelector =
    291         '.products .product:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' +
    292         '.wc-block-grid__products li:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' +
    293         '.woocommerce-grouped-product-list-item__label a:not(.add_to_wishlist,.tinvwl_add_to_wishlist_button)';
    294290    document.addEventListener('click', function (e) {
    295291        const eventTargetElement = e.target;
    296         const linkElement = eventTargetElement.closest(productListItemSelector);
     292        const linkElement = eventTargetElement.closest( window.gtmkit_settings.wc.css_selectors.product_list_select_item );
    297293        if (!linkElement) return true;
    298294
  • gtm-kit/tags/1.19/vendor/composer/installed.php

    r3018660 r3032523  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'cfde4bb434472c8c469284795c75b4479c67d526',
     6        'reference' => '2b02d248fe945a37d72cc6fb59ef2c6528ad87ba',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => 'cfde4bb434472c8c469284795c75b4479c67d526',
     16            'reference' => '2b02d248fe945a37d72cc6fb59ef2c6528ad87ba',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • gtm-kit/trunk/assets/admin/settings.asset.php

    r3016305 r3032523  
    1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'a1f5a87986f782e4c463');
     1<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'f2be2b3e6277da2304eb');
  • gtm-kit/trunk/assets/admin/settings.js

    r3016305 r3032523  
    1 !function(){"use strict";var t={n:function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},d:function(e,n){for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e=window.React,n=t.n(e),a=window.wp.i18n,i=window.wp.element,r=window.wp.components,o=window.lodash,l=window.wp.apiFetch,s=t.n(l);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const m=async(t,e,n=null,a=!1)=>{let i={};try{i=await s()({path:t,method:e,...n&&{data:n}})}catch(n){return console.log(`${e} ${t} Errors:`,n),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===a?i:!0===i.success?i.data:options};var c=(t,e)=>{const n={...t};switch(e.type){case"FETCH_SETTINGS":n.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},n.stateSettings=e.payload.stateSettings,n.siteData=e.payload.siteData,n.installData=e.payload.installData,n.isPending=!1,n.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(n.notice=(0,a.__)("An error occurred.","gtm-kit"),n.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":n.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":n.fetchedSettings=e.payload.fetchedSettings,n.stateSettings=e.payload.stateSettings,n.isPending=!1,n.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,n.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,a.__)("An error occurred.","gtm-kit"):(0,a.__)("Saved Successfully.","gtm-kit"),n.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":n.fetchedSettings=e.payload.fetchedSettings||n.fetchedSettings,n.stateSettings=e.payload.stateSettings||n.stateSettings,n.isPending=e.payload.isPending||n.isPending,n.notice=e.payload.notice||n.notice,n.hasError=e.payload.hasError||n.hasError,n.canSave=e.payload.canSave||n.canSave,n.isSendingSystemData=e.payload.isSendingSystemData||n.isSendingSystemData,n.supportTicket=e.payload.supportTicket||n.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":n.isSendingSystemData=e.payload.isSendingSystemData||n.isSendingSystemData;break;case"SEND_SUPPORT_DATA":n.isSendingSystemData=!1,n.isSystemDataSent=e.payload.isSystemDataSent||n.isSystemDataSent,n.systemDataMessage=e.payload.systemDataMessage||n.systemDataMessage}return n};const u=(0,i.createContext)();var g,d=t=>{const[n,a]=(0,i.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),r=async()=>{const[t,e]=await Promise.all([m("gtmkit/v1/get-options","GET"),m("gtmkit/v1/get-site-data","GET")]),n="wizard"===window.gtmkitSettings.currentPage?await m("gtmkit/v1/get-install-data","GET"):{};a({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:n}})},l=async t=>{a({type:"UPDATE_STATE",payload:t})};(0,i.useEffect)((()=>{r()}),[]);const s={useDispatch:t=>{a(t)},useUpdateSettings:async()=>{a({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,m("gtmkit/v1/set-options","POST",e));var e;a({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:r,useUpdateState:l,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let r;i[t][e]=a,r=!(0,o.isEqual)(i,n.fetchedSettings),l({stateSettings:i,canSave:r})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const r={};r.general={...a.general,...e.general},"integrations"in e&&(r.integrations={...a.integrations,...e.integrations}),i=!(0,o.isEqual)(r,n.fetchedSettings),l({stateSettings:r,canSave:i})},useUpdateSupportTicket:async t=>{l({supportTicket:t})},useSendSystemData:async()=>{a({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,m("gtmkit/v1/send-support-data","POST",e,!0));var e;a({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData,useIsSending:n.isSendingSystemData,useSupportTicket:n.supportTicket,useIsSystemDataSent:n.isSystemDataSent,useSystemDataMessage:n.systemDataMessage};return(0,e.createElement)(u.Provider,{value:s},t.children)};function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},p.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(g||(g={}));const h="popstate";function _(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function f(t,e){return{usr:t.state,key:t.key,idx:e}}function E(t,e,n,a){return void 0===n&&(n=null),p({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?b(e):e,{state:n,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function v(t){let{pathname:e="/",search:n="",hash:a=""}=t;return n&&"?"!==n&&(e+="?"===n.charAt(0)?n:"?"+n),a&&"#"!==a&&(e+="#"===a.charAt(0)?a:"#"+a),e}function b(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let a=t.indexOf("?");a>=0&&(e.search=t.substr(a),t=t.substr(0,a)),t&&(e.pathname=t)}return e}var y;function x(t,e,n){void 0===n&&(n="/");let a=A(("string"==typeof e?b(e):e).pathname||"/",n);if(null==a)return null;let i=S(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)))))}(i);let r=null;for(let t=0;null==r&&t<i.length;++t)r=O(i[t],U(a));return r}function S(t,e,n,a){void 0===e&&(e=[]),void 0===n&&(n=[]),void 0===a&&(a="");let i=(t,i,r)=>{let o={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};o.relativePath.startsWith("/")&&(_(o.relativePath.startsWith(a),'Absolute route path "'+o.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(a.length));let l=H([a,o.relativePath]),s=n.concat(o);t.children&&t.children.length>0&&(_(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),S(t.children,e,s,l)),(null!=t.path||t.index)&&e.push({path:l,score:M(l,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var n;if(""!==t.path&&null!=(n=t.path)&&n.includes("?"))for(let n of w(t.path))i(t,e,n);else i(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[n,...a]=e,i=n.endsWith("?"),r=n.replace(/\?$/,"");if(0===a.length)return i?[r,""]:[r];let o=w(a.join("/")),l=[];return l.push(...o.map((t=>""===t?r:[r,t].join("/")))),i&&l.push(...o),l.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(y||(y={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const N=/^:\w+$/,C=3,T=2,D=1,G=10,P=-2,I=t=>"*"===t;function M(t,e){let n=t.split("/"),a=n.length;return n.some(I)&&(a+=P),e&&(a+=T),n.filter((t=>!I(t))).reduce(((t,e)=>t+(N.test(e)?C:""===e?D:G)),a)}function O(t,e){let{routesMeta:n}=t,a={},i="/",r=[];for(let t=0;t<n.length;++t){let o=n[t],l=t===n.length-1,s="/"===i?e:e.slice(i.length)||"/",m=R({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},s);if(!m)return null;Object.assign(a,m.params);let c=o.route;r.push({params:a,pathname:H([i,m.pathname]),pathnameBase:B(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function R(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[n,a]=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),k("*"===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 a=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,n)=>(a.push({paramName:e,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(a.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),a]}(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let r=i[0],o=r.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:a.reduce(((t,e,n)=>{let{paramName:a,isOptional:i}=e;if("*"===a){let t=l[n]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const s=l[n];return t[a]=i&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(n){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),t}}(s||"",a),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function U(t){try{return decodeURI(t)}catch(e){return k(!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 A(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,a=t.charAt(n);return a&&"/"!==a?null:t.slice(n)||"/"}function L(t,e,n,a){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(a)+"].  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 F(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(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)):n.map((t=>t.pathnameBase))}function j(t,e,n,a){let i;void 0===a&&(a=!1),"string"==typeof t?i=b(t):(i=p({},t),_(!i.pathname||!i.pathname.includes("?"),L("?","pathname","search",i)),_(!i.pathname||!i.pathname.includes("#"),L("#","pathname","hash",i)),_(!i.search||!i.search.includes("#"),L("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(null==l)r=n;else if(a){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t.pop();i.pathname=e.join("/")}r="/"+t.join("/")}else{let t=e.length-1;if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t-=1;i.pathname=e.join("/")}r=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:n,search:a="",hash:i=""}="string"==typeof t?b(t):t,r=n?n.startsWith("/")?n:function(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("/"):"/"}(n,e):e;return{pathname:r,search:W(a),hash:K(i)}}(i,r),m=l&&"/"!==l&&l.endsWith("/"),c=(o||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const H=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",K=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const J=["post","put","patch","delete"],$=(new Set(J),["get",...J]);function z(){return z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},z.apply(this,arguments)}new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const q=e.createContext(null),V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Z=e.createContext(null);function tt(){return null!=e.useContext(X)}function et(){return tt()||_(!1),e.useContext(X).location}function nt(t){e.useContext(Y).static||e.useLayoutEffect(t)}function at(){let{isDataRoute:t}=e.useContext(Q);return t?function(){let{router:t}=function(t){let n=e.useContext(q);return n||_(!1),n}(ct.UseNavigateStable),n=gt(ut.UseNavigateStable),a=e.useRef(!1);return nt((()=>{a.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,z({fromRouteId:n},i)))}),[t,n])}():function(){tt()||_(!1);let t=e.useContext(q),{basename:n,future:a,navigator:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(F(r,a.v7_relativeSplatPath)),s=e.useRef(!1);return nt((()=>{s.current=!0})),e.useCallback((function(e,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof e)return void i.go(e);let r=j(e,JSON.parse(l),o,"path"===a.relative);null==t&&"/"!==n&&(r.pathname="/"===r.pathname?n:H([n,r.pathname])),(a.replace?i.replace:i.push)(r,a.state,a)}),[n,i,l,o,t])}()}function it(t,n){let{relative:a}=void 0===n?{}:n,{future:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(F(r,i.v7_relativeSplatPath));return e.useMemo((()=>j(t,JSON.parse(l),o,"path"===a)),[t,l,o,a])}function rt(t,n,a,i){tt()||_(!1);let{navigator:r}=e.useContext(Y),{matches:o}=e.useContext(Q),l=o[o.length-1],s=l?l.params:{},m=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let c,u=et();if(n){var d;let t="string"==typeof n?b(n):n;"/"===m||(null==(d=t.pathname)?void 0:d.startsWith(m))||_(!1),c=t}else c=u;let p=c.pathname||"/",h=x(t,{pathname:"/"===m?p:p.slice(m.length)||"/"}),k=function(t,n,a,i){var r;if(void 0===n&&(n=[]),void 0===a&&(a=null),void 0===i&&(i=null),null==t){var o;if(null==(o=a)||!o.errors)return null;t=a.matches}let l=t,s=null==(r=a)?void 0:r.errors;if(null!=s){let t=l.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||_(!1),l=l.slice(0,Math.min(l.length,t+1))}let m=!1,c=-1;if(a&&i&&i.v7_partialHydration)for(let t=0;t<l.length;t++){let e=l[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===a.loaderData[e.route.id]&&(!a.errors||void 0===a.errors[e.route.id])){m=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}return l.reduceRight(((t,i,r)=>{let o,u=!1,g=null,d=null;var p;a&&(o=s&&i.route.id?s[i.route.id]:void 0,g=i.route.errorElement||lt,m&&(c<0&&0===r?(dt[p="route-fallback"]||(dt[p]=!0),u=!0,d=null):c===r&&(u=!0,d=i.route.hydrateFallbackElement||null)));let h=n.concat(l.slice(0,r+1)),_=()=>{let n;return n=o?g:u?d:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(mt,{match:i,routeContext:{outlet:t,matches:h,isDataRoute:null!=a},children:n})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(st,{location:a.location,revalidation:a.revalidation,component:g,error:o,children:_(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):_()}),null)}(h&&h.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:H([m,r.encodeLocation?r.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:H([m,r.encodeLocation?r.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),o,a,i);return n&&k?e.createElement(X.Provider,{value:{location:z({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:g.Pop}},k):k}function ot(){let t=function(){var t;let n=e.useContext(Z),a=function(t){let n=e.useContext(V);return n||_(!1),n}(ut.UseRouteError),i=gt(ut.UseRouteError);return void 0!==n?n:null==(t=a.errors)?void 0:t[i]}(),n=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),a?e.createElement("pre",{style:i},a):null,null)}const lt=e.createElement(ot,null);class st extends e.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?e.createElement(Q.Provider,{value:this.props.routeContext},e.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mt(t){let{routeContext:n,match:a,children:i}=t,r=e.useContext(q);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),e.createElement(Q.Provider,{value:n},i)}var ct=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ct||{}),ut=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}(ut||{});function gt(t){let n=function(t){let n=e.useContext(Q);return n||_(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||_(!1),a.route.id}const dt={};function pt(t){let{to:n,replace:a,state:i,relative:r}=t;tt()||_(!1);let{future:o,static:l}=e.useContext(Y),{matches:s}=e.useContext(Q),{pathname:m}=et(),c=at(),u=j(n,F(s,o.v7_relativeSplatPath),m,"path"===r),g=JSON.stringify(u);return e.useEffect((()=>c(JSON.parse(g),{replace:a,state:i,relative:r})),[c,g,r,a,i]),null}function ht(t){_(!1)}function _t(t){let{basename:n="/",children:a=null,location:i,navigationType:r=g.Pop,navigator:o,static:l=!1,future:s}=t;tt()&&_(!1);let m=n.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:o,static:l,future:z({v7_relativeSplatPath:!1},s)})),[m,s,o,l]);"string"==typeof i&&(i=b(i));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:k="default"}=i,f=e.useMemo((()=>{let t=A(u,m);return null==t?null:{location:{pathname:t,search:d,hash:p,state:h,key:k},navigationType:r}}),[m,u,d,p,h,k,r]);return null==f?null:e.createElement(Y.Provider,{value:c},e.createElement(X.Provider,{children:a,value:f}))}function kt(t){let{children:e,location:n}=t;return rt(ft(e),n)}function ft(t,n){void 0===n&&(n=[]);let a=[];return e.Children.forEach(t,((t,i)=>{if(!e.isValidElement(t))return;let r=[...n,i];if(t.type===e.Fragment)return void a.push.apply(a,ft(t.props.children,r));t.type!==ht&&_(!1),t.props.index&&t.props.children&&_(!1);let o={id:t.props.id||r.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=ft(t.props.children,r)),a.push(o)})),a}e.startTransition,new Promise((()=>{})),e.Component;var Et=window.ReactDOM,vt=t.n(Et);function bt(){return bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},bt.apply(this,arguments)}function yt(t,e){if(null==t)return{};var n,a,i={},r=Object.keys(t);for(a=0;a<r.length;a++)n=r[a],e.indexOf(n)>=0||(i[n]=t[n]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const xt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],St=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],wt=e.createContext({isTransitioning:!1});new Map;const Nt=e.startTransition;function Ct(t){let{basename:n,children:a,future:i,window:r}=t,o=e.useRef();null==o.current&&(o.current=function(t){return void 0===t&&(t={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,o=i.history,l=g.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function u(){l=g.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:k.location,delta:e})}function d(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof t?t:v(t);return _(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,o.replaceState(p({},o.state,{idx:m}),""));let k={get action(){return l},get location(){return t(i,o)},listen(t){if(s)throw new Error("A history only accepts one active listener");return i.addEventListener(h,u),s=t,()=>{i.removeEventListener(h,u),s=null}},createHref(t){return e(i,t)},createURL:d,encodeLocation(t){let e=d(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=g.Push;let a=E(k.location,t,e);n&&n(a,t),m=c()+1;let u=f(a,m),d=k.createHref(a);try{o.pushState(u,"",d)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(d)}r&&s&&s({action:l,location:k.location,delta:1})},replace:function(t,e){l=g.Replace;let a=E(k.location,t,e);n&&n(a,t),m=c();let i=f(a,m),u=k.createHref(a);o.replaceState(i,"",u),r&&s&&s({action:l,location:k.location,delta:0})},go(t){return o.go(t)}};return k}((function(t,e){let{pathname:n="/",search:a="",hash:i=""}=b(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),E("",{pathname:n,search:a,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let n=t.document.querySelector("base"),a="";if(n&&n.getAttribute("href")){let e=t.location.href,n=e.indexOf("#");a=-1===n?e:e.slice(0,n)}return a+"#"+("string"==typeof e?e:v(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:r,v5Compat:!0}));let l=o.current,[s,m]=e.useState({action:l.action,location:l.location}),{v7_startTransition:c}=i||{},u=e.useCallback((t=>{c&&Nt?Nt((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>l.listen(u)),[l,u]),e.createElement(_t,{basename:n,children:a,location:s.location,navigationType:s.action,navigator:l,future:i})}Et.flushSync;const Tt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gt=e.forwardRef((function(t,n){let a,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:u,unstable_viewTransition:g}=t,d=yt(t,xt),{basename:p}=e.useContext(Y),h=!1;if("string"==typeof c&&Dt.test(c)&&(a=c,Tt))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=A(e.pathname,p);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:h=!0}catch(t){}let k=function(t,n){let{relative:a}=void 0===n?{}:n;tt()||_(!1);let{basename:i,navigator:r}=e.useContext(Y),{hash:o,pathname:l,search:s}=it(t,{relative:a}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),f=function(t,n){let{target:a,replace:i,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s}=void 0===n?{}:n,m=at(),c=et(),u=it(t,{relative:l});return e.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,a)){e.preventDefault();let n=void 0!==i?i:v(c)===v(u);m(t,{replace:n,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s})}}),[c,m,u,i,r,a,t,o,l,s])}(c,{replace:l,state:s,target:m,preventScrollReset:u,relative:r,unstable_viewTransition:g});return e.createElement("a",bt({},d,{href:a||k,onClick:h||o?i:function(t){i&&i(t),t.defaultPrevented||f(t)},ref:n,target:m}))})),Pt=e.forwardRef((function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,unstable_viewTransition:m,children:c}=t,u=yt(t,St),g=it(s,{relative:u.relative}),d=et(),p=e.useContext(V),{navigator:h}=e.useContext(Y),k=null!=p&&function(t,n){void 0===n&&(n={});let a=e.useContext(wt);null==a&&_(!1);let{basename:i}=function(t){let n=e.useContext(q);return n||_(!1),n}(It.useViewTransitionState),r=it(t,{relative:n.relative});if(!a.isTransitioning)return!1;let o=A(a.currentLocation.pathname,i)||a.currentLocation.pathname,l=A(a.nextLocation.pathname,i)||a.nextLocation.pathname;return null!=R(r.pathname,l)||null!=R(r.pathname,o)}(g)&&!0===m,f=h.encodeLocation?h.encodeLocation(g).pathname:g.pathname,E=d.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(E=E.toLowerCase(),v=v?v.toLowerCase():null,f=f.toLowerCase());const b="/"!==f&&f.endsWith("/")?f.length-1:f.length;let y,x=E===f||!o&&E.startsWith(f)&&"/"===E.charAt(b),S=null!=v&&(v===f||!o&&v.startsWith(f)&&"/"===v.charAt(f.length)),w={isActive:x,isPending:S,isTransitioning:k},N=x?a:void 0;y="function"==typeof r?r(w):[r,x?"active":null,S?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof l?l(w):l;return e.createElement(Gt,bt({},u,{"aria-current":N,className:y,ref:n,style:C,to:s,unstable_viewTransition:m}),"function"==typeof c?c(w):c)}));var It,Mt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(It||(It={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Mt||(Mt={}));var Ot=({title:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-sticky"},(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between"},(0,e.createElement)("h1",{className:"gtmkit-flex gtmkit-items-center gtmkit-font-medium gtmkit-text-3xl"},(0,e.createElement)("svg",{className:"gtmkit-mr-8",height:"44",viewBox:"0 0 160 54",width:"128",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("rect",{fill:"#888",height:"54",rx:"4.265",width:"160"}),(0,e.createElement)("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,e.createElement)("g",{fill:"#fff",transform:"matrix(1.465202 0 0 1.465202 -4.582436 -7.553126)"},(0,e.createElement)("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,e.createElement)("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)))),Rt=({to:t,title:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Pt,{to: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 ":"")},n)),Ut=({NavList:t})=>(0,e.createElement)("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"},t.map((function(t){return(0,e.createElement)(Rt,{key:t.to,to:t.to,title:t.title})})));function At(){return At=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},At.apply(this,arguments)}function Lt(t,e){if(null==t)return{};var n,a,i={},r=Object.keys(t);for(a=0;a<r.length;a++)n=r[a],e.indexOf(n)>=0||(i[n]=t[n]);return i}function Ft(t,e){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ft(t,e)}function jt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ft(t,e)}function Ht(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Bt=n().createContext(null),Wt=function(t){return t.scrollTop},Kt="unmounted",Jt="exited",$t="entering",zt="entered",qt="exiting",Vt=function(t){function e(e,n){var a;a=t.call(this,e,n)||this;var i,r=n&&!n.isMounting?e.enter:e.appear;return a.appearStatus=null,e.in?r?(i=Jt,a.appearStatus=$t):i=zt:i=e.unmountOnExit||e.mountOnEnter?Kt:Jt,a.state={status:i},a.nextCallback=null,a}jt(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Kt?{status:Jt}:null};var a=e.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==$t&&n!==zt&&(e=$t):n!==$t&&n!==zt||(e=qt)}this.updateStatus(!1,e)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var t,e,n,a=this.props.timeout;return t=e=n=a,null!=a&&"number"!=typeof a&&(t=a.exit,e=a.enter,n=void 0!==a.appear?a.appear:e),{exit:t,enter:e,appear:n}},a.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===$t){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this);n&&Wt(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jt&&this.setState({status:Kt})},a.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[vt().findDOMNode(this),a],r=i[0],o=i[1],l=this.getTimeouts(),s=a?l.appear:l.enter;t||n?(this.props.onEnter(r,o),this.safeSetState({status:$t},(function(){e.props.onEntering(r,o),e.onTransitionEnd(s,(function(){e.safeSetState({status:zt},(function(){e.props.onEntered(r,o)}))}))}))):this.safeSetState({status:zt},(function(){e.props.onEntered(r)}))},a.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),a=this.props.nodeRef?void 0:vt().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:qt},(function(){t.props.onExiting(a),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:Jt},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:Jt},(function(){t.props.onExited(a)}))},a.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},a.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(a){n&&(n=!1,e.nextCallback=null,t(a))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},a.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this),a=null==t&&!this.props.addEndListener;if(n&&!a){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],r=i[0],o=i[1];this.props.addEndListener(r,o)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},a.render=function(){var t=this.state.status;if(t===Kt)return null;var e=this.props,a=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,Lt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n().createElement(Bt.Provider,{value:null},"function"==typeof a?a(t,i):n().cloneElement(n().Children.only(a),i))},e}(n().Component);function Yt(){}Vt.contextType=Bt,Vt.propTypes={},Vt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yt,onEntering:Yt,onEntered:Yt,onExit:Yt,onExiting:Yt,onExited:Yt},Vt.UNMOUNTED=Kt,Vt.EXITED=Jt,Vt.ENTERING=$t,Vt.ENTERED=zt,Vt.EXITING=qt;var Xt=Vt,Qt=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return a=e,void((n=t).classList?n.classList.remove(a):"string"==typeof n.className?n.className=Ht(n.className,a):n.setAttribute("class",Ht(n.className&&n.className.baseVal||"",a)));var n,a}))},Zt=function(t){function e(){for(var e,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(e=t.call.apply(t,[this].concat(a))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(t,n){var a=e.resolveArguments(t,n),i=a[0],r=a[1];e.removeClasses(i,"exit"),e.addClass(i,r?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(t,n)},e.onEntering=function(t,n){var a=e.resolveArguments(t,n),i=a[0],r=a[1]?"appear":"enter";e.addClass(i,r,"active"),e.props.onEntering&&e.props.onEntering(t,n)},e.onEntered=function(t,n){var a=e.resolveArguments(t,n),i=a[0],r=a[1]?"appear":"enter";e.removeClasses(i,r),e.addClass(i,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,a="string"==typeof n,i=a?(a&&n?n+"-":"")+t:n[t];return{baseClassName:i,activeClassName:a?i+"-active":n[t+"Active"],doneClassName:a?i+"-done":n[t+"Done"]}},e}jt(e,t);var a=e.prototype;return a.addClass=function(t,e,n){var a=this.getClassNames(e)[n+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===e&&"done"===n&&i&&(a+=" "+i),"active"===n&&t&&Wt(t),a&&(this.appliedClasses[e][n]=a,function(t,e){t&&e&&e.split(" ").forEach((function(e){return a=e,void((n=t).classList?n.classList.add(a):function(t,e){return t.classList?!!e&&t.classList.contains(e):-1!==(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")}(n,a)||("string"==typeof n.className?n.className=n.className+" "+a:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+a)));var n,a}))}(t,a))},a.removeClasses=function(t,e){var n=this.appliedClasses[e],a=n.base,i=n.active,r=n.done;this.appliedClasses[e]={},a&&Qt(t,a),i&&Qt(t,i),r&&Qt(t,r)},a.render=function(){var t=this.props,e=(t.classNames,Lt(t,["classNames"]));return n().createElement(Xt,At({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n().Component);Zt.defaultProps={classNames:""},Zt.propTypes={};var te=Zt,ee=({title:t=(0,a.__)("Save","gtm-kit"),className:n="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{useUpdateSettings:o,useIsPending:l,useCanSave:s}=(0,i.useContext)(u);return(0,e.createElement)(r.Button,{className:n,onClick:()=>o(),variant:"primary",disabled:l||!s},s?(0,a.__)(t,"gtm-kit"):(0,a.__)("Saved","gtm-kit"),l?(0,e.createElement)(r.Spinner,null):"")},ne=()=>{const{useCanSave:t}=(0,i.useContext)(u);return(0,e.createElement)(te,{in:t,timeout:500,classNames:"slide",unmountOnExit:!0},(0,e.createElement)("footer",{className:"gtmkit-fixed gtmkit-bottom-0 gtmkit-w-full gtmkit-z-10 gtmkit-bg-color-grey gtmkit-text-white gtmkit-p-8"},(0,e.createElement)(ee,null)))},ae=({subject:t})=>{const n=!0===t||"on"===t,i=!0===n?"gtmkit-bg-color-success":"gtmkit-bg-color-button-disabled";return(0,e.createElement)("div",{className:"gtmkit-text-xs gtmkit-text-white gtmkit-font-bold gtmkit-rounded-full gtmkit-py gtmkit-px-2 gtmkit-h-5 gtmkit-leading-5 gtmkit-uppercase "+i},n?(0,a.__)("Active","gtm-kit"):(0,a.__)("Inactive","gtm-kit"))};const ie=(0,i.forwardRef)((({children:t,className:n="",...a},i)=>(0,e.createElement)("div",{...a,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 gtmkit-group gtmkit-w-full "+n,ref:i},t)));ie.Header=({as:t="h3",title:n="",children:a,className:i="",...r})=>(0,e.createElement)("div",{...r,className:"gtmkit-flex gtmkit-justify-between gtmkit-items-center gtmkit-mb-5 "+i},(0,e.createElement)(t,{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading"},n),a),ie.Content=({as:t="div",children:n,className:a="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:a},n),ie.Button=({url:t,destination:n,newTab:a=!1,text:i,group:o="",...l})=>{const s=at();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-rounded !gtmkit-py-4 !gtmkit-px-8 gtmkit-w-full sm:gtmkit-w-auto gtmkit-min-w-[225px]",onClick:()=>{n&&t&&!1===a?window.gtmkitSettings.current_poage===o?s(n,{replace:!0}):window.location.href=t+"#"+n:t?a?window.open(t):window.location.href=t:s(n,{replace:!0})}},(0,e.createElement)("span",{className:"gtmkit-mx-auto gtmkit-text-sm gtmkit-font-bold"},i)))};var re=ie,oe=({title:t,data:n,className:r=""})=>{const{useSettings:o}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8 gtmkit-mt-6"},t),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px] "+r},n.map(((t,n)=>!1===t.featured?null:(0,e.createElement)(re,{key:n},(0,e.createElement)(re.Header,{title:t.title},t.pill?(0,e.createElement)(ae,{subject:o[t.group][t.option]}):null),(0,e.createElement)(re.Content,null,t.text.map(((t,n)=>(0,e.createElement)("p",{key:n},t)))),(0,e.createElement)(re.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,a.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))};const le=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,a.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,a.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,a.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,a.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,a.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,a.__)("Setup integration","gtm-kit")}}],se=[{title:"Getting started with GTM Kit",text:[(0,a.__)("How to get the most out of Google Tag Manager with GTM Kit.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!0},{title:(0,a.__)("WooCommerce integration","gtm-kit"),text:[(0,a.__)("Integrate WooCommerce with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=dashboard-tutorials"},featured:!0},{title:"Contact Form 7 Integration",text:[(0,a.__)("Integrate Contact Form 7 with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/contact-form-7-integration/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Easy Digital Downloads integration",text:[(0,a.__)("Integrate Easy Digital Downloads with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/set-up-easy-digital-downloads-for-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Advanced GTM container implementation",text:[(0,a.__)("Customization of the GTM container implementation and Server Side Tracking.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Settings, actions and filters for developers",text:[(0,a.__)("One of the things that makes GTM Kit a great tool for developers is the ability to override options in wp-config.php.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1}];var me=()=>{const{useSettings:t}=(0,i.useContext)(u),[n,r]=(0,i.useState)(se),o=Boolean(t.general.sgtm_domain&&t.general.sgtm_domain.trim());return(0,i.useEffect)((()=>{r((t=>[...t,{title:(0,a.__)("See all tutorials…","gtm-kit"),text:[(0,a.__)("See all our tutorial and get the most out of GTM Kit","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=documentation&utm_content=dashboard-tutorials",text:(0,a.__)("Read articles","gtm-kit")},featured:!0}]))}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("General","gtm-kit")),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 lg:gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px]"},(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ae,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(re.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,a.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,a.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,a.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,a.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ae,{subject:o})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,a.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,a.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,a.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ae,{subject:t.general.analytics_active})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,a.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/misc",text:(0,a.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(oe,{title:(0,a.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(oe,{title:(0,a.__)("Integrations","gtm-kit"),data:le}))},ce=({title:t,placeholder:n,help:a,className:o="gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",optionGroup:l="general",optionName:s,isDisabled:m})=>{const{useSettings:c,useUpdateStateSettings:g}=(0,i.useContext)(u);return(0,e.createElement)(r.TextControl,{label:t,placeholder:n,help:a,className:o,value:c[l][s],onChange:t=>g(l,s,t),disabled:m})},ue=({title:t,label:n,optionGroup:a="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(r.BaseControl,{label:t},(0,e.createElement)(r.ToggleControl,{label:n,checked:!l&&s[a][o],onChange:()=>{m(a,o,!(s&&s[a][o]))},disabled:l}))))},ge=({title:t,options:n,help:a,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:g}=(0,i.useContext)(u);return(0,e.createElement)(r.RadioControl,{label:t,options:n,help:a,className:o,selected:parseInt(c[l][s]),onChange:t=>g(l,s,t),disabled:m})};const de=(0,i.forwardRef)((({children:t,className:n="",disabled:a=!1,...i},r)=>(0,e.createElement)("div",{...i,className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-w-3/4 gtmkit-border-color-grey "+n+(a?"gtmkit-opacity-60":""),ref:r},t)));de.Header=({as:t="h3",title:n="",children:a,className:i="",...r})=>(0,e.createElement)(t,{...r,className:"gtmkit-font-bold gtmkit-text-lg gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey "+i},n,a),de.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);var pe=de,he=()=>{const{useSettings:t}=(0,i.useContext)(u),n=!(t.general.sgtm_domain&&t.general.sgtm_domain.trim()&&t.general.sgtm_container_identifier&&t.general.sgtm_container_identifier.trim());return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("General Container Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit")),(0,e.createElement)(ce,{title:(0,a.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,a.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ue,{title:(0,a.__)("Inject Container Code","gtm-kit"),label:(0,a.__)("Setting this to Off will remove the Google Tag Manager container code but the data layer will remain.","gtm-kit"),optionName:"container_active"}),(0,e.createElement)(ue,{title:(0,a.__)("Just the container","gtm-kit"),label:(0,a.__)("Setting this to On will reduce the functionality to just the GTM container code. No additional data will be pushed to the datalayer regardless of any other settings.","gtm-kit"),optionName:"just_the_container"}),(0,e.createElement)(ce,{title:(0,a.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,a.__)("The default name of the data layer object is dataLayer. If you prefer to use a different name for your data layer, you may do.","gtm-kit")}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,a.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,a.__)("Enter domain …","gtm-kit"),help:(0,a.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,a.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,a.__)("Enter loader name …","gtm-kit"),help:(0,a.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ue,{title:(0,a.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,a.__)("Prolong cookie lifetime in Safari and other browsers with ITP. This only works if you use Stape sGTM hosting and have set up the Cookie Keeper power up.","gtm-kit"),optionName:"sgtm_cookie_keeper",disabled:n})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/google-tag-manager-server-side-tagging/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=sgtm&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Setting up server-side tracking can be challenging and costly but there is an easy and cheap solution.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Stape.io is a solution for hosting server-side Google Tag Manager containers, offering a simplified approach that demands less technical expertise than solutions like Google Cloud Platform.","gtm-kit")," ",(0,a.__)("Additionally, it provides valuable add-ons for enhanced functionality.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:"https://stape.io/?pt=tlam&rs=plugin",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Tag Manager Environment","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,a.__)("gtm_auth:","gtm-kit"),optionName:"gtm_auth",placeholder:(0,a.__)("Enter gtm_auth code","gtm-kit"),help:(0,a.__)("Enter your gtm_auth code your GTM environment.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,a.__)("gtm_preview:","gtm-kit"),optionName:"gtm_preview",placeholder:(0,a.__)("Enter gtm_preview code","gtm-kit"),help:(0,a.__)("Enter your gtm_preview code your GTM environment.","gtm-kit")})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Environments","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("In Google Tag Manager you can define different environments like Live, Dev and QA.","gtm-kit")," ",(0,a.__)('To use a specific environment in GTM Kit you must enter the "gtm_auth" and "gtm_preview" codes for that environment.',"gtm-kit")," ",(0,a.__)("If left empty the default environment will be used.","gtm-kit")),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,a.__)("Override settings in wp-config.php","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("You can override the values of using constants in wp-config.php, which is a very useful for setting the value in your development and staging environments.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=container-settings&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,a.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,a.__)("Container code implementation:","gtm-kit"),options:[{label:(0,a.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,a.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,a.__)("Depending on how you use Google Tag Manager you can delay the loading of the container script until the browser is idle.","gtm-kit"),optionName:"script_implementation"}),(0,e.createElement)(ge,{title:(0,a.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,a.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,a.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,a.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,a.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,a.__)('The preferred method to implement the <noscript> container code is just after the opening <body> tag. This requires that your theme uses the "body_open" hook. If your theme does not support this the script can be injected in the footer or you can use the function below.',"gtm-kit"),optionName:"noscript_implementation"}),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("code",null,"<?php if ( function_exists( 'gtmkit_the_noscript_tag' ) ) { gtmkit_the_noscript_tag(); } ?>")))))},_e=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Post Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ue,{title:(0,a.__)("Post type","gtm-kit"),id:"post-type",label:(0,a.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ue,{title:(0,a.__)("Page type","gtm-kit"),id:"page-type",label:(0,a.__)('Include the defined page type. I.e. post, page, product, category, cart, checkout etc. You may override this on page-level and set you own page type i.e. "campaign".',"gtm-kit"),optionName:"datalayer_page_type"}),(0,e.createElement)(ue,{title:(0,a.__)("Categories","gtm-kit"),id:"categories",label:(0,a.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ue,{title:(0,a.__)("Tags","gtm-kit"),id:"tags",label:(0,a.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ue,{title:(0,a.__)("Post title","gtm-kit"),id:"post-title",label:(0,a.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ue,{title:(0,a.__)("Post ID","gtm-kit"),id:"post-id",label:(0,a.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ue,{title:(0,a.__)("Post data","gtm-kit"),id:"post-date",label:(0,a.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ue,{title:(0,a.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,a.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ue,{title:(0,a.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,a.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),ke=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("User Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,a.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,a.__)("Full page caching will cache user data making it the same for all users. There are ways around this, but it depends on the chosen cache solution and is only for advanced users.","gtm-kit")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,a.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ue,{title:(0,a.__)("User ID","gtm-kit"),id:"user-id",label:(0,a.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ue,{title:(0,a.__)("User role","gtm-kit"),id:"user-role",label:(0,a.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),fe=()=>{const{useSettings:t}=(0,i.useContext)(u),n=!t.general.gcm_default_settings;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,a.__)("Warning!","gtm-kit"))),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,a.__)("Most Consent Management Platforms will handle the Google Consent Mode settings for you and applying the default settings in both GTM Kit and you CMP will lead to unexpected behaviour or errors.","gtm-kit")),(0,e.createElement)("p",null,(0,a.__)("You should only use these settings if you do not have a Consent Management Platform that supports Google Consent Mode.","gtm-kit")),(0,e.createElement)("p",{className:"!gtmkit-mt-4"},(0,a.__)("GTM Kit will only set the default Consent Mode settings and you must update the settings yourself when the user has given consent.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-color-primary !gtmkit-my-6"},(0,e.createElement)("a",{href:"https://developers.google.com/tag-platform/security/guides/consent#implementation_example",target:"_blank",rel:"noreferrer",className:"hover:gtmkit-underline gtmkit-font-semibold"},(0,a.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ue,{title:(0,a.__)("Activate GCM settings","gtm-kit"),label:(0,a.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(pe,{disabled:n},(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Ad Personalization","gtm-kit"),label:(0,a.__)("Enables personalized advertising","gtm-kit"),optionName:"gcm_ad_personalization",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Ad Storage","gtm-kit"),label:(0,a.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Ad User Data","gtm-kit"),label:(0,a.__)("Enables sending user data related to advertising to Google","gtm-kit"),optionName:"gcm_ad_user_data",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Analytics Storage","gtm-kit"),label:(0,a.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Functionality Storage","gtm-kit"),label:(0,a.__)("Enables storage that supports the functionality of the website or app such as language settings","gtm-kit"),optionName:"gcm_functionality_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Personalization Storage","gtm-kit"),label:(0,a.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:n}),(0,e.createElement)(ue,{title:(0,a.__)("Security Storage","gtm-kit"),label:(0,a.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:n}))))},Ee=({label:t,value:n,tag:a})=>(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-4 gtmkit-py-2"},(0,e.createElement)("strong",null,t)),(0,e.createElement)("td",{className:"gtmkit-px-4 gtmkit-py-2"},"code"===a?(0,e.createElement)("code",{className:"gtmkit-text-sm"},n):(0,e.createElement)("em",null,n))),ve=()=>{const{useSiteData:t}=(0,i.useContext)(u),n=Object.values(t.shared_data);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,a.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,a.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm gtmkit-my-6 gtmkit-py-6"},(0,e.createElement)("tbody",{className:"gtmkit-py-6"},n.map((function(t,n){return(0,e.createElement)(Ee,{key:n,label:t.label,value:t.value,tag:t.tag})})))))},be=()=>{const{}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Misc","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ve,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,a.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ue,{title:(0,a.__)("Share anonymous data","gtm-kit"),label:(0,a.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Console log","gtm-kit"),label:(0,a.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},ye=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(oe,{title:(0,a.__)("Integrations","gtm-kit"),data:le})),xe=({pluginName:t})=>(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.sprintf)((0,a.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,a.sprintf)((0,a.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-4 !gtmkit-px-6 gtmkit-text-sm disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.pluginInstallUrl+t}},(0,a.sprintf)((0,a.__)("Install %s","gtm-kit"),t)))),Se=({title:t,options:n,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m=!1,help:c="",notSet:g=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,i.useContext)(u),h=g?[{label:(0,a.__)("(not set)","gtm-kit"),value:""},...n]:n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(r.SelectControl,{label:t,value:d&&d[l][s],options:h,className:o,onChange:t=>p(l,s,t),disabled:m,help:c}))},we=({pluginName:t,optionName:n,pluginInactive:i})=>(0,e.createElement)(pe,{disabled:i},(0,e.createElement)(pe.Header,{title:(0,a.sprintf)((0,a.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.sprintf)((0,a.__)("Track %s","gtm-kit"),t),label:(0,a.sprintf)((0,a.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:n,disabled:i})));const Ne=[{label:(0,a.__)("Retail","gtm-kit"),value:"retail"},{label:(0,a.__)("Education","gtm-kit"),value:"education"},{label:(0,a.__)("Flights","gtm-kit"),value:"flights"},{label:(0,a.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,a.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,a.__)("Local deals","gtm-kit"),value:"local"},{label:(0,a.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,a.__)("Travel","gtm-kit"),value:"travel"},{label:(0,a.__)("Custom","gtm-kit"),value:"custom"}];var Ce=()=>{const{useSettings:t}=(0,i.useContext)(u),n="WooCommerce",r=!window.gtmkitSettings.plugins.woocommerce,o=r||!t.integrations.woocommerce_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("WooCommerce","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"woocommerce_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Basic settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,a.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,a.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Use SKU instead of ID","gtm-kit"),label:(0,a.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_use_sku",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Exclude tax","gtm-kit"),label:(0,a.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Exclude shipping from revenue","gtm-kit"),label:(0,a.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include customer data","gtm-kit"),label:(0,a.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Event customization","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:"view_item_list (with product filter)",options:[{label:(0,a.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,a.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,a.__)("Do you what to push the view_item_list event if the list is updated using a filter or just once per page view.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_view_item_list_limit",disabled:o}),(0,e.createElement)(ge,{title:"view_item",options:[{label:(0,a.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,a.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,a.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,a.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:o}),(0,e.createElement)(ge,{title:"add_shipping_info ",options:[{label:(0,a.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,a.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,a.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,a.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:o}),(0,e.createElement)(ge,{title:"add_payment_info ",options:[{label:(0,a.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,a.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,a.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,a.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,a.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Ne,help:(0,a.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,a.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,a.__)("Enter prefix …","gtm-kit"),help:(0,a.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,a.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_dequeue_script",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include permalink structure","gtm-kit"),label:(0,a.__)("Enable this option to include the permalink structure of the product base, category base, tag base and attribute base.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_permalink_structure",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include path of pages","gtm-kit"),label:(0,a.__)("Enable this option to include the path of cart, checkout, order received and my account page.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_pages",disabled:o}))))},Te=()=>{const{useSettings:t}=(0,i.useContext)(u),n="Contact Form 7",r=!window.gtmkitSettings.plugins.cf7,o=r||!t.integrations.cf7_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Contact Form 7","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"cf7_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,a.__)("Load JavaScript","gtm-kit"),options:[{label:(0,a.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,a.__)("On all pages","gtm-kit"),value:2}],help:(0,a.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:o}))))},De=()=>{const t="Easy Digital Downloads",n=!window.gtmkitSettings.plugins.edd,{useSettings:r}=(0,i.useContext)(u),o=n||!r.integrations.edd_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Easy Digital Downloads","gtm-kit")),n?(0,e.createElement)(xe,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:n}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Use SKU instead of ID","gtm-kit"),label:(0,a.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"edd_use_sku",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Exclude tax","gtm-kit"),label:(0,a.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:o}),(0,e.createElement)(ue,{title:(0,a.__)("Include customer data","gtm-kit"),label:(0,a.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"edd_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,a.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Ne,help:(0,a.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,a.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,a.__)("Enter prefix …","gtm-kit"),help:(0,a.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:n},(0,e.createElement)(pe.Header,{title:(0,a.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,a.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,a.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"edd_dequeue_script",disabled:o}))))},Ge=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Help","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,a.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,a.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/"},(0,a.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,a.__)("GTM container import files:","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,a.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,a.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Tutorials","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",null,se.map(((t,n)=>(0,e.createElement)("li",{key:n,className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:t.link.url,target:"_blank",rel:"noreferrer",className:"gtmkit-font-semibold gtmkit-text-color-primary hover:gtmkit-underline"},t.title),t.text.map(((t,n)=>(0,e.createElement)("div",{key:n,className:"gtmkit-text-sm"},t)))))))))),Pe=()=>{const{useIsSending:t,useSiteData:n,useUpdateSupportTicket:o,useSupportTicket:l,useSendSystemData:s,useIsSystemDataSent:m,useSystemDataMessage:c}=(0,i.useContext)(u);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,a.__)("Get support","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Support options","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://wordpress.org/support/plugin/gtm-kit/",target:"_blank",rel:"noreferrer"},(0,a.__)("WordPress.org Support Forum","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,a.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,a.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("Share system data with the GTM Kit support team","gtm-kit")}),(0,e.createElement)(pe.Content,null,m?(0,e.createElement)("p",{className:"gtmkit-mb-2"},c):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2"},(0,a.__)("If the GTM Kit support team has asked you to send your system data you can do so by entering the support ticket below:","gtm-kit")),(0,e.createElement)(r.TextControl,{label:(0,e.createElement)("span",{className:"gtmkit-text-red-600"},c," "),placeholder:(0,a.__)("Enter support ticket","gtm-kit"),className:"gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",value:l,onChange:t=>o(t)}),(0,e.createElement)(r.Button,{variant:"primary",className:"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",onClick:()=>{s()},disabled:!l.toUpperCase().startsWith("FS")},(0,e.createElement)("span",null,(0,a.__)("Send system data","gtm-kit")),t?(0,e.createElement)(r.Spinner,null):"")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,a.__)("About GTM Kit","gtm-kit"),className:"gtmkit-flex gtmkit-items-center"},(0,e.createElement)("span",{className:"gtmkit-text-sm gtmkit-text-color-grey gtmkit-font-light gtmkit-ml-2"},"(",(0,a.__)("Version:","gtm-kit")," ",n.gtmkit_version,")")),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",null,(0,a.__)("Learn about changes and follow the development of GTM Kit:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,a.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary  hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,a.__)("The Github repository","gtm-kit"))))))};const Ie={integrations:(0,a.__)("Integrations","gtm-kit"),help:(0,a.__)("Help","gtm-kit")},Me=()=>{const{useSettings:t}=(0,i.useContext)(u),n=window.gtmkitSettings.currentPage,o=function({page:t}){const e=[{to:"general",title:(0,a.__)("Dashboard","gtm-kit")},{to:"container",title:(0,a.__)("Container","gtm-kit")},{to:"post-data",title:(0,a.__)("Post data","gtm-kit")},{to:"user-data",title:(0,a.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,a.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,a.__)("Misc","gtm-kit")}],n=[{to:"integrations",title:(0,a.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],i=[{to:"help",title:(0,a.__)("Help","gtm-kit")},{to:"support",title:(0,a.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return n;case"help":return i}}({page:n}),l=Ie[n]||(0,a.__)("Settings","gtm-kit");return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ot,{title:l}),(0,e.createElement)(Ut,{NavList:o}),(0,e.createElement)("main",{className:"gtmkit-max-w-[1536px] gtmkit-px-8 gtmkit-pt-8 gtmkit-text-base"},(0,e.createElement)(kt,null,(0,e.createElement)(ht,{exact:!0,path:"/general",element:(0,e.createElement)(me,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(fe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(ye,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Te,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(De,null)}),(0,e.createElement)(ht,{exact:!0,path:"/help",element:(0,e.createElement)(Ge,null)}),(0,e.createElement)(ht,{exact:!0,path:"/support",element:(0,e.createElement)(Pe,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+n})}))),(0,e.createElement)(ne,null)):(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(r.Spinner,null))},Oe=()=>(0,e.createElement)(Ct,{basename:"/"},(0,e.createElement)(d,null,(0,e.createElement)(Me,null)));document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(window.gtmkitSettings.rootId);null!=t&&(0,i.render)((0,e.createElement)(Oe,null),t)}))}();
     1(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.React;var a=t.n(e);const n=window.wp.i18n,i=window.wp.element,r=window.wp.components,o=window.lodash,l=window.wp.apiFetch;var s=t.n(l);s().use(s().createNonceMiddleware(window.gtmkitSettings.nonce)),s().use(s().createRootURLMiddleware(window.gtmkitSettings.root));const m=async(t,e,a=null,n=!1)=>{let i={};try{i=await s()({path:t,method:e,...a&&{data:a}})}catch(a){return console.log(`${e} ${t} Errors:`,a),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?i:!0===i.success?i.data:options},c=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,n.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,n.__)("An error occurred.","gtm-kit"):(0,n.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage}return a},g=(0,i.createContext)(),u=t=>{const[a,n]=(0,i.useReducer)(c,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),r=async()=>{const[t,e]=await Promise.all([m("gtmkit/v1/get-options","GET"),m("gtmkit/v1/get-site-data","GET")]),a="wizard"===window.gtmkitSettings.currentPage?await m("gtmkit/v1/get-install-data","GET"):{};n({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:a}})},l=async t=>{n({type:"UPDATE_STATE",payload:t})};(0,i.useEffect)((()=>{r()}),[]);const s={useDispatch:t=>{n(t)},useUpdateSettings:async()=>{n({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=a.stateSettings,m("gtmkit/v1/set-options","POST",e));var e;n({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:r,useUpdateState:l,useUpdateStateSettings:async(t,e,n)=>{const i=JSON.parse(JSON.stringify(a.stateSettings));let r;i[t][e]=n,r=!(0,o.isEqual)(i,a.fetchedSettings),l({stateSettings:i,canSave:r})},useImportSettings:async(t,e)=>{const n=JSON.parse(JSON.stringify(a.stateSettings));let i;const r={};r.general={...n.general,...e.general},"integrations"in e&&(r.integrations={...n.integrations,...e.integrations}),i=!(0,o.isEqual)(r,a.fetchedSettings),l({stateSettings:r,canSave:i})},useUpdateSupportTicket:async t=>{l({supportTicket:t})},useSendSystemData:async()=>{n({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=a.supportTicket,m("gtmkit/v1/send-support-data","POST",e,!0));var e;n({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:a.stateSettings,useIsPending:a.isPending,useNotice:a.notice,useHasError:a.hasError,useCanSave:a.canSave,useSiteData:a.siteData,useInstallData:a.installData,useIsSending:a.isSendingSystemData,useSupportTicket:a.supportTicket,useIsSystemDataSent:a.isSystemDataSent,useSystemDataMessage:a.systemDataMessage};return(0,e.createElement)(g.Provider,{value:s},t.children)};function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},d.apply(this,arguments)}var p;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(p||(p={}));const h="popstate";function _(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function f(t,e){return{usr:t.state,key:t.key,idx:e}}function E(t,e,a,n){return void 0===a&&(a=null),d({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?b(e):e,{state:a,key:e&&e.key||n||Math.random().toString(36).substr(2,8)})}function v(t){let{pathname:e="/",search:a="",hash:n=""}=t;return a&&"?"!==a&&(e+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function b(t){let e={};if(t){let a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var y;function x(t,e,a){void 0===a&&(a="/");let n=A(("string"==typeof e?b(e):e).pathname||"/",a);if(null==n)return null;let i=S(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,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(i);let r=null;for(let t=0;null==r&&t<i.length;++t)r=O(i[t],U(n));return r}function S(t,e,a,n){void 0===e&&(e=[]),void 0===a&&(a=[]),void 0===n&&(n="");let i=(t,i,r)=>{let o={relativePath:void 0===r?t.path||"":r,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};o.relativePath.startsWith("/")&&(_(o.relativePath.startsWith(n),'Absolute route path "'+o.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(n.length));let l=H([n,o.relativePath]),s=a.concat(o);t.children&&t.children.length>0&&(_(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),S(t.children,e,s,l)),(null!=t.path||t.index)&&e.push({path:l,score:M(l,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of w(t.path))i(t,e,a);else i(t,e)})),e}function w(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,i=a.endsWith("?"),r=a.replace(/\?$/,"");if(0===n.length)return i?[r,""]:[r];let o=w(n.join("/")),l=[];return l.push(...o.map((t=>""===t?r:[r,t].join("/")))),i&&l.push(...o),l.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(y||(y={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const N=/^:\w+$/,C=3,T=2,D=1,G=10,P=-2,I=t=>"*"===t;function M(t,e){let a=t.split("/"),n=a.length;return a.some(I)&&(n+=P),e&&(n+=T),a.filter((t=>!I(t))).reduce(((t,e)=>t+(N.test(e)?C:""===e?D:G)),n)}function O(t,e){let{routesMeta:a}=t,n={},i="/",r=[];for(let t=0;t<a.length;++t){let o=a[t],l=t===a.length-1,s="/"===i?e:e.slice(i.length)||"/",m=R({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},s);if(!m)return null;Object.assign(n,m.params);let c=o.route;r.push({params:n,pathname:H([i,m.pathname]),pathnameBase:B(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function R(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[a,n]=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!0),k("*"===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 n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,a)=>(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),i+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==t&&"/"!==t&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),i=e.match(a);if(!i)return null;let r=i[0],o=r.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:i}=e;if("*"===n){let t=l[a]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}const s=l[a];return t[n]=i&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(a){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+a+")."),t}}(s||"",n),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function U(t){try{return decodeURI(t)}catch(e){return k(!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 A(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function L(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function j(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase)):a.map((t=>t.pathnameBase))}function F(t,e,a,n){let i;void 0===n&&(n=!1),"string"==typeof t?i=b(t):(i=d({},t),_(!i.pathname||!i.pathname.includes("?"),L("?","pathname","search",i)),_(!i.pathname||!i.pathname.includes("#"),L("#","pathname","hash",i)),_(!i.search||!i.search.includes("#"),L("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(null==l)r=a;else if(n){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t.pop();i.pathname=e.join("/")}r="/"+t.join("/")}else{let t=e.length-1;if(l.startsWith("..")){let e=l.split("/");for(;".."===e[0];)e.shift(),t-=1;i.pathname=e.join("/")}r=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:i=""}="string"==typeof t?b(t):t,r=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:r,search:W(n),hash:K(i)}}(i,r),m=l&&"/"!==l&&l.endsWith("/"),c=(o||"."===l)&&a.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const H=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",K=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const J=["post","put","patch","delete"],z=(new Set(J),["get",...J]);function $(){return $=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},$.apply(this,arguments)}new Set(z),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const q=e.createContext(null),V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Z=e.createContext(null);function tt(){return null!=e.useContext(X)}function et(){return tt()||_(!1),e.useContext(X).location}function at(t){e.useContext(Y).static||e.useLayoutEffect(t)}function nt(){let{isDataRoute:t}=e.useContext(Q);return t?function(){let{router:t}=function(t){let a=e.useContext(q);return a||_(!1),a}(ct.UseNavigateStable),a=ut(gt.UseNavigateStable),n=e.useRef(!1);return at((()=>{n.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,$({fromRouteId:a},i)))}),[t,a])}():function(){tt()||_(!1);let t=e.useContext(q),{basename:a,future:n,navigator:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(j(r,n.v7_relativeSplatPath)),s=e.useRef(!1);return at((()=>{s.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!s.current)return;if("number"==typeof e)return void i.go(e);let r=F(e,JSON.parse(l),o,"path"===n.relative);null==t&&"/"!==a&&(r.pathname="/"===r.pathname?a:H([a,r.pathname])),(n.replace?i.replace:i.push)(r,n.state,n)}),[a,i,l,o,t])}()}function it(t,a){let{relative:n}=void 0===a?{}:a,{future:i}=e.useContext(Y),{matches:r}=e.useContext(Q),{pathname:o}=et(),l=JSON.stringify(j(r,i.v7_relativeSplatPath));return e.useMemo((()=>F(t,JSON.parse(l),o,"path"===n)),[t,l,o,n])}function rt(t,a,n,i){tt()||_(!1);let{navigator:r}=e.useContext(Y),{matches:o}=e.useContext(Q),l=o[o.length-1],s=l?l.params:{},m=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let c,g=et();if(a){var u;let t="string"==typeof a?b(a):a;"/"===m||(null==(u=t.pathname)?void 0:u.startsWith(m))||_(!1),c=t}else c=g;let d=c.pathname||"/",h=x(t,{pathname:"/"===m?d:d.slice(m.length)||"/"}),k=function(t,a,n,i){var r;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===i&&(i=null),null==t){var o;if(null==(o=n)||!o.errors)return null;t=n.matches}let l=t,s=null==(r=n)?void 0:r.errors;if(null!=s){let t=l.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||_(!1),l=l.slice(0,Math.min(l.length,t+1))}let m=!1,c=-1;if(n&&i&&i.v7_partialHydration)for(let t=0;t<l.length;t++){let e=l[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===n.loaderData[e.route.id]&&(!n.errors||void 0===n.errors[e.route.id])){m=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}return l.reduceRight(((t,i,r)=>{let o,g=!1,u=null,d=null;var p;n&&(o=s&&i.route.id?s[i.route.id]:void 0,u=i.route.errorElement||lt,m&&(c<0&&0===r?(dt[p="route-fallback"]||(dt[p]=!0),g=!0,d=null):c===r&&(g=!0,d=i.route.hydrateFallbackElement||null)));let h=a.concat(l.slice(0,r+1)),_=()=>{let a;return a=o?u:g?d:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(mt,{match:i,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:a})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(st,{location:n.location,revalidation:n.revalidation,component:u,error:o,children:_(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):_()}),null)}(h&&h.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:H([m,r.encodeLocation?r.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:H([m,r.encodeLocation?r.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),o,n,i);return a&&k?e.createElement(X.Provider,{value:{location:$({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:p.Pop}},k):k}function ot(){let t=function(){var t;let a=e.useContext(Z),n=function(t){let a=e.useContext(V);return a||_(!1),a}(gt.UseRouteError),i=ut(gt.UseRouteError);return void 0!==a?a:null==(t=n.errors)?void 0:t[i]}(),a=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},a),n?e.createElement("pre",{style:i},n):null,null)}const lt=e.createElement(ot,null);class st extends e.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?e.createElement(Q.Provider,{value:this.props.routeContext},e.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mt(t){let{routeContext:a,match:n,children:i}=t,r=e.useContext(q);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(Q.Provider,{value:a},i)}var ct=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ct||{}),gt=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}(gt||{});function ut(t){let a=function(t){let a=e.useContext(Q);return a||_(!1),a}(),n=a.matches[a.matches.length-1];return n.route.id||_(!1),n.route.id}const dt={};function pt(t){let{to:a,replace:n,state:i,relative:r}=t;tt()||_(!1);let{future:o,static:l}=e.useContext(Y),{matches:s}=e.useContext(Q),{pathname:m}=et(),c=nt(),g=F(a,j(s,o.v7_relativeSplatPath),m,"path"===r),u=JSON.stringify(g);return e.useEffect((()=>c(JSON.parse(u),{replace:n,state:i,relative:r})),[c,u,r,n,i]),null}function ht(t){_(!1)}function _t(t){let{basename:a="/",children:n=null,location:i,navigationType:r=p.Pop,navigator:o,static:l=!1,future:s}=t;tt()&&_(!1);let m=a.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:o,static:l,future:$({v7_relativeSplatPath:!1},s)})),[m,s,o,l]);"string"==typeof i&&(i=b(i));let{pathname:g="/",search:u="",hash:d="",state:h=null,key:k="default"}=i,f=e.useMemo((()=>{let t=A(g,m);return null==t?null:{location:{pathname:t,search:u,hash:d,state:h,key:k},navigationType:r}}),[m,g,u,d,h,k,r]);return null==f?null:e.createElement(Y.Provider,{value:c},e.createElement(X.Provider,{children:n,value:f}))}function kt(t){let{children:e,location:a}=t;return rt(ft(e),a)}function ft(t,a){void 0===a&&(a=[]);let n=[];return e.Children.forEach(t,((t,i)=>{if(!e.isValidElement(t))return;let r=[...a,i];if(t.type===e.Fragment)return void n.push.apply(n,ft(t.props.children,r));t.type!==ht&&_(!1),t.props.index&&t.props.children&&_(!1);let o={id:t.props.id||r.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=ft(t.props.children,r)),n.push(o)})),n}e.startTransition,new Promise((()=>{})),e.Component;const Et=window.ReactDOM;var vt=t.n(Et);function bt(){return bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},bt.apply(this,arguments)}function yt(t,e){if(null==t)return{};var a,n,i={},r=Object.keys(t);for(n=0;n<r.length;n++)a=r[n],e.indexOf(a)>=0||(i[a]=t[a]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const xt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],St=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],wt=e.createContext({isTransitioning:!1});new Map;const Nt=e.startTransition;function Ct(t){let{basename:a,children:n,future:i,window:r}=t,o=e.useRef();null==o.current&&(o.current=function(t){return void 0===t&&(t={}),function(t,e,a,n){void 0===n&&(n={});let{window:i=document.defaultView,v5Compat:r=!1}=n,o=i.history,l=p.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function g(){l=p.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:k.location,delta:e})}function u(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,a="string"==typeof t?t:v(t);return _(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==m&&(m=0,o.replaceState(d({},o.state,{idx:m}),""));let k={get action(){return l},get location(){return t(i,o)},listen(t){if(s)throw new Error("A history only accepts one active listener");return i.addEventListener(h,g),s=t,()=>{i.removeEventListener(h,g),s=null}},createHref:t=>e(i,t),createURL:u,encodeLocation(t){let e=u(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=p.Push;let n=E(k.location,t,e);a&&a(n,t),m=c()+1;let g=f(n,m),u=k.createHref(n);try{o.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(u)}r&&s&&s({action:l,location:k.location,delta:1})},replace:function(t,e){l=p.Replace;let n=E(k.location,t,e);a&&a(n,t),m=c();let i=f(n,m),g=k.createHref(n);o.replaceState(i,"",g),r&&s&&s({action:l,location:k.location,delta:0})},go:t=>o.go(t)};return k}((function(t,e){let{pathname:a="/",search:n="",hash:i=""}=b(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),E("",{pathname:a,search:n,hash:i},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:v(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:r,v5Compat:!0}));let l=o.current,[s,m]=e.useState({action:l.action,location:l.location}),{v7_startTransition:c}=i||{},g=e.useCallback((t=>{c&&Nt?Nt((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>l.listen(g)),[l,g]),e.createElement(_t,{basename:a,children:n,location:s.location,navigationType:s.action,navigator:l,future:i})}Et.flushSync;const Tt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gt=e.forwardRef((function(t,a){let n,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:g,unstable_viewTransition:u}=t,d=yt(t,xt),{basename:p}=e.useContext(Y),h=!1;if("string"==typeof c&&Dt.test(c)&&(n=c,Tt))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),a=A(e.pathname,p);e.origin===t.origin&&null!=a?c=a+e.search+e.hash:h=!0}catch(t){}let k=function(t,a){let{relative:n}=void 0===a?{}:a;tt()||_(!1);let{basename:i,navigator:r}=e.useContext(Y),{hash:o,pathname:l,search:s}=it(t,{relative:n}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),f=function(t,a){let{target:n,replace:i,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s}=void 0===a?{}:a,m=nt(),c=et(),g=it(t,{relative:l});return e.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 a=void 0!==i?i:v(c)===v(g);m(t,{replace:a,state:r,preventScrollReset:o,relative:l,unstable_viewTransition:s})}}),[c,m,g,i,r,n,t,o,l,s])}(c,{replace:l,state:s,target:m,preventScrollReset:g,relative:r,unstable_viewTransition:u});return e.createElement("a",bt({},d,{href:n||k,onClick:h||o?i:function(t){i&&i(t),t.defaultPrevented||f(t)},ref:a,target:m}))})),Pt=e.forwardRef((function(t,a){let{"aria-current":n="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,unstable_viewTransition:m,children:c}=t,g=yt(t,St),u=it(s,{relative:g.relative}),d=et(),p=e.useContext(V),{navigator:h}=e.useContext(Y),k=null!=p&&function(t,a){void 0===a&&(a={});let n=e.useContext(wt);null==n&&_(!1);let{basename:i}=function(t){let a=e.useContext(q);return a||_(!1),a}(It.useViewTransitionState),r=it(t,{relative:a.relative});if(!n.isTransitioning)return!1;let o=A(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=A(n.nextLocation.pathname,i)||n.nextLocation.pathname;return null!=R(r.pathname,l)||null!=R(r.pathname,o)}(u)&&!0===m,f=h.encodeLocation?h.encodeLocation(u).pathname:u.pathname,E=d.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(E=E.toLowerCase(),v=v?v.toLowerCase():null,f=f.toLowerCase());const b="/"!==f&&f.endsWith("/")?f.length-1:f.length;let y,x=E===f||!o&&E.startsWith(f)&&"/"===E.charAt(b),S=null!=v&&(v===f||!o&&v.startsWith(f)&&"/"===v.charAt(f.length)),w={isActive:x,isPending:S,isTransitioning:k},N=x?n:void 0;y="function"==typeof r?r(w):[r,x?"active":null,S?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof l?l(w):l;return e.createElement(Gt,bt({},g,{"aria-current":N,className:y,ref:a,style:C,to:s,unstable_viewTransition:m}),"function"==typeof c?c(w):c)}));var It,Mt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(It||(It={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Mt||(Mt={}));const Ot=({title:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-px-8 gtmkit-py-6 gtmkit-sticky"},(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-items-center gtmkit-justify-between"},(0,e.createElement)("h1",{className:"gtmkit-flex gtmkit-items-center gtmkit-font-medium gtmkit-text-3xl"},(0,e.createElement)("svg",{className:"gtmkit-mr-8",height:"44",viewBox:"0 0 160 54",width:"128",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("rect",{fill:"#888",height:"54",rx:"4.265",width:"160"}),(0,e.createElement)("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,e.createElement)("g",{fill:"#fff",transform:"matrix(1.465202 0 0 1.465202 -4.582436 -7.553126)"},(0,e.createElement)("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,e.createElement)("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)))),Rt=({to:t,title:a})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Pt,{to: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 ":"")},a)),Ut=({NavList:t})=>(0,e.createElement)("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"},t.map((function(t){return(0,e.createElement)(Rt,{key:t.to,to:t.to,title:t.title})})));function At(){return At=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},At.apply(this,arguments)}function Lt(t,e){if(null==t)return{};var a,n,i={},r=Object.keys(t);for(n=0;n<r.length;n++)a=r[n],e.indexOf(a)>=0||(i[a]=t[a]);return i}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}function Ft(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,jt(t,e)}function Ht(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Bt=a().createContext(null);var Wt=function(t){return t.scrollTop},Kt="unmounted",Jt="exited",zt="entering",$t="entered",qt="exiting",Vt=function(t){function e(e,a){var n;n=t.call(this,e,a)||this;var i,r=a&&!a.isMounting?e.enter:e.appear;return n.appearStatus=null,e.in?r?(i=Jt,n.appearStatus=zt):i=$t:i=e.unmountOnExit||e.mountOnEnter?Kt:Jt,n.state={status:i},n.nextCallback=null,n}Ft(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Kt?{status:Jt}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var a=this.state.status;this.props.in?a!==zt&&a!==$t&&(e=zt):a!==zt&&a!==$t||(e=qt)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,a,n=this.props.timeout;return t=e=a=n,null!=n&&"number"!=typeof n&&(t=n.exit,e=n.enter,a=void 0!==n.appear?n.appear:e),{exit:t,enter:e,appear:a}},n.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===zt){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this);a&&Wt(a)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jt&&this.setState({status:Kt})},n.performEnter=function(t){var e=this,a=this.props.enter,n=this.context?this.context.isMounting:t,i=this.props.nodeRef?[n]:[vt().findDOMNode(this),n],r=i[0],o=i[1],l=this.getTimeouts(),s=n?l.appear:l.enter;t||a?(this.props.onEnter(r,o),this.safeSetState({status:zt},(function(){e.props.onEntering(r,o),e.onTransitionEnd(s,(function(){e.safeSetState({status:$t},(function(){e.props.onEntered(r,o)}))}))}))):this.safeSetState({status:$t},(function(){e.props.onEntered(r)}))},n.performExit=function(){var t=this,e=this.props.exit,a=this.getTimeouts(),n=this.props.nodeRef?void 0:vt().findDOMNode(this);e?(this.props.onExit(n),this.safeSetState({status:qt},(function(){t.props.onExiting(n),t.onTransitionEnd(a.exit,(function(){t.safeSetState({status:Jt},(function(){t.props.onExited(n)}))}))}))):this.safeSetState({status:Jt},(function(){t.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,a=!0;return this.nextCallback=function(n){a&&(a=!1,e.nextCallback=null,t(n))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(t,e){this.setNextCallback(e);var a=this.props.nodeRef?this.props.nodeRef.current:vt().findDOMNode(this),n=null==t&&!this.props.addEndListener;if(a&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],r=i[0],o=i[1];this.props.addEndListener(r,o)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if(t===Kt)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,Lt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a().createElement(Bt.Provider,{value:null},"function"==typeof n?n(t,i):a().cloneElement(a().Children.only(n),i))},e}(a().Component);function Yt(){}Vt.contextType=Bt,Vt.propTypes={},Vt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yt,onEntering:Yt,onEntered:Yt,onExit:Yt,onExiting:Yt,onExited:Yt},Vt.UNMOUNTED=Kt,Vt.EXITED=Jt,Vt.ENTERING=zt,Vt.ENTERED=$t,Vt.EXITING=qt;const Xt=Vt;var Qt=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return n=e,void((a=t).classList?a.classList.remove(n):"string"==typeof a.className?a.className=Ht(a.className,n):a.setAttribute("class",Ht(a.className&&a.className.baseVal||"",n)));var a,n}))},Zt=function(t){function e(){for(var e,a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(t,a){var n=e.resolveArguments(t,a),i=n[0],r=n[1];e.removeClasses(i,"exit"),e.addClass(i,r?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(t,a)},e.onEntering=function(t,a){var n=e.resolveArguments(t,a),i=n[0],r=n[1]?"appear":"enter";e.addClass(i,r,"active"),e.props.onEntering&&e.props.onEntering(t,a)},e.onEntered=function(t,a){var n=e.resolveArguments(t,a),i=n[0],r=n[1]?"appear":"enter";e.removeClasses(i,r),e.addClass(i,r,"done"),e.props.onEntered&&e.props.onEntered(t,a)},e.onExit=function(t){var a=e.resolveArguments(t)[0];e.removeClasses(a,"appear"),e.removeClasses(a,"enter"),e.addClass(a,"exit","base"),e.props.onExit&&e.props.onExit(t)},e.onExiting=function(t){var a=e.resolveArguments(t)[0];e.addClass(a,"exit","active"),e.props.onExiting&&e.props.onExiting(t)},e.onExited=function(t){var a=e.resolveArguments(t)[0];e.removeClasses(a,"exit"),e.addClass(a,"exit","done"),e.props.onExited&&e.props.onExited(t)},e.resolveArguments=function(t,a){return e.props.nodeRef?[e.props.nodeRef.current,t]:[t,a]},e.getClassNames=function(t){var a=e.props.classNames,n="string"==typeof a,i=n?(n&&a?a+"-":"")+t:a[t];return{baseClassName:i,activeClassName:n?i+"-active":a[t+"Active"],doneClassName:n?i+"-done":a[t+"Done"]}},e}Ft(e,t);var n=e.prototype;return n.addClass=function(t,e,a){var n=this.getClassNames(e)[a+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===e&&"done"===a&&i&&(n+=" "+i),"active"===a&&t&&Wt(t),n&&(this.appliedClasses[e][a]=n,function(t,e){t&&e&&e.split(" ").forEach((function(e){return n=e,void((a=t).classList?a.classList.add(n):function(t,e){return t.classList?!!e&&t.classList.contains(e):-1!==(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")}(a,n)||("string"==typeof a.className?a.className=a.className+" "+n:a.setAttribute("class",(a.className&&a.className.baseVal||"")+" "+n)));var a,n}))}(t,n))},n.removeClasses=function(t,e){var a=this.appliedClasses[e],n=a.base,i=a.active,r=a.done;this.appliedClasses[e]={},n&&Qt(t,n),i&&Qt(t,i),r&&Qt(t,r)},n.render=function(){var t=this.props,e=(t.classNames,Lt(t,["classNames"]));return a().createElement(Xt,At({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(a().Component);Zt.defaultProps={classNames:""},Zt.propTypes={};const te=Zt,ee=({title:t=(0,n.__)("Save","gtm-kit"),className:a="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{useUpdateSettings:o,useIsPending:l,useCanSave:s}=(0,i.useContext)(g);return(0,e.createElement)(r.Button,{className:a,onClick:()=>o(),variant:"primary",disabled:l||!s},s?(0,n.__)(t,"gtm-kit"):(0,n.__)("Saved","gtm-kit"),l?(0,e.createElement)(r.Spinner,null):"")},ae=()=>{const{useCanSave:t}=(0,i.useContext)(g);return(0,e.createElement)(te,{in:t,timeout:500,classNames:"slide",unmountOnExit:!0},(0,e.createElement)("footer",{className:"gtmkit-fixed gtmkit-bottom-0 gtmkit-w-full gtmkit-z-10 gtmkit-bg-color-grey gtmkit-text-white gtmkit-p-8"},(0,e.createElement)(ee,null)))},ne=({subject:t})=>{const a=!0===t||"on"===t,i=!0===a?"gtmkit-bg-color-success":"gtmkit-bg-color-button-disabled";return(0,e.createElement)("div",{className:"gtmkit-text-xs gtmkit-text-white gtmkit-font-bold gtmkit-rounded-full gtmkit-py gtmkit-px-2 gtmkit-h-5 gtmkit-leading-5 gtmkit-uppercase "+i},a?(0,n.__)("Active","gtm-kit"):(0,n.__)("Inactive","gtm-kit"))},ie=(0,i.forwardRef)((({children:t,className:a="",...n},i)=>(0,e.createElement)("div",{...n,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 gtmkit-group gtmkit-w-full "+a,ref:i},t)));ie.Header=({as:t="h3",title:a="",children:n,className:i="",...r})=>(0,e.createElement)("div",{...r,className:"gtmkit-flex gtmkit-justify-between gtmkit-items-center gtmkit-mb-5 "+i},(0,e.createElement)(t,{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading"},a),n),ie.Content=({as:t="div",children:a,className:n="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:n},a),ie.Button=({url:t,destination:a,newTab:n=!1,text:i,group:o="",...l})=>{const s=nt();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-rounded !gtmkit-py-4 !gtmkit-px-8 gtmkit-w-full sm:gtmkit-w-auto gtmkit-min-w-[225px]",onClick:()=>{a&&t&&!1===n?window.gtmkitSettings.current_poage===o?s(a,{replace:!0}):window.location.href=t+"#"+a:t?n?window.open(t):window.location.href=t:s(a,{replace:!0})}},(0,e.createElement)("span",{className:"gtmkit-mx-auto gtmkit-text-sm gtmkit-font-bold"},i)))};const re=ie,oe=({title:t,data:a,className:r=""})=>{const{useSettings:o}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8 gtmkit-mt-6"},t),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px] "+r},a.map(((t,a)=>!1===t.featured?null:(0,e.createElement)(re,{key:a},(0,e.createElement)(re.Header,{title:t.title},t.pill?(0,e.createElement)(ne,{subject:o[t.group][t.option]}):null),(0,e.createElement)(re.Content,null,t.text.map(((t,a)=>(0,e.createElement)("p",{key:a},t)))),(0,e.createElement)(re.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,n.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))},le=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,n.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,n.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,n.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,n.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,n.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,n.__)("Setup integration","gtm-kit")}}],se=[{title:"Getting started with GTM Kit",text:[(0,n.__)("How to get the most out of Google Tag Manager with GTM Kit.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!0},{title:(0,n.__)("WooCommerce integration","gtm-kit"),text:[(0,n.__)("Integrate WooCommerce with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=dashboard-tutorials"},featured:!0},{title:"Contact Form 7 Integration",text:[(0,n.__)("Integrate Contact Form 7 with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/contact-form-7-integration/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Easy Digital Downloads integration",text:[(0,n.__)("Integrate Easy Digital Downloads with Google Tag Manager and Google Analytics.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/set-up-easy-digital-downloads-for-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Advanced GTM container implementation",text:[(0,n.__)("Customization of the GTM container implementation and Server Side Tracking.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1},{title:"Settings, actions and filters for developers",text:[(0,n.__)("One of the things that makes GTM Kit a great tool for developers is the ability to override options in wp-config.php.","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=dashboard-tutorials"},featured:!1}],me=()=>{const{useSettings:t}=(0,i.useContext)(g),[a,r]=(0,i.useState)(se),o=Boolean(t.general.sgtm_domain&&t.general.sgtm_domain.trim());return(0,i.useEffect)((()=>{r((t=>[...t,{title:(0,n.__)("See all tutorials…","gtm-kit"),text:[(0,n.__)("See all our tutorial and get the most out of GTM Kit","gtm-kit")],link:{external:!0,url:"https://gtmkit.com/documentation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=documentation&utm_content=dashboard-tutorials",text:(0,n.__)("Read articles","gtm-kit")},featured:!0}]))}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("General","gtm-kit")),(0,e.createElement)("div",{className:"lg:gtmkit-grid lg:gtmkit-grid-cols-2 xl:gtmkit-grid-cols-3 lg:gtmkit-justify-between gtmkit-gap-6 gtmkit-border-b gtmkit-border-color-border gtmkit-pb-6 gtmkit-min-h-[175px]"},(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ne,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(re.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,n.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,n.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,n.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,n.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ne,{subject:o})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,n.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/container",text:(0,n.__)("Edit container","gtm-kit")})),(0,e.createElement)(re,null,(0,e.createElement)(re.Header,{title:(0,n.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ne,{subject:t.general.analytics_active})),(0,e.createElement)(re.Content,null,(0,e.createElement)("p",null,(0,n.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(re.Button,{destination:"/misc",text:(0,n.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(oe,{title:(0,n.__)("Tutorials","gtm-kit"),data:a}),(0,e.createElement)(oe,{title:(0,n.__)("Integrations","gtm-kit"),data:le}))},ce=({title:t,placeholder:a,help:n,className:o="gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",optionGroup:l="general",optionName:s,isDisabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,i.useContext)(g);return(0,e.createElement)(r.TextControl,{label:t,placeholder:a,help:n,className:o,value:c[l][s],onChange:t=>u(l,s,t),disabled:m})},ge=({title:t,label:a,optionGroup:n="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(r.BaseControl,{label:t},(0,e.createElement)(r.ToggleControl,{label:a,checked:!l&&s[n][o],onChange:()=>{m(n,o,!(s&&s[n][o]))},disabled:l}))))},ue=({title:t,options:a,help:n,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,i.useContext)(g);return(0,e.createElement)(r.RadioControl,{label:t,options:a,help:n,className:o,selected:parseInt(c[l][s]),onChange:t=>u(l,s,t),disabled:m})},de=(0,i.forwardRef)((({children:t,className:a="",disabled:n=!1,...i},r)=>(0,e.createElement)("div",{...i,className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-w-3/4 gtmkit-border-color-grey "+a+(n?"gtmkit-opacity-60":""),ref:r},t)));de.Header=({as:t="h3",title:a="",children:n,className:i="",...r})=>(0,e.createElement)(t,{...r,className:"gtmkit-font-bold gtmkit-text-lg gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey "+i},a,n),de.Content=({as:t="div",children:a,className:n="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+n},a);const pe=de,he=()=>{const{useSettings:t}=(0,i.useContext)(g),a=!(t.general.sgtm_domain&&t.general.sgtm_domain.trim()&&t.general.sgtm_container_identifier&&t.general.sgtm_container_identifier.trim());return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("General Container Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit")),(0,e.createElement)(ce,{title:(0,n.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,n.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ge,{title:(0,n.__)("Inject Container Code","gtm-kit"),label:(0,n.__)("Setting this to Off will remove the Google Tag Manager container code but the data layer will remain.","gtm-kit"),optionName:"container_active"}),(0,e.createElement)(ge,{title:(0,n.__)("Just the container","gtm-kit"),label:(0,n.__)("Setting this to On will reduce the functionality to just the GTM container code. No additional data will be pushed to the datalayer regardless of any other settings.","gtm-kit"),optionName:"just_the_container"}),(0,e.createElement)(ce,{title:(0,n.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,n.__)("The default name of the data layer object is dataLayer. If you prefer to use a different name for your data layer, you may do.","gtm-kit")}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,n.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,n.__)("Enter domain …","gtm-kit"),help:(0,n.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,n.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,n.__)("Enter loader name …","gtm-kit"),help:(0,n.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ge,{title:(0,n.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,n.__)("Prolong cookie lifetime in Safari and other browsers with ITP. This only works if you use Stape sGTM hosting and have set up the Cookie Keeper power up.","gtm-kit"),optionName:"sgtm_cookie_keeper",disabled:a})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/google-tag-manager-server-side-tagging/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=sgtm&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Setting up server-side tracking can be challenging and costly but there is an easy and cheap solution.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Stape.io is a solution for hosting server-side Google Tag Manager containers, offering a simplified approach that demands less technical expertise than solutions like Google Cloud Platform.","gtm-kit")," ",(0,n.__)("Additionally, it provides valuable add-ons for enhanced functionality.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:"https://stape.io/?pt=tlam&rs=plugin",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Page Speed Optimization","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("load_js event","gtm-kit"),label:(0,n.__)("Setting this to On will push the event 'load_js' om page load.","gtm-kit"),optionName:"load_js_event"})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Delay JavaScript execution","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Page optimization plugins can delay the 'load_js' event and this can be used to delay the triggering og tags in Google Tag Manager.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/guides/delay-javascript-execution-in-gtm/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=delay-js&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Tag Manager Environment","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(pe.Content,null,(0,e.createElement)(ce,{title:(0,n.__)("gtm_auth:","gtm-kit"),optionName:"gtm_auth",placeholder:(0,n.__)("Enter gtm_auth code","gtm-kit"),help:(0,n.__)("Enter your gtm_auth code your GTM environment.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,n.__)("gtm_preview:","gtm-kit"),optionName:"gtm_preview",placeholder:(0,n.__)("Enter gtm_preview code","gtm-kit"),help:(0,n.__)("Enter your gtm_preview code your GTM environment.","gtm-kit")})),(0,e.createElement)("div",{className:"gtmkit-px-8 gtmkit-py-6"},(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-px-4 gtmkit-mt-3"},(0,e.createElement)("h4",{className:"gtmkit-pt-3 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Environments","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("In Google Tag Manager you can define different environments like Live, Dev and QA.","gtm-kit")," ",(0,n.__)('To use a specific environment in GTM Kit you must enter the "gtm_auth" and "gtm_preview" codes for that environment.',"gtm-kit")," ",(0,n.__)("If left empty the default environment will be used.","gtm-kit")),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,n.__)("Override settings in wp-config.php","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("You can override the values of using constants in wp-config.php, which is a very useful for setting the value in your development and staging environments.","gtm-kit")," ",(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=container-settings&utm_content=dashboard-container",className:"gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",target:"_blank",rel:"noreferrer"},(0,n.__)("Learn more","gtm-kit"))))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,n.__)("Container code implementation:","gtm-kit"),options:[{label:(0,n.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,n.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,n.__)("Depending on how you use Google Tag Manager you can delay the loading of the container script until the browser is idle.","gtm-kit"),optionName:"script_implementation"}),(0,e.createElement)(ue,{title:(0,n.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,n.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,n.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,n.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,n.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,n.__)('The preferred method to implement the <noscript> container code is just after the opening <body> tag. This requires that your theme uses the "body_open" hook. If your theme does not support this the script can be injected in the footer or you can use the function below.',"gtm-kit"),optionName:"noscript_implementation"}),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,e.createElement)("code",null,"<?php if ( function_exists( 'gtmkit_the_noscript_tag' ) ) { gtmkit_the_noscript_tag(); } ?>")))))},_e=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Post Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ge,{title:(0,n.__)("Post type","gtm-kit"),id:"post-type",label:(0,n.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ge,{title:(0,n.__)("Page type","gtm-kit"),id:"page-type",label:(0,n.__)('Include the defined page type. I.e. post, page, product, category, cart, checkout etc. You may override this on page-level and set you own page type i.e. "campaign".',"gtm-kit"),optionName:"datalayer_page_type"}),(0,e.createElement)(ge,{title:(0,n.__)("Categories","gtm-kit"),id:"categories",label:(0,n.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ge,{title:(0,n.__)("Tags","gtm-kit"),id:"tags",label:(0,n.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ge,{title:(0,n.__)("Post title","gtm-kit"),id:"post-title",label:(0,n.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ge,{title:(0,n.__)("Post ID","gtm-kit"),id:"post-id",label:(0,n.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ge,{title:(0,n.__)("Post data","gtm-kit"),id:"post-date",label:(0,n.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ge,{title:(0,n.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,n.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ge,{title:(0,n.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,n.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),ke=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("User Data","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,n.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,n.__)("Full page caching will cache user data making it the same for all users. There are ways around this, but it depends on the chosen cache solution and is only for advanced users.","gtm-kit")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,n.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ge,{title:(0,n.__)("User ID","gtm-kit"),id:"user-id",label:(0,n.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ge,{title:(0,n.__)("User role","gtm-kit"),id:"user-role",label:(0,n.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),fe=()=>{const{useSettings:t}=(0,i.useContext)(g),a=!t.general.gcm_default_settings;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,n.__)("Warning!","gtm-kit"))),(0,e.createElement)(pe.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,n.__)("Most Consent Management Platforms will handle the Google Consent Mode settings for you and applying the default settings in both GTM Kit and you CMP will lead to unexpected behaviour or errors.","gtm-kit")),(0,e.createElement)("p",null,(0,n.__)("You should only use these settings if you do not have a Consent Management Platform that supports Google Consent Mode.","gtm-kit")),(0,e.createElement)("p",{className:"!gtmkit-mt-4"},(0,n.__)("GTM Kit will only set the default Consent Mode settings and you must update the settings yourself when the user has given consent.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-color-primary !gtmkit-my-6"},(0,e.createElement)("a",{href:"https://developers.google.com/tag-platform/security/guides/consent#implementation_example",target:"_blank",rel:"noreferrer",className:"hover:gtmkit-underline gtmkit-font-semibold"},(0,n.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ge,{title:(0,n.__)("Activate GCM settings","gtm-kit"),label:(0,n.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(pe,{disabled:a},(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Ad Personalization","gtm-kit"),label:(0,n.__)("Enables personalized advertising","gtm-kit"),optionName:"gcm_ad_personalization",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Ad Storage","gtm-kit"),label:(0,n.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Ad User Data","gtm-kit"),label:(0,n.__)("Enables sending user data related to advertising to Google","gtm-kit"),optionName:"gcm_ad_user_data",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Analytics Storage","gtm-kit"),label:(0,n.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Functionality Storage","gtm-kit"),label:(0,n.__)("Enables storage that supports the functionality of the website or app such as language settings","gtm-kit"),optionName:"gcm_functionality_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Personalization Storage","gtm-kit"),label:(0,n.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:a}),(0,e.createElement)(ge,{title:(0,n.__)("Security Storage","gtm-kit"),label:(0,n.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:a}))))},Ee=({label:t,value:a,tag:n})=>(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-4 gtmkit-py-2"},(0,e.createElement)("strong",null,t)),(0,e.createElement)("td",{className:"gtmkit-px-4 gtmkit-py-2"},"code"===n?(0,e.createElement)("code",{className:"gtmkit-text-sm"},a):(0,e.createElement)("em",null,a))),ve=()=>{const{useSiteData:t}=(0,i.useContext)(g),a=Object.values(t.shared_data);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,n.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-2 gtmkit-text-color-grey"},(0,n.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm gtmkit-my-6 gtmkit-py-6"},(0,e.createElement)("tbody",{className:"gtmkit-py-6"},a.map((function(t,a){return(0,e.createElement)(Ee,{key:a,label:t.label,value:t.value,tag:t.tag})})))))},be=()=>{const{}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Misc","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ve,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,n.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ge,{title:(0,n.__)("Share anonymous data","gtm-kit"),label:(0,n.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Console log","gtm-kit"),label:(0,n.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},ye=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(oe,{title:(0,n.__)("Integrations","gtm-kit"),data:le})),xe=({pluginName:t})=>(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.sprintf)((0,n.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,n.sprintf)((0,n.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(r.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-4 !gtmkit-px-6 gtmkit-text-sm disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.pluginInstallUrl+t}},(0,n.sprintf)((0,n.__)("Install %s","gtm-kit"),t)))),Se=({title:t,options:a,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m=!1,help:c="",notSet:u=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,i.useContext)(g),h=u?[{label:(0,n.__)("(not set)","gtm-kit"),value:""},...a]:a;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(r.SelectControl,{label:t,value:d&&d[l][s],options:h,className:o,onChange:t=>p(l,s,t),disabled:m,help:c}))},we=({pluginName:t,optionName:a,pluginInactive:i})=>(0,e.createElement)(pe,{disabled:i},(0,e.createElement)(pe.Header,{title:(0,n.sprintf)((0,n.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.sprintf)((0,n.__)("Track %s","gtm-kit"),t),label:(0,n.sprintf)((0,n.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:a,disabled:i}))),Ne=[{label:(0,n.__)("Retail","gtm-kit"),value:"retail"},{label:(0,n.__)("Education","gtm-kit"),value:"education"},{label:(0,n.__)("Flights","gtm-kit"),value:"flights"},{label:(0,n.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,n.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,n.__)("Local deals","gtm-kit"),value:"local"},{label:(0,n.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,n.__)("Travel","gtm-kit"),value:"travel"},{label:(0,n.__)("Custom","gtm-kit"),value:"custom"}],Ce=()=>{const{useSettings:t}=(0,i.useContext)(g),a="WooCommerce",r=!window.gtmkitSettings.plugins.woocommerce,o=r||!t.integrations.woocommerce_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("WooCommerce","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:a}):null,(0,e.createElement)(we,{pluginName:a,optionName:"woocommerce_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Basic settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,n.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,n.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Use SKU instead of ID","gtm-kit"),label:(0,n.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_use_sku",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Exclude tax","gtm-kit"),label:(0,n.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Exclude shipping from revenue","gtm-kit"),label:(0,n.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include customer data","gtm-kit"),label:(0,n.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Event customization","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:"view_item_list (with product filter)",options:[{label:(0,n.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,n.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,n.__)("Do you what to push the view_item_list event if the list is updated using a filter or just once per page view.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_view_item_list_limit",disabled:o}),(0,e.createElement)(ue,{title:"view_item",options:[{label:(0,n.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,n.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,n.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,n.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:o}),(0,e.createElement)(ue,{title:"add_shipping_info ",options:[{label:(0,n.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,n.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,n.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,n.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:o}),(0,e.createElement)(ue,{title:"add_payment_info ",options:[{label:(0,n.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,n.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,n.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,n.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,n.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Ne,help:(0,n.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,n.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,n.__)("Enter prefix …","gtm-kit"),help:(0,n.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,n.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_dequeue_script",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include permalink structure","gtm-kit"),label:(0,n.__)("Enable this option to include the permalink structure of the product base, category base, tag base and attribute base.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_permalink_structure",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include path of pages","gtm-kit"),label:(0,n.__)("Enable this option to include the path of cart, checkout, order received and my account page.","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_include_pages",disabled:o}))))},Te=()=>{const{useSettings:t}=(0,i.useContext)(g),a="Contact Form 7",r=!window.gtmkitSettings.plugins.cf7,o=r||!t.integrations.cf7_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Contact Form 7","gtm-kit")),r?(0,e.createElement)(xe,{pluginName:a}):null,(0,e.createElement)(we,{pluginName:a,optionName:"cf7_integration",pluginInactive:r}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,n.__)("Load JavaScript","gtm-kit"),options:[{label:(0,n.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,n.__)("On all pages","gtm-kit"),value:2}],help:(0,n.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:o}))))},De=()=>{const t="Easy Digital Downloads",a=!window.gtmkitSettings.plugins.edd,{useSettings:r}=(0,i.useContext)(g),o=a||!r.integrations.edd_integration;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Easy Digital Downloads","gtm-kit")),a?(0,e.createElement)(xe,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:a}),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Use SKU instead of ID","gtm-kit"),label:(0,n.__)("Use SKU instead of the product ID with fallback to ID if no SKU is set.","gtm-kit"),optionGroup:"integrations",optionName:"edd_use_sku",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Exclude tax","gtm-kit"),label:(0,n.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:o}),(0,e.createElement)(ge,{title:(0,n.__)("Include customer data","gtm-kit"),label:(0,n.__)('Enable this option to include customer data in the data layer on the "purchase" event.',"gtm-kit"),optionGroup:"integrations",optionName:"edd_include_customer_data",disabled:o}))),(0,e.createElement)(pe,{disabled:o},(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(Se,{title:(0,n.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Ne,help:(0,n.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:o}),(0,e.createElement)(ce,{title:(0,n.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,n.__)("Enter prefix …","gtm-kit"),help:(0,n.__)("If your product feed generator is adding a prefix to the product IDs, you can add the prefix here to include it in the Data Layer.","gtm-kit"),disabled:o}))),(0,e.createElement)(pe,{disabled:a},(0,e.createElement)(pe.Header,{title:(0,n.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ge,{title:(0,n.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,n.__)("Enable this option to dequeue the default JavaScript if you plan to create your own JavaScript.","gtm-kit"),optionGroup:"integrations",optionName:"edd_dequeue_script",disabled:o}))))},Ge=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Help","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,n.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,n.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-font-semibold hover:gtmkit-underline",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/"},(0,n.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,n.__)("GTM container import files:","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,n.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{className:"hover:gtmkit-underline",href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,n.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Tutorials","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",null,se.map(((t,a)=>(0,e.createElement)("li",{key:a,className:"gtmkit-mb-4"},(0,e.createElement)("a",{href:t.link.url,target:"_blank",rel:"noreferrer",className:"gtmkit-font-semibold gtmkit-text-color-primary hover:gtmkit-underline"},t.title),t.text.map(((t,a)=>(0,e.createElement)("div",{key:a,className:"gtmkit-text-sm"},t)))))))))),Pe=()=>{const{useIsSending:t,useSiteData:a,useUpdateSupportTicket:o,useSupportTicket:l,useSendSystemData:s,useIsSystemDataSent:m,useSystemDataMessage:c}=(0,i.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"gtmkit-text-2xl gtmkit-font-bold gtmkit-text-color-heading gtmkit-mb-8"},(0,n.__)("Get support","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Support options","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("ul",{className:"gtmkit-text-color-primary"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://wordpress.org/support/plugin/gtm-kit/",target:"_blank",rel:"noreferrer"},(0,n.__)("WordPress.org Support Forum","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,n.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,n.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("Share system data with the GTM Kit support team","gtm-kit")}),(0,e.createElement)(pe.Content,null,m?(0,e.createElement)("p",{className:"gtmkit-mb-2"},c):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:"gtmkit-mb-2"},(0,n.__)("If the GTM Kit support team has asked you to send your system data you can do so by entering the support ticket below:","gtm-kit")),(0,e.createElement)(r.TextControl,{label:(0,e.createElement)("span",{className:"gtmkit-text-red-600"},c," "),placeholder:(0,n.__)("Enter support ticket","gtm-kit"),className:"gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",value:l,onChange:t=>o(t)}),(0,e.createElement)(r.Button,{variant:"primary",className:"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",onClick:()=>{s()},disabled:!l.toUpperCase().startsWith("FS")},(0,e.createElement)("span",null,(0,n.__)("Send system data","gtm-kit")),t?(0,e.createElement)(r.Spinner,null):"")))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,n.__)("About GTM Kit","gtm-kit"),className:"gtmkit-flex gtmkit-items-center"},(0,e.createElement)("span",{className:"gtmkit-text-sm gtmkit-text-color-grey gtmkit-font-light gtmkit-ml-2"},"(",(0,n.__)("Version:","gtm-kit")," ",a.gtmkit_version,")")),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",null,(0,n.__)("Learn about changes and follow the development of GTM Kit:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,n.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary  hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,n.__)("The Github repository","gtm-kit"))))))};const Ie={integrations:(0,n.__)("Integrations","gtm-kit"),help:(0,n.__)("Help","gtm-kit")},Me=()=>{const{useSettings:t}=(0,i.useContext)(g),a=window.gtmkitSettings.currentPage,o=function({page:t}){const e=[{to:"general",title:(0,n.__)("Dashboard","gtm-kit")},{to:"container",title:(0,n.__)("Container","gtm-kit")},{to:"post-data",title:(0,n.__)("Post data","gtm-kit")},{to:"user-data",title:(0,n.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,n.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,n.__)("Misc","gtm-kit")}],a=[{to:"integrations",title:(0,n.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],i=[{to:"help",title:(0,n.__)("Help","gtm-kit")},{to:"support",title:(0,n.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return a;case"help":return i}}({page:a}),l=Ie[a]||(0,n.__)("Settings","gtm-kit");return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ot,{title:l}),(0,e.createElement)(Ut,{NavList:o}),(0,e.createElement)("main",{className:"gtmkit-max-w-[1536px] gtmkit-px-8 gtmkit-pt-8 gtmkit-text-base"},(0,e.createElement)(kt,null,(0,e.createElement)(ht,{exact:!0,path:"/general",element:(0,e.createElement)(me,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(fe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(ye,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Te,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(De,null)}),(0,e.createElement)(ht,{exact:!0,path:"/help",element:(0,e.createElement)(Ge,null)}),(0,e.createElement)(ht,{exact:!0,path:"/support",element:(0,e.createElement)(Pe,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+a})}))),(0,e.createElement)(ae,null)):(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(r.Spinner,null))},Oe=()=>(0,e.createElement)(Ct,{basename:"/"},(0,e.createElement)(u,null,(0,e.createElement)(Me,null)));document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById(window.gtmkitSettings.rootId);null!=t&&(0,i.render)((0,e.createElement)(Oe,null),t)}))})();
  • gtm-kit/trunk/assets/admin/wizard.asset.php

    r3016305 r3032523  
    1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'c9a2c63156ea6655e237');
     1<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'fa4589566d6a7e354484');
  • gtm-kit/trunk/assets/admin/wizard.js

    r3016305 r3032523  
    1 !function(){"use strict";var t={n:function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,{a:a}),a},d:function(e,a){for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e=window.React,a=window.wp.element,n=window.wp.components,r=window.lodash,i=window.wp.apiFetch,l=t.n(i);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const o=async(t,e,a=null,n=!1)=>{let r={};try{r=await l()({path:t,method:e,...a&&{data:a}})}catch(a){return console.log(`${e} ${t} Errors:`,a),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?r:!0===r.success?r.data:options};var s=window.wp.i18n,m=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,s.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,s.__)("An error occurred.","gtm-kit"):(0,s.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage}return a};const c=(0,a.createContext)();var g,u=t=>{const[n,i]=(0,a.useReducer)(m,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),l=async()=>{const[t,e]=await Promise.all([o("gtmkit/v1/get-options","GET"),o("gtmkit/v1/get-site-data","GET")]),a="wizard"===window.gtmkitSettings.currentPage?await o("gtmkit/v1/get-install-data","GET"):{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:a}})},s=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{l()}),[]);const g={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,o("gtmkit/v1/set-options","POST",e));var e;i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:l,useUpdateState:s,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let l;i[t][e]=a,l=!(0,r.isEqual)(i,n.fetchedSettings),s({stateSettings:i,canSave:l})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const l={};l.general={...a.general,...e.general},"integrations"in e&&(l.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(l,n.fetchedSettings),s({stateSettings:l,canSave:i})},useUpdateSupportTicket:async t=>{s({supportTicket:t})},useSendSystemData:async()=>{i({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,o("gtmkit/v1/send-support-data","POST",e,!0));var e;i({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData,useIsSending:n.isSendingSystemData,useSupportTicket:n.supportTicket,useIsSystemDataSent:n.isSystemDataSent,useSystemDataMessage:n.systemDataMessage};return(0,e.createElement)(c.Provider,{value:g},t.children)};function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},d.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(g||(g={}));const p="popstate";function h(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function y(t,e){return{usr:t.state,key:t.key,idx:e}}function f(t,e,a,n){return void 0===a&&(a=null),d({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?S(e):e,{state:a,key:e&&e.key||n||Math.random().toString(36).substr(2,8)})}function E(t){let{pathname:e="/",search:a="",hash:n=""}=t;return a&&"?"!==a&&(e+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function S(t){let e={};if(t){let a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var x;function M(t,e,a){void 0===a&&(a="/");let n=U(("string"==typeof e?S(e):e).pathname||"/",a);if(null==n)return null;let r=N(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,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let i=null;for(let t=0;null==i&&t<r.length;++t)i=I(r[t],A(n));return i}function N(t,e,a,n){void 0===e&&(e=[]),void 0===a&&(a=[]),void 0===n&&(n="");let r=(t,r,i)=>{let l={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:r,route:t};l.relativePath.startsWith("/")&&(h(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),l.relativePath=l.relativePath.slice(n.length));let o=G([n,l.relativePath]),s=a.concat(l);t.children&&t.children.length>0&&(h(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),N(t.children,e,s,o)),(null!=t.path||t.index)&&e.push({path:o,score:C(o,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of v(t.path))r(t,e,a);else r(t,e)})),e}function v(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,r=a.endsWith("?"),i=a.replace(/\?$/,"");if(0===n.length)return r?[i,""]:[i];let l=v(n.join("/")),o=[];return o.push(...l.map((t=>""===t?i:[i,t].join("/")))),r&&o.push(...l),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const _=/^:\w+$/,b=3,w=2,T=1,j=10,L=-2,D=t=>"*"===t;function C(t,e){let a=t.split("/"),n=a.length;return a.some(D)&&(n+=L),e&&(n+=w),a.filter((t=>!D(t))).reduce(((t,e)=>t+(_.test(e)?b:""===e?T:j)),n)}function I(t,e){let{routesMeta:a}=t,n={},r="/",i=[];for(let t=0;t<a.length;++t){let l=a[t],o=t===a.length-1,s="/"===r?e:e.slice(r.length)||"/",m=O({path:l.relativePath,caseSensitive:l.caseSensitive,end:o},s);if(!m)return null;Object.assign(n,m.params);let c=l.route;i.push({params:n,pathname:G([r,m.pathname]),pathnameBase:B(G([r,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(r=G([r,m.pathnameBase]))}return i}function O(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[a,n]=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!0),k("*"===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 n=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,a)=>(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),r+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?r+="\\/*$":""!==t&&"/"!==t&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),r=e.match(a);if(!r)return null;let i=r[0],l=i.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:r}=e;if("*"===n){let t=o[a]||"";l=i.slice(0,i.length-t.length).replace(/(.)\/+$/,"$1")}const s=o[a];return t[n]=r&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(a){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+a+")."),t}}(s||"",n),t}),{}),pathname:i,pathnameBase:l,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return k(!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 U(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function z(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function P(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase)):a.map((t=>t.pathnameBase))}function R(t,e,a,n){let r;void 0===n&&(n=!1),"string"==typeof t?r=S(t):(r=d({},t),h(!r.pathname||!r.pathname.includes("?"),z("?","pathname","search",r)),h(!r.pathname||!r.pathname.includes("#"),z("#","pathname","hash",r)),h(!r.search||!r.search.includes("#"),z("#","search","hash",r)));let i,l=""===t||""===r.pathname,o=l?"/":r.pathname;if(null==o)i=a;else if(n){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t.pop();r.pathname=e.join("/")}i="/"+t.join("/")}else{let t=e.length-1;if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;r.pathname=e.join("/")}i=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:r=""}="string"==typeof t?S(t):t,i=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:i,search:W(n),hash:Y(r)}}(r,i),m=o&&"/"!==o&&o.endsWith("/"),c=(l||"."===o)&&a.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const G=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",Y=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const F=["post","put","patch","delete"],Q=(new Set(F),["get",...F]);function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},J.apply(this,arguments)}new Set(Q),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const H=e.createContext(null),$=e.createContext(null),Z=e.createContext(null),K=e.createContext(null),V=e.createContext({outlet:null,matches:[],isDataRoute:!1}),X=e.createContext(null);function q(){return null!=e.useContext(K)}function tt(){return q()||h(!1),e.useContext(K).location}function et(t){e.useContext(Z).static||e.useLayoutEffect(t)}function at(){let{isDataRoute:t}=e.useContext(V);return t?function(){let{router:t}=function(t){let a=e.useContext(H);return a||h(!1),a}(st.UseNavigateStable),a=ct(mt.UseNavigateStable),n=e.useRef(!1);return et((()=>{n.current=!0})),e.useCallback((function(e,r){void 0===r&&(r={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,J({fromRouteId:a},r)))}),[t,a])}():function(){q()||h(!1);let t=e.useContext(H),{basename:a,future:n,navigator:r}=e.useContext(Z),{matches:i}=e.useContext(V),{pathname:l}=tt(),o=JSON.stringify(P(i,n.v7_relativeSplatPath)),s=e.useRef(!1);return et((()=>{s.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!s.current)return;if("number"==typeof e)return void r.go(e);let i=R(e,JSON.parse(o),l,"path"===n.relative);null==t&&"/"!==a&&(i.pathname="/"===i.pathname?a:G([a,i.pathname])),(n.replace?r.replace:r.push)(i,n.state,n)}),[a,r,o,l,t])}()}function nt(t,a,n,r){q()||h(!1);let{navigator:i}=e.useContext(Z),{matches:l}=e.useContext(V),o=l[l.length-1],s=o?o.params:{},m=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let c,u=tt();if(a){var d;let t="string"==typeof a?S(a):a;"/"===m||(null==(d=t.pathname)?void 0:d.startsWith(m))||h(!1),c=t}else c=u;let p=c.pathname||"/",k=M(t,{pathname:"/"===m?p:p.slice(m.length)||"/"}),y=function(t,a,n,r){var i;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==t){var l;if(null==(l=n)||!l.errors)return null;t=n.matches}let o=t,s=null==(i=n)?void 0:i.errors;if(null!=s){let t=o.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||h(!1),o=o.slice(0,Math.min(o.length,t+1))}let m=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let t=0;t<o.length;t++){let e=o[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===n.loaderData[e.route.id]&&(!n.errors||void 0===n.errors[e.route.id])){m=!0,o=c>=0?o.slice(0,c+1):[o[0]];break}}return o.reduceRight(((t,r,i)=>{let l,g=!1,u=null,d=null;var p;n&&(l=s&&r.route.id?s[r.route.id]:void 0,u=r.route.errorElement||it,m&&(c<0&&0===i?(gt[p="route-fallback"]||(gt[p]=!0),g=!0,d=null):c===i&&(g=!0,d=r.route.hydrateFallbackElement||null)));let h=a.concat(o.slice(0,i+1)),k=()=>{let a;return a=l?u:g?d:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(ot,{match:r,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:a})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===i)?e.createElement(lt,{location:n.location,revalidation:n.revalidation,component:u,error:l,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:G([m,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:G([m,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),l,n,r);return a&&y?e.createElement(K.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:g.Pop}},y):y}function rt(){let t=function(){var t;let a=e.useContext(X),n=function(t){let a=e.useContext($);return a||h(!1),a}(mt.UseRouteError),r=ct(mt.UseRouteError);return void 0!==a?a:null==(t=n.errors)?void 0:t[r]}(),a=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(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 e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},a),n?e.createElement("pre",{style:r},n):null,null)}const it=e.createElement(rt,null);class lt extends e.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?e.createElement(V.Provider,{value:this.props.routeContext},e.createElement(X.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ot(t){let{routeContext:a,match:n,children:r}=t,i=e.useContext(H);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(V.Provider,{value:a},r)}var st=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(st||{}),mt=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}(mt||{});function ct(t){let a=function(t){let a=e.useContext(V);return a||h(!1),a}(),n=a.matches[a.matches.length-1];return n.route.id||h(!1),n.route.id}const gt={};function ut(t){let{to:a,replace:n,state:r,relative:i}=t;q()||h(!1);let{future:l,static:o}=e.useContext(Z),{matches:s}=e.useContext(V),{pathname:m}=tt(),c=at(),g=R(a,P(s,l.v7_relativeSplatPath),m,"path"===i),u=JSON.stringify(g);return e.useEffect((()=>c(JSON.parse(u),{replace:n,state:r,relative:i})),[c,u,i,n,r]),null}function dt(t){h(!1)}function pt(t){let{basename:a="/",children:n=null,location:r,navigationType:i=g.Pop,navigator:l,static:o=!1,future:s}=t;q()&&h(!1);let m=a.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:l,static:o,future:J({v7_relativeSplatPath:!1},s)})),[m,s,l,o]);"string"==typeof r&&(r=S(r));let{pathname:u="/",search:d="",hash:p="",state:k=null,key:y="default"}=r,f=e.useMemo((()=>{let t=U(u,m);return null==t?null:{location:{pathname:t,search:d,hash:p,state:k,key:y},navigationType:i}}),[m,u,d,p,k,y,i]);return null==f?null:e.createElement(Z.Provider,{value:c},e.createElement(K.Provider,{children:n,value:f}))}function ht(t){let{children:e,location:a}=t;return nt(kt(e),a)}function kt(t,a){void 0===a&&(a=[]);let n=[];return e.Children.forEach(t,((t,r)=>{if(!e.isValidElement(t))return;let i=[...a,r];if(t.type===e.Fragment)return void n.push.apply(n,kt(t.props.children,i));t.type!==dt&&h(!1),t.props.index&&t.props.children&&h(!1);let l={id:t.props.id||i.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&&(l.children=kt(t.props.children,i)),n.push(l)})),n}e.startTransition,new Promise((()=>{})),e.Component;var yt=window.ReactDOM;new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]),new Map;const ft=e.startTransition;function Et(t){let{basename:a,children:n,future:r,window:i}=t,l=e.useRef();null==l.current&&(l.current=function(t){return void 0===t&&(t={}),function(t,e,a,n){void 0===n&&(n={});let{window:r=document.defaultView,v5Compat:i=!1}=n,l=r.history,o=g.Pop,s=null,m=c();function c(){return(l.state||{idx:null}).idx}function u(){o=g.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:o,location:S.location,delta:e})}function k(t){let e="null"!==r.location.origin?r.location.origin:r.location.href,a="string"==typeof t?t:E(t);return h(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==m&&(m=0,l.replaceState(d({},l.state,{idx:m}),""));let S={get action(){return o},get location(){return t(r,l)},listen(t){if(s)throw new Error("A history only accepts one active listener");return r.addEventListener(p,u),s=t,()=>{r.removeEventListener(p,u),s=null}},createHref(t){return e(r,t)},createURL:k,encodeLocation(t){let e=k(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=g.Push;let n=f(S.location,t,e);a&&a(n,t),m=c()+1;let u=y(n,m),d=S.createHref(n);try{l.pushState(u,"",d)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;r.location.assign(d)}i&&s&&s({action:o,location:S.location,delta:1})},replace:function(t,e){o=g.Replace;let n=f(S.location,t,e);a&&a(n,t),m=c();let r=y(n,m),u=S.createHref(n);l.replaceState(r,"",u),i&&s&&s({action:o,location:S.location,delta:0})},go(t){return l.go(t)}};return S}((function(t,e){let{pathname:a="/",search:n="",hash:r=""}=S(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),f("",{pathname:a,search:n,hash:r},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:E(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:i,v5Compat:!0}));let o=l.current,[s,m]=e.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=e.useCallback((t=>{c&&ft?ft((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>o.listen(u)),[o,u]),e.createElement(pt,{basename:a,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var St,xt;yt.flushSync,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"}(St||(St={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(xt||(xt={}));var Mt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l}=(0,a.useContext)(c),o=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"md:gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-16 gtmkit-mb-20"},(0,e.createElement)("div",{className:""},(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-w-full !gtmkit-px-8 "},(0,e.createElement)(n.TextControl,{label:(0,s.__)("Container ID","gtm-kit"),placeholder:(0,s.__)("Enter Container ID","gtm-kit"),value:t&&t.general.gtm_id,className:"gtmkit-text-center",onChange:t=>r("general","gtm_id",t)})),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/essential-settings",{replace:!0})},disabled:l||!t.general.gtm_id.includes("-")},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):""))),(0,e.createElement)("div",{className:"gtmkit-mt-8 gtmkit-border gtmkit-p-6 gtmkit-text-left gtmkit-text-color-grey gtmkit-text-center"},(0,e.createElement)("h2",{className:"gtmkit-font-bold gtmkit-text-base gtmkit-mb-4"},"Need help?"),(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,s.__)("Find your GTM container ID on","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-underline",href:"https://tagmanager.google.com/",target:"_blank",rel:"noreferrer"},"Google Tag Manager")),(0,e.createElement)("p",null,(0,s.__)("It should look something like this:","gtm-kit")," ","GTM-12ZM7SF4"))),(0,e.createElement)("div",{className:"gtmkit-mt-3 md:gtmkit-mt-10 gtmkit-text-color-grey gtmkit-text-base"},(0,e.createElement)("span",{className:"gtmkit-block"},(0,s.__)("No thanks. I know what I'm doing.","gtm-kit")),(0,e.createElement)("a",{className:"gtmkit-underline gtmkit-ml-4",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit"))))},Nt=()=>{const{useImportSettings:t,useIsPending:r,useInstallData:i}=(0,a.useContext)(c),[l,o]=(0,a.useState)(!0),m=Object.keys(i.import_data)[0],[g,u]=(0,a.useState)(m),d=[];return Object.keys(i.import_data).forEach((t=>{d.push({value:t,label:i.import_data[t].name})})),l?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto gtmkit-border gtmkit-py-8 gtmkit-my-8"},(0,e.createElement)("h2",{className:"gtmkit-text-lg gtmkit-text-color-heading gtmkit-font-bold"},(0,s.__)("Would you like to import plugin settings?","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-my-4 gtmkit-text-color-grey"},(0,s.__)("We have found the configuration of other plugins in the database.","gtm-kit")," ",(0,s.__)("Would you like to import your settings to GTM Kit?","gtm-kit")),(0,e.createElement)(n.RadioControl,{help:(0,s.__)("Select the plugin you want to import settings from.","gtm-kit"),selected:g,options:d,onChange:t=>u(t)}),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{t(g,i.import_data[g]),o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("Yes","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):""),(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("No","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):"")))):(0,e.createElement)(Mt,null)},vt=()=>{const{useInstallData:t}=(0,a.useContext)(c),{firstInstall:n}=t,{importAvailable:r}=t;return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("You've successfully installed GTM Kit!","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit"))),n&&r?(0,e.createElement)(Nt,null):(0,e.createElement)(Mt,null))},_t=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useInstallData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("Essential Settings","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("There are a lot of settings in GTM Kit and we recommend that you uses our recommended settings but you can also choose to use the default settings and go through the settings at your convenience.","gtm-kit"))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Page type","gtm-kit"),id:"page-type"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Include the page type i.e. page, product, category, cart, checkout etc in the datalayer?","gtm-kit"),checked:t&&t.general.datalayer_page_type,onChange:()=>{r("general","datalayer_page_type",!(t&&t.general.datalayer_page_type))}}))),o.woocommerce_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track WooCommerce","gtm-kit"),id:"track-wooCommerce"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from WooCommerce?","gtm-kit"),checked:t&&t.integrations.woocommerce_integration,onChange:()=>{r("integrations","woocommerce_integration",!(t&&t.integrations.woocommerce_integration))}}))):null,o.cf7_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Contact Form 7","gtm-kit"),id:"track-cf7"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track form submissions from Contact Form 7?","gtm-kit"),checked:t&&t.integrations.cf7_integration,onChange:()=>{r("integrations","cf7_integration",!(t&&t.integrations.cf7_integration))}}))):null,o.edd_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Easy Digital Downloads","gtm-kit"),id:"track-edd"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from Easy Digital Downloads?","gtm-kit"),checked:t&&t.integrations.edd_integration,onChange:()=>{r("integrations","edd_integration",!(t&&t.integrations.edd_integration))}}))):null,(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/share-anonymous-data",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},bt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useSiteData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Help improve GTM Kit","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey"},(0,s.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm"},(0,e.createElement)("tbody",null,(0,e.createElement)("tr",{className:""},(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Server type:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.web_server))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"PHP version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.php_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.wordpress_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress multisite:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.multisite?(0,s.__)("Yes","gtm-kit"):(0,s.__)("No","gtm-kit")))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current theme:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.current_theme))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current site language:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.locale))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Active plugins:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Plugin names of all active plugins"))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Anonymized GTM Kit settings:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Which GTM Kit settings are active"))))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-max !gtmkit-px-8 gtmkit-mx-auto "},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Share anonymous data","gtm-kit"),id:"share-anonymous-data"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("I agree to share anonymous data with the development team to help improve GTM Kit. ","gtm-kit"),checked:t&&t.general.analytics_active,onChange:()=>{r("general","analytics_active",!(t&&t.general.analytics_active))}}))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/getting-started",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},wt=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Your are ready to use GTM Kit!","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Your Google Tag Manager Container is now sending data to Google Tag Manager.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-12 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit")," "),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto gtmkit-mb-8"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Google Tag Manager templates","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4"},(0,s.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit")," ",(0,e.createElement)("a",{target:"_blank",className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",rel:"noreferrer"},(0,s.__)("Read the guide","gtm-kit"))),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - eCommerce","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Tutorials","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Getting started with GTM Kit","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("WooCommerce Integration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=advanced-container-implementation&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Advanced GTM container implementation","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=settings-actions-and-filters-for-developers&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Settings, actions and filters for developers","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.dashboardUrl}},(0,s.__)("Go to the dashboard","gtm-kit"))));const Tt=[{step:1,path:"/welcome",element:"Welcome",title:(0,s.__)("Welcome","gtm-kit")},{step:2,path:"/essential-settings",element:"EssentialSettings",title:(0,s.__)("Essential Settings","gtm-kit")},{step:3,path:"/share-anonymous-data",element:"ShareAnonymousData",title:(0,s.__)("Help improve GTM Kit","gtm-kit")},{step:4,path:"/getting-started",element:"GettingStarted",title:(0,s.__)("Getting Started","gtm-kit")}];var jt=({step:t,currentStep:a,totalSteps:n})=>{if(t===n)return;let r="gtmkit-h-0.5 gtmkit-w-full";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-color-border",(0,e.createElement)("div",{className:r})},Lt=({step:t,currentStep:a})=>t<a?(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"gtmkit-w-5 gtmkit-h-5 gtmkit-text-white"},(0,e.createElement)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})):t===a?(0,e.createElement)("span",{className:"gtmkit-h-2.5 gtmkit-w-2.5 gtmkit-rounded-full gtmkit-bg-color-primary"}):void 0,Dt=({step:t,currentStep:a,totalSteps:n})=>{if(0===t)return;let r="gtmkit-transition-opacity gtmkit-duration-500 gtmkit-absolute gtmkit-inset-0 gtmkit-border-2 gtmkit-flex gtmkit-items-center gtmkit-justify-center gtmkit-rounded-full gtmkit-opacity-100";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-white",r+=t>a?" gtmkit-border-color-border":" gtmkit-border-color-primary",(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"gtmkit-relative gtmkit-shrink-0 gtmkit-z-10 gtmkit-w-8 gtmkit-h-8 gtmkit-rounded-full"},(0,e.createElement)("span",{className:r},(0,e.createElement)(Lt,{step:t,currentStep:a,totalSteps:n}))),(0,e.createElement)(jt,{step:t,currentStep:a,totalSteps:n}))},Ct=()=>{const t=Tt.length-1+Tt[0].step;let a=((t,e)=>{const a=Object.keys(e);return t.filter((function(t){for(let n=0;n<a.length;n++)if(!t.hasOwnProperty(a[n])||t[a[n]]!==e[a[n]])return!1;return!0}))})(Tt,{path:tt().pathname});return a=a.length?a[0].step:0,0===a?(0,e.createElement)("div",{className:"gtmkit-my-16"}):(0,e.createElement)("div",{className:"gtmkit-mt-6 gtmkit-inset-0 gtmkit-mx-auto gtmkit-my-6 gtmkit-flex gtmkit-items-center gtmkit-max-w-xl","aria-hidden":"true"},Tt.map((function(n){return(0,e.createElement)(Dt,{key:n.step,step:n.step,currentStep:a,totalSteps:t})})))},It=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-text-center gtmkit-px-3"},(0,e.createElement)("h1",{className:"gtmkit-mt-3 md:gtmkit-mt-8 gtmkit-mb-4 gtmkit-w-[225px] gtmkit-inline-block"},(0,e.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNDY3LjEgMTU4Ni40IiBoZWlnaHQ9IjU0IiB2aWV3Qm94PSIwIDAgMTYwIDU0IiB3aWR0aD0iMTYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IGZpbGw9IiM4ODgiIGhlaWdodD0iNTQiIHJ4PSI0LjI2NSIgd2lkdGg9IjE2MCIvPjxwYXRoIGQ9Im04OC42NTkgNy4wMDJoLTQ5LjI2NmMtMi45MTUgMC01LjM3OC0uMTg0LTkuMjMgMi41OTZsLTE4Ljc0MyAxMi43NTJjLTQuNTQ5IDMuMjkyLTQuNTcxIDYuMDAxIDAgOS4zMDJsMTguNzQzIDEyLjc1MWMzLjY1MiAyLjY0NiA2LjI5OSAyLjU5NyA5LjIzIDIuNTk3aDE1LjY4NiAzMy41OGMyLjkzMS0uMDU3IDUuMzk0LTEuNzg0IDUuMzQtMy45MjN2LTMyLjIxYy0uMDEyLTIuMTM0LTIuNDA5LTMuODY1LTUuMzQtMy44NjV6IiBmaWxsPSIjMzk2OWJiIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgLTEgMTAxLjk5OTg2NyA1My45OTk1NDcpIi8+PGcgZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJtYXRyaXgoMS40NjUyMDIgMCAwIDEuNDY1MjAyIC00LjU4MjQzNiAtNy41NTMxMjYpIj48cGF0aCBkPSJtMTguMzE2IDIzLjA4Nmg0LjYzMnY2LjA1MmMtLjc1LjI0NS0xLjQ1OS40MTUtMi4xMjEuNTE0LS42NjMuMDk4LTEuMzQxLjE0OC0yLjAzMy4xNDgtMS43NjQgMC0zLjEwNi0uNTE3LTQuMDM1LTEuNTU0LS45MjktMS4wMzQtMS4zOTUtMi41MTktMS4zOTUtNC40NTcgMC0xLjg4Ni41MzgtMy4zNTYgMS42MTctNC40MSAxLjA3OC0xLjA1NCAyLjU3My0xLjU3OSA0LjQ4MS0xLjU3OSAxLjIgMCAyLjM1Ny4yMzkgMy40NjkuNzE4bC0uODIzIDEuOTc5Yy0uODUtLjQyNS0xLjczNy0uNjM3LTIuNjU3LS42MzctMS4wNzEgMC0xLjkzMi4zNTgtMi41NzIgMS4wNzctLjY0NS43MTgtLjk2OCAxLjY4NS0uOTY4IDIuODk5IDAgMS4yNjcuMjYgMi4yMzMuNzggMi45MDQuNTE2LjY2NyAxLjI3MS45OTkgMi4yNjIuOTk5LjUxNyAwIDEuMDQxLS4wNTIgMS41NzItLjE1OHYtMi40MzVoLTIuMjA5em0xMS45MTIgNi41NTVoLTIuNDc0di05LjYxNGgtMy4xNzN2LTIuMDZoOC44MTZ2Mi4wNmgtMy4xNjl6bTkuOTA4IDAtMi44MTEtOS4xNThoLS4wNzJjLjEwMyAxLjg2My4xNTQgMy4xMDUuMTU0IDMuNzI4djUuNDNoLTIuMjEzdi0xMS42NzRoMy4zNjhsMi43NjQgOC45MjdoLjA0OGwyLjkzNC04LjkyN2gzLjM2OXYxMS42NzRoLTIuMzA4di01LjUyNWMwLS4yNjEgMC0uNTYxLjAwOS0uOTAzLjAwOS0uMzQxLjA0OC0xLjI0Ni4xMTItMi43MTZoLS4wNzRsLTMuMDExIDkuMTQ0eiIvPjxwYXRoIGQ9Im04OC44ODMgMzEuODk4aC0zLjgxMWwtNC4xNDctNi42Ny0xLjQxNyAxLjAxOHY1LjY1MmgtMy4zNTd2LTE1LjgzaDMuMzU3djcuMjQybDEuMzE4LTEuODYxIDQuMjkzLTUuMzgxaDMuNzI0bC01LjUyMyA3LjAwNnptMS41ODktMTUuMjMzYzAtMS4wNzUuNi0xLjYxNCAxLjgtMS42MTQgMS4xOTkgMCAxLjc5OC41MzkgMS43OTggMS42MTQgMCAuNTEyLS4xNDguOTEtLjQ1IDEuMTk2LS4yOTcuMjg0LS43NDkuNDI5LTEuMzQ4LjQyOS0xLjIgMC0xLjgtLjU0My0xLjgtMS42MjV6bTMuNDQ5IDE1LjIzM2gtMy4zMDJ2LTEyLjEwNGgzLjMwMnptOC41NjMtMi40MTNjLjU3OCAwIDEuMjcxLS4xMjggMi4wNzctLjM4djIuNDU2Yy0uODIuMzctMS44MzEuNTUyLTMuMDMxLjU1Mi0xLjMyNCAwLTIuMjgtLjMzMy0yLjg4NS0xLjAwMS0uNjAyLS42NjctLjkwMi0xLjY2OC0uOTAyLTMuMDAzdi01LjgzNWgtMS41ODV2LTEuMzk5bDEuODIzLTEuMTAzLjk0OS0yLjU1N2gyLjExNXYyLjU3OWgzLjM4OHYyLjQ4aC0zLjM4OHY1LjgzNWMwIC40NjcuMTI5LjgxNS4zOTMgMS4wNDEuMjY0LjIyMi42MTQuMzM1IDEuMDQ2LjMzNXoiLz48L2c+PC9zdmc+",alt:(0,s.__)("GTM Kit","gtm-kit"),className:"gtmkit-w-full"}))),(0,e.createElement)(Ct,null)),Ot=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("footer",{className:"gtm-kit-settings-footer gtmkit-my-8 gtmkit-text-color-grey"},(0,e.createElement)("p",{className:"gtmkit-mx-auto gtmkit-max-w-max"},(0,e.createElement)("a",{className:"gtmkit-underline",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit")))));const At=()=>{const{useSettings:t}=(0,a.useContext)(c);return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,null),(0,e.createElement)("main",{className:"gtmkit-max-w-3xl gtmkit-bg-white gtmkit-border-1 gtmkit-border-color-border gtmkit-rounded-md gtmkit-mx-auto gtmkit-py-12 gtmkit-px-16 gtmkit-text-base"},(0,e.createElement)(ht,null,(0,e.createElement)(dt,{exact:!0,path:"/welcome",element:(0,e.createElement)(vt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/essential-settings",element:(0,e.createElement)(_t,null)}),(0,e.createElement)(dt,{exact:!0,path:"/share-anonymous-data",element:(0,e.createElement)(bt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/getting-started",element:(0,e.createElement)(wt,null)}),(0,e.createElement)(dt,{path:"/",element:(0,e.createElement)(ut,{replace:!0,to:"/welcome"})}))),(0,e.createElement)(Ot,null)):(0,e.createElement)(n.Spinner,{className:"gtm-kit-settings-page-loader"})},Ut=()=>(0,e.createElement)(Et,{basename:"/"},(0,e.createElement)(u,null,(0,e.createElement)(At,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Ut,null),document.getElementById(window.gtmkitSettings.rootId))}))}();
     1(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.React,a=window.wp.element,n=window.wp.components,r=window.lodash,i=window.wp.apiFetch;var l=t.n(i);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const o=async(t,e,a=null,n=!1)=>{let r={};try{r=await l()({path:t,method:e,...a&&{data:a}})}catch(a){return console.log(`${e} ${t} Errors:`,a),{[`gtm_kit_api_${e}_${t}_errors`]:!0}}return!0===n?r:!0===r.success?r.data:options},s=window.wp.i18n,m=(t,e)=>{const a={...t};switch(e.type){case"FETCH_SETTINGS":a.fetchedSettings={...e.payload.fetchedSettings,integrations:e.payload.fetchedSettings.integrations||{}},a.stateSettings=e.payload.stateSettings,a.siteData=e.payload.siteData,a.installData=e.payload.installData,a.isPending=!1,a.canSave=!1,e.payload.fetchedSettings.gtm_kit_api_fetch_settings_errors&&(a.notice=(0,s.__)("An error occurred.","gtm-kit"),a.hasError=!0);break;case"UPDATE_SETTINGS_BEFORE":a.isPending=e.payload.isPending;break;case"UPDATE_SETTINGS":a.fetchedSettings=e.payload.fetchedSettings,a.stateSettings=e.payload.stateSettings,a.isPending=!1,a.canSave=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors,a.notice=e.payload.fetchedSettings.gtm_kit_api_update_settings_errors?(0,s.__)("An error occurred.","gtm-kit"):(0,s.__)("Saved Successfully.","gtm-kit"),a.hasError=!!e.payload.fetchedSettings.gtm_kit_api_update_settings_errors;break;case"UPDATE_STATE":a.fetchedSettings=e.payload.fetchedSettings||a.fetchedSettings,a.stateSettings=e.payload.stateSettings||a.stateSettings,a.isPending=e.payload.isPending||a.isPending,a.notice=e.payload.notice||a.notice,a.hasError=e.payload.hasError||a.hasError,a.canSave=e.payload.canSave||a.canSave,a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData,a.supportTicket=e.payload.supportTicket||a.supportTicket;break;case"SEND_SUPPORT_DATA_BEFORE":a.isSendingSystemData=e.payload.isSendingSystemData||a.isSendingSystemData;break;case"SEND_SUPPORT_DATA":a.isSendingSystemData=!1,a.isSystemDataSent=e.payload.isSystemDataSent||a.isSystemDataSent,a.systemDataMessage=e.payload.systemDataMessage||a.systemDataMessage}return a},c=(0,a.createContext)(),g=t=>{const[n,i]=(0,a.useReducer)(m,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:!1,canSave:!1,supportTicket:"",isSystemDataSent:!1,systemDataMessage:""}),l=async()=>{const[t,e]=await Promise.all([o("gtmkit/v1/get-options","GET"),o("gtmkit/v1/get-site-data","GET")]),a="wizard"===window.gtmkitSettings.currentPage?await o("gtmkit/v1/get-install-data","GET"):{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:a}})},s=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{l()}),[]);const g={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(e=n.stateSettings,o("gtmkit/v1/set-options","POST",e));var e;i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:l,useUpdateState:s,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let l;i[t][e]=a,l=!(0,r.isEqual)(i,n.fetchedSettings),s({stateSettings:i,canSave:l})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const l={};l.general={...a.general,...e.general},"integrations"in e&&(l.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(l,n.fetchedSettings),s({stateSettings:l,canSave:i})},useUpdateSupportTicket:async t=>{s({supportTicket:t})},useSendSystemData:async()=>{i({type:"SEND_SUPPORT_DATA_BEFORE",payload:{isSendingSystemData:!0}});const t=await(e=n.supportTicket,o("gtmkit/v1/send-support-data","POST",e,!0));var e;i({type:"SEND_SUPPORT_DATA",payload:{isSendingSystemData:!1,isSystemDataSent:t.success,systemDataMessage:t.data}})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData,useIsSending:n.isSendingSystemData,useSupportTicket:n.supportTicket,useIsSystemDataSent:n.isSystemDataSent,useSystemDataMessage:n.systemDataMessage};return(0,e.createElement)(c.Provider,{value:g},t.children)};function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},u.apply(this,arguments)}var d;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(d||(d={}));const p="popstate";function h(t,e){if(!1===t||null==t)throw new Error(e)}function k(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function y(t,e){return{usr:t.state,key:t.key,idx:e}}function f(t,e,a,n){return void 0===a&&(a=null),u({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?S(e):e,{state:a,key:e&&e.key||n||Math.random().toString(36).substr(2,8)})}function E(t){let{pathname:e="/",search:a="",hash:n=""}=t;return a&&"?"!==a&&(e+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function S(t){let e={};if(t){let a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}var x;function M(t,e,a){void 0===a&&(a="/");let n=U(("string"==typeof e?S(e):e).pathname||"/",a);if(null==n)return null;let r=N(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,a)=>t===e[a]))?t[t.length-1]-e[e.length-1]:0}(t.routesMeta.map((t=>t.childrenIndex)),e.routesMeta.map((t=>t.childrenIndex)))))}(r);let i=null;for(let t=0;null==i&&t<r.length;++t)i=I(r[t],A(n));return i}function N(t,e,a,n){void 0===e&&(e=[]),void 0===a&&(a=[]),void 0===n&&(n="");let r=(t,r,i)=>{let l={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:r,route:t};l.relativePath.startsWith("/")&&(h(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),l.relativePath=l.relativePath.slice(n.length));let o=G([n,l.relativePath]),s=a.concat(l);t.children&&t.children.length>0&&(h(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+o+'".'),N(t.children,e,s,o)),(null!=t.path||t.index)&&e.push({path:o,score:C(o,t.index),routesMeta:s})};return t.forEach(((t,e)=>{var a;if(""!==t.path&&null!=(a=t.path)&&a.includes("?"))for(let a of v(t.path))r(t,e,a);else r(t,e)})),e}function v(t){let e=t.split("/");if(0===e.length)return[];let[a,...n]=e,r=a.endsWith("?"),i=a.replace(/\?$/,"");if(0===n.length)return r?[i,""]:[i];let l=v(n.join("/")),o=[];return o.push(...l.map((t=>""===t?i:[i,t].join("/")))),r&&o.push(...l),o.map((e=>t.startsWith("/")&&""===e?"/":e))}!function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const _=/^:\w+$/,b=3,w=2,T=1,j=10,L=-2,D=t=>"*"===t;function C(t,e){let a=t.split("/"),n=a.length;return a.some(D)&&(n+=L),e&&(n+=w),a.filter((t=>!D(t))).reduce(((t,e)=>t+(_.test(e)?b:""===e?T:j)),n)}function I(t,e){let{routesMeta:a}=t,n={},r="/",i=[];for(let t=0;t<a.length;++t){let l=a[t],o=t===a.length-1,s="/"===r?e:e.slice(r.length)||"/",m=O({path:l.relativePath,caseSensitive:l.caseSensitive,end:o},s);if(!m)return null;Object.assign(n,m.params);let c=l.route;i.push({params:n,pathname:G([r,m.pathname]),pathnameBase:B(G([r,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(r=G([r,m.pathnameBase]))}return i}function O(t,e){"string"==typeof t&&(t={path:t,caseSensitive:!1,end:!0});let[a,n]=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!0),k("*"===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 n=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((t,e,a)=>(n.push({paramName:e,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return t.endsWith("*")?(n.push({paramName:"*"}),r+="*"===t||"/*"===t?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?r+="\\/*$":""!==t&&"/"!==t&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}(t.path,t.caseSensitive,t.end),r=e.match(a);if(!r)return null;let i=r[0],l=i.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:n.reduce(((t,e,a)=>{let{paramName:n,isOptional:r}=e;if("*"===n){let t=o[a]||"";l=i.slice(0,i.length-t.length).replace(/(.)\/+$/,"$1")}const s=o[a];return t[n]=r&&!s?void 0:function(t,e){try{return decodeURIComponent(t)}catch(a){return k(!1,'The value for the URL param "'+e+'" will not be decoded because the string "'+t+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+a+")."),t}}(s||"",n),t}),{}),pathname:i,pathnameBase:l,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return k(!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 U(t,e){if("/"===e)return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let a=e.endsWith("/")?e.length-1:e.length,n=t.charAt(a);return n&&"/"!==n?null:t.slice(a)||"/"}function z(t,e,a,n){return"Cannot include a '"+t+"' character in a manually specified `to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function P(t,e){let a=function(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}(t);return e?a.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase)):a.map((t=>t.pathnameBase))}function R(t,e,a,n){let r;void 0===n&&(n=!1),"string"==typeof t?r=S(t):(r=u({},t),h(!r.pathname||!r.pathname.includes("?"),z("?","pathname","search",r)),h(!r.pathname||!r.pathname.includes("#"),z("#","pathname","hash",r)),h(!r.search||!r.search.includes("#"),z("#","search","hash",r)));let i,l=""===t||""===r.pathname,o=l?"/":r.pathname;if(null==o)i=a;else if(n){let t=0===e.length?[]:e[e.length-1].replace(/^\//,"").split("/");if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t.pop();r.pathname=e.join("/")}i="/"+t.join("/")}else{let t=e.length-1;if(o.startsWith("..")){let e=o.split("/");for(;".."===e[0];)e.shift(),t-=1;r.pathname=e.join("/")}i=t>=0?e[t]:"/"}let s=function(t,e){void 0===e&&(e="/");let{pathname:a,search:n="",hash:r=""}="string"==typeof t?S(t):t,i=a?a.startsWith("/")?a:function(t,e){let a=e.replace(/\/+$/,"").split("/");return t.split("/").forEach((t=>{".."===t?a.length>1&&a.pop():"."!==t&&a.push(t)})),a.length>1?a.join("/"):"/"}(a,e):e;return{pathname:i,search:W(n),hash:Y(r)}}(r,i),m=o&&"/"!==o&&o.endsWith("/"),c=(l||"."===o)&&a.endsWith("/");return s.pathname.endsWith("/")||!m&&!c||(s.pathname+="/"),s}const G=t=>t.join("/").replace(/\/\/+/g,"/"),B=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),W=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",Y=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const F=["post","put","patch","delete"],Q=(new Set(F),["get",...F]);function J(){return J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},J.apply(this,arguments)}new Set(Q),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const H=e.createContext(null),$=e.createContext(null),Z=e.createContext(null),K=e.createContext(null),V=e.createContext({outlet:null,matches:[],isDataRoute:!1}),X=e.createContext(null);function q(){return null!=e.useContext(K)}function tt(){return q()||h(!1),e.useContext(K).location}function et(t){e.useContext(Z).static||e.useLayoutEffect(t)}function at(){let{isDataRoute:t}=e.useContext(V);return t?function(){let{router:t}=function(t){let a=e.useContext(H);return a||h(!1),a}(st.UseNavigateStable),a=ct(mt.UseNavigateStable),n=e.useRef(!1);return et((()=>{n.current=!0})),e.useCallback((function(e,r){void 0===r&&(r={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,J({fromRouteId:a},r)))}),[t,a])}():function(){q()||h(!1);let t=e.useContext(H),{basename:a,future:n,navigator:r}=e.useContext(Z),{matches:i}=e.useContext(V),{pathname:l}=tt(),o=JSON.stringify(P(i,n.v7_relativeSplatPath)),s=e.useRef(!1);return et((()=>{s.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!s.current)return;if("number"==typeof e)return void r.go(e);let i=R(e,JSON.parse(o),l,"path"===n.relative);null==t&&"/"!==a&&(i.pathname="/"===i.pathname?a:G([a,i.pathname])),(n.replace?r.replace:r.push)(i,n.state,n)}),[a,r,o,l,t])}()}function nt(t,a,n,r){q()||h(!1);let{navigator:i}=e.useContext(Z),{matches:l}=e.useContext(V),o=l[l.length-1],s=o?o.params:{},m=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let c,g=tt();if(a){var u;let t="string"==typeof a?S(a):a;"/"===m||(null==(u=t.pathname)?void 0:u.startsWith(m))||h(!1),c=t}else c=g;let p=c.pathname||"/",k=M(t,{pathname:"/"===m?p:p.slice(m.length)||"/"}),y=function(t,a,n,r){var i;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==t){var l;if(null==(l=n)||!l.errors)return null;t=n.matches}let o=t,s=null==(i=n)?void 0:i.errors;if(null!=s){let t=o.findIndex((t=>t.route.id&&(null==s?void 0:s[t.route.id])));t>=0||h(!1),o=o.slice(0,Math.min(o.length,t+1))}let m=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let t=0;t<o.length;t++){let e=o[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(c=t),e.route.loader&&e.route.id&&void 0===n.loaderData[e.route.id]&&(!n.errors||void 0===n.errors[e.route.id])){m=!0,o=c>=0?o.slice(0,c+1):[o[0]];break}}return o.reduceRight(((t,r,i)=>{let l,g=!1,u=null,d=null;var p;n&&(l=s&&r.route.id?s[r.route.id]:void 0,u=r.route.errorElement||it,m&&(c<0&&0===i?(gt[p="route-fallback"]||(gt[p]=!0),g=!0,d=null):c===i&&(g=!0,d=r.route.hydrateFallbackElement||null)));let h=a.concat(o.slice(0,i+1)),k=()=>{let a;return a=l?u:g?d:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(ot,{match:r,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:a})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===i)?e.createElement(lt,{location:n.location,revalidation:n.revalidation,component:u,error:l,children:k(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):k()}),null)}(k&&k.map((t=>Object.assign({},t,{params:Object.assign({},s,t.params),pathname:G([m,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?m:G([m,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),l,n,r);return a&&y?e.createElement(K.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:d.Pop}},y):y}function rt(){let t=function(){var t;let a=e.useContext(X),n=function(t){let a=e.useContext($);return a||h(!1),a}(mt.UseRouteError),r=ct(mt.UseRouteError);return void 0!==a?a:null==(t=n.errors)?void 0:t[r]}(),a=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(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 e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},a),n?e.createElement("pre",{style:r},n):null,null)}const it=e.createElement(rt,null);class lt extends e.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?e.createElement(V.Provider,{value:this.props.routeContext},e.createElement(X.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ot(t){let{routeContext:a,match:n,children:r}=t,i=e.useContext(H);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(V.Provider,{value:a},r)}var st=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(st||{}),mt=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}(mt||{});function ct(t){let a=function(t){let a=e.useContext(V);return a||h(!1),a}(),n=a.matches[a.matches.length-1];return n.route.id||h(!1),n.route.id}const gt={};function ut(t){let{to:a,replace:n,state:r,relative:i}=t;q()||h(!1);let{future:l,static:o}=e.useContext(Z),{matches:s}=e.useContext(V),{pathname:m}=tt(),c=at(),g=R(a,P(s,l.v7_relativeSplatPath),m,"path"===i),u=JSON.stringify(g);return e.useEffect((()=>c(JSON.parse(u),{replace:n,state:r,relative:i})),[c,u,i,n,r]),null}function dt(t){h(!1)}function pt(t){let{basename:a="/",children:n=null,location:r,navigationType:i=d.Pop,navigator:l,static:o=!1,future:s}=t;q()&&h(!1);let m=a.replace(/^\/*/,"/"),c=e.useMemo((()=>({basename:m,navigator:l,static:o,future:J({v7_relativeSplatPath:!1},s)})),[m,s,l,o]);"string"==typeof r&&(r=S(r));let{pathname:g="/",search:u="",hash:p="",state:k=null,key:y="default"}=r,f=e.useMemo((()=>{let t=U(g,m);return null==t?null:{location:{pathname:t,search:u,hash:p,state:k,key:y},navigationType:i}}),[m,g,u,p,k,y,i]);return null==f?null:e.createElement(Z.Provider,{value:c},e.createElement(K.Provider,{children:n,value:f}))}function ht(t){let{children:e,location:a}=t;return nt(kt(e),a)}function kt(t,a){void 0===a&&(a=[]);let n=[];return e.Children.forEach(t,((t,r)=>{if(!e.isValidElement(t))return;let i=[...a,r];if(t.type===e.Fragment)return void n.push.apply(n,kt(t.props.children,i));t.type!==dt&&h(!1),t.props.index&&t.props.children&&h(!1);let l={id:t.props.id||i.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&&(l.children=kt(t.props.children,i)),n.push(l)})),n}e.startTransition,new Promise((()=>{})),e.Component;const yt=window.ReactDOM;new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]),new Map;const ft=e.startTransition;function Et(t){let{basename:a,children:n,future:r,window:i}=t,l=e.useRef();null==l.current&&(l.current=function(t){return void 0===t&&(t={}),function(t,e,a,n){void 0===n&&(n={});let{window:r=document.defaultView,v5Compat:i=!1}=n,l=r.history,o=d.Pop,s=null,m=c();function c(){return(l.state||{idx:null}).idx}function g(){o=d.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:o,location:S.location,delta:e})}function k(t){let e="null"!==r.location.origin?r.location.origin:r.location.href,a="string"==typeof t?t:E(t);return h(e,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,e)}null==m&&(m=0,l.replaceState(u({},l.state,{idx:m}),""));let S={get action(){return o},get location(){return t(r,l)},listen(t){if(s)throw new Error("A history only accepts one active listener");return r.addEventListener(p,g),s=t,()=>{r.removeEventListener(p,g),s=null}},createHref:t=>e(r,t),createURL:k,encodeLocation(t){let e=k(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){o=d.Push;let n=f(S.location,t,e);a&&a(n,t),m=c()+1;let g=y(n,m),u=S.createHref(n);try{l.pushState(g,"",u)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;r.location.assign(u)}i&&s&&s({action:o,location:S.location,delta:1})},replace:function(t,e){o=d.Replace;let n=f(S.location,t,e);a&&a(n,t),m=c();let r=y(n,m),g=S.createHref(n);l.replaceState(r,"",g),i&&s&&s({action:o,location:S.location,delta:0})},go:t=>l.go(t)};return S}((function(t,e){let{pathname:a="/",search:n="",hash:r=""}=S(t.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),f("",{pathname:a,search:n,hash:r},e.state&&e.state.usr||null,e.state&&e.state.key||"default")}),(function(t,e){let a=t.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let e=t.location.href,a=e.indexOf("#");n=-1===a?e:e.slice(0,a)}return n+"#"+("string"==typeof e?e:E(e))}),(function(t,e){k("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),t)}({window:i,v5Compat:!0}));let o=l.current,[s,m]=e.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},g=e.useCallback((t=>{c&&ft?ft((()=>m(t))):m(t)}),[m,c]);return e.useLayoutEffect((()=>o.listen(g)),[o,g]),e.createElement(pt,{basename:a,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var St,xt;yt.flushSync,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"}(St||(St={})),function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(xt||(xt={}));const Mt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l}=(0,a.useContext)(c),o=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"md:gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-16 gtmkit-mb-20"},(0,e.createElement)("div",{className:""},(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-w-full !gtmkit-px-8 "},(0,e.createElement)(n.TextControl,{label:(0,s.__)("Container ID","gtm-kit"),placeholder:(0,s.__)("Enter Container ID","gtm-kit"),value:t&&t.general.gtm_id,className:"gtmkit-text-center",onChange:t=>r("general","gtm_id",t)})),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),o("/essential-settings",{replace:!0})},disabled:l||!t.general.gtm_id.includes("-")},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):""))),(0,e.createElement)("div",{className:"gtmkit-mt-8 gtmkit-border gtmkit-p-6 gtmkit-text-left gtmkit-text-color-grey gtmkit-text-center"},(0,e.createElement)("h2",{className:"gtmkit-font-bold gtmkit-text-base gtmkit-mb-4"},"Need help?"),(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,s.__)("Find your GTM container ID on","gtm-kit"),(0,e.createElement)("a",{className:"gtmkit-ml-2 gtmkit-text-color-primary gtmkit-underline",href:"https://tagmanager.google.com/",target:"_blank",rel:"noreferrer"},"Google Tag Manager")),(0,e.createElement)("p",null,(0,s.__)("It should look something like this:","gtm-kit")," ","GTM-12ZM7SF4"))),(0,e.createElement)("div",{className:"gtmkit-mt-3 md:gtmkit-mt-10 gtmkit-text-color-grey gtmkit-text-base"},(0,e.createElement)("span",{className:"gtmkit-block"},(0,s.__)("No thanks. I know what I'm doing.","gtm-kit")),(0,e.createElement)("a",{className:"gtmkit-underline gtmkit-ml-4",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit"))))},Nt=()=>{const{useImportSettings:t,useIsPending:r,useInstallData:i}=(0,a.useContext)(c),[l,o]=(0,a.useState)(!0),m=Object.keys(i.import_data)[0],[g,u]=(0,a.useState)(m),d=[];return Object.keys(i.import_data).forEach((t=>{d.push({value:t,label:i.import_data[t].name})})),l?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto gtmkit-border gtmkit-py-8 gtmkit-my-8"},(0,e.createElement)("h2",{className:"gtmkit-text-lg gtmkit-text-color-heading gtmkit-font-bold"},(0,s.__)("Would you like to import plugin settings?","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-my-4 gtmkit-text-color-grey"},(0,s.__)("We have found the configuration of other plugins in the database.","gtm-kit")," ",(0,s.__)("Would you like to import your settings to GTM Kit?","gtm-kit")),(0,e.createElement)(n.RadioControl,{help:(0,s.__)("Select the plugin you want to import settings from.","gtm-kit"),selected:g,options:d,onChange:t=>u(t)}),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{t(g,i.import_data[g]),o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("Yes","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):""),(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base",onClick:()=>{o(!1)}},(0,e.createElement)("span",{className:"gtmkit-text-lg gtmkit-font-bold"},(0,s.__)("No","gtm-kit")),r?(0,e.createElement)(n.Spinner,null):"")))):(0,e.createElement)(Mt,null)},vt=()=>{const{useInstallData:t}=(0,a.useContext)(c),{firstInstall:n}=t,{importAvailable:r}=t;return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("You've successfully installed GTM Kit!","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("To start collecting data with Google Tag manager you must register the Container ID of your Google Tag Manager container.","gtm-kit"))),n&&r?(0,e.createElement)(Nt,null):(0,e.createElement)(Mt,null))},_t=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useInstallData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)("div",{className:"gtmkit-text-center"},(0,e.createElement)("h1",{className:"gtmkit-text-4xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading"},(0,s.__)("Essential Settings","gtm-kit")),(0,e.createElement)("div",{className:"gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("There are a lot of settings in GTM Kit and we recommend that you uses our recommended settings but you can also choose to use the default settings and go through the settings at your convenience.","gtm-kit"))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Page type","gtm-kit"),id:"page-type"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Include the page type i.e. page, product, category, cart, checkout etc in the datalayer?","gtm-kit"),checked:t&&t.general.datalayer_page_type,onChange:()=>{r("general","datalayer_page_type",!(t&&t.general.datalayer_page_type))}}))),o.woocommerce_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track WooCommerce","gtm-kit"),id:"track-wooCommerce"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from WooCommerce?","gtm-kit"),checked:t&&t.integrations.woocommerce_integration,onChange:()=>{r("integrations","woocommerce_integration",!(t&&t.integrations.woocommerce_integration))}}))):null,o.cf7_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-lg gtmkit-mx-auto"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Contact Form 7","gtm-kit"),id:"track-cf7"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track form submissions from Contact Form 7?","gtm-kit"),checked:t&&t.integrations.cf7_integration,onChange:()=>{r("integrations","cf7_integration",!(t&&t.integrations.cf7_integration))}}))):null,o.edd_integration?(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap"},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Track Easy Digital Downloads","gtm-kit"),id:"track-edd"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("Would you like to track e-commerce data from Easy Digital Downloads?","gtm-kit"),checked:t&&t.integrations.edd_integration,onChange:()=>{r("integrations","edd_integration",!(t&&t.integrations.edd_integration))}}))):null,(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/share-anonymous-data",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},bt=()=>{const{useSettings:t,useUpdateStateSettings:r,useUpdateSettings:i,useIsPending:l,useSiteData:o}=(0,a.useContext)(c),m=at();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Help improve GTM Kit","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-4 gtmkit-text-color-grey"},(0,s.__)("GTM Kit is used together with a wide variety of server configurations and plugins. It is very helpful for us to know what some of these configurations are so we can test the most common configurations.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-sm gtmkit-mb-8 gtmkit-text-color-grey"},(0,s.__)("You can help by sharing anonymous data with us. Below is a detailed view of all data GTM Kit will collect if granted permission:","gtm-kit")),(0,e.createElement)("table",{className:"gtmkit-border-2 gtmkit-table-fixed gtmkit-w-full gtmkit-text-sm"},(0,e.createElement)("tbody",null,(0,e.createElement)("tr",{className:""},(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Server type:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.web_server))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"PHP version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.php_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress version number:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.wordpress_version))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"WordPress multisite:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.multisite?(0,s.__)("Yes","gtm-kit"):(0,s.__)("No","gtm-kit")))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current theme:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.current_theme))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Current site language:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("code",{className:"gtmkit-text-sm"},o.locale))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Active plugins:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Plugin names of all active plugins"))),(0,e.createElement)("tr",null,(0,e.createElement)("td",{className:"gtmkit-font-bold gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("strong",null,"Anonymized GTM Kit settings:")),(0,e.createElement)("td",{className:"gtmkit-px-2 gtmkit-py-1"},(0,e.createElement)("em",null,"Which GTM Kit settings are active"))))),(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-max-w-max !gtmkit-px-8 gtmkit-mx-auto "},(0,e.createElement)(n.BaseControl,{label:(0,s.__)("Share anonymous data","gtm-kit"),id:"share-anonymous-data"},(0,e.createElement)(n.ToggleControl,{label:(0,s.__)("I agree to share anonymous data with the development team to help improve GTM Kit. ","gtm-kit"),checked:t&&t.general.analytics_active,onChange:()=>{r("general","analytics_active",!(t&&t.general.analytics_active))}}))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{i(),m("/getting-started",{replace:!0})},disabled:l},(0,s.__)("Save and continue","gtm-kit"),l?(0,e.createElement)(n.Spinner,null):"")))},wt=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h1",{className:"gtmkit-text-3xl gtmkit-font-medium gtmkit-mb-8 gtmkit-text-color-heading gtmkit-text-center"},(0,s.__)("Your are ready to use GTM Kit!","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-4 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Your Google Tag Manager Container is now sending data to Google Tag Manager.","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-mb-12 gtmkit-text-color-grey gtmkit-text-center"},(0,s.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit")," "),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto gtmkit-mb-8"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Google Tag Manager templates","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-text-base gtmkit-text-color-grey gtmkit-m-4"},(0,s.__)("Please read the guide on how to use the import files and configure GTM.","gtm-kit")," ",(0,e.createElement)("a",{target:"_blank",className:"gtmkit-text-color-primary gtmkit-whitespace-nowrap",href:"https://gtmkit.com/guides/how-to-setup-google-analytics-ga4-in-google-tag-manager/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",rel:"noreferrer"},(0,s.__)("Read the guide","gtm-kit"))),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-Google-Analytics-4.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - Basic Configuration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://templates.gtmkit.com/gtm/GTM-GA4-eCommerce.json",target:"_blank",rel:"noreferrer"},(0,s.__)("Google Analytics 4 - eCommerce","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-border-2 gtmkit-max-w-md gtmkit-mx-auto"},(0,e.createElement)("h3",{className:"gtmkit-p-3 gtmkit-font-bold gtmkit-text-xl gtmkit-border-b-2"},(0,s.__)("Tutorials","gtm-kit")),(0,e.createElement)("ul",{className:"gtmkit-text-color-primary gtmkit-p-3"},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/getting-started-with-gtm-kit/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=getting-started&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Getting started with GTM Kit","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/woocommerce/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=woocommerce&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("WooCommerce Integration","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/advanced-gtm-container-implementation/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=advanced-container-implementation&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Advanced GTM container implementation","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/documentation/settings-actions-and-filters-for-developers/#utm_source=gtmkit-plugin&utm_medium=software&utm_term=settings-actions-and-filters-for-developers&utm_content=help-tutorials",target:"_blank",rel:"noreferrer"},(0,s.__)("Settings, actions and filters for developers","gtm-kit"))))),(0,e.createElement)("div",{className:"gtmkit-flex gtmkit-mt-12"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-mx-auto gtmkit-rounded-md !gtmkit-py-6 !gtmkit-px-8 gtmkit-text-base disabled:!gtmkit-bg-color-button-disabled disabled:!gtmkit-text-color-grey",onClick:()=>{window.location.href=window.gtmkitSettings.dashboardUrl}},(0,s.__)("Go to the dashboard","gtm-kit")))),Tt=[{step:1,path:"/welcome",element:"Welcome",title:(0,s.__)("Welcome","gtm-kit")},{step:2,path:"/essential-settings",element:"EssentialSettings",title:(0,s.__)("Essential Settings","gtm-kit")},{step:3,path:"/share-anonymous-data",element:"ShareAnonymousData",title:(0,s.__)("Help improve GTM Kit","gtm-kit")},{step:4,path:"/getting-started",element:"GettingStarted",title:(0,s.__)("Getting Started","gtm-kit")}],jt=({step:t,currentStep:a,totalSteps:n})=>{if(t===n)return;let r="gtmkit-h-0.5 gtmkit-w-full";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-color-border",(0,e.createElement)("div",{className:r})},Lt=({step:t,currentStep:a})=>t<a?(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"gtmkit-w-5 gtmkit-h-5 gtmkit-text-white"},(0,e.createElement)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})):t===a?(0,e.createElement)("span",{className:"gtmkit-h-2.5 gtmkit-w-2.5 gtmkit-rounded-full gtmkit-bg-color-primary"}):void 0,Dt=({step:t,currentStep:a,totalSteps:n})=>{if(0===t)return;let r="gtmkit-transition-opacity gtmkit-duration-500 gtmkit-absolute gtmkit-inset-0 gtmkit-border-2 gtmkit-flex gtmkit-items-center gtmkit-justify-center gtmkit-rounded-full gtmkit-opacity-100";return r+=t<a?" gtmkit-bg-color-primary":" gtmkit-bg-white",r+=t>a?" gtmkit-border-color-border":" gtmkit-border-color-primary",(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"gtmkit-relative gtmkit-shrink-0 gtmkit-z-10 gtmkit-w-8 gtmkit-h-8 gtmkit-rounded-full"},(0,e.createElement)("span",{className:r},(0,e.createElement)(Lt,{step:t,currentStep:a,totalSteps:n}))),(0,e.createElement)(jt,{step:t,currentStep:a,totalSteps:n}))},Ct=()=>{const t=Tt.length-1+Tt[0].step;let a=((t,e)=>{const a=Object.keys(e);return t.filter((function(t){for(let n=0;n<a.length;n++)if(!t.hasOwnProperty(a[n])||t[a[n]]!==e[a[n]])return!1;return!0}))})(Tt,{path:tt().pathname});return a=a.length?a[0].step:0,0===a?(0,e.createElement)("div",{className:"gtmkit-my-16"}):(0,e.createElement)("div",{className:"gtmkit-mt-6 gtmkit-inset-0 gtmkit-mx-auto gtmkit-my-6 gtmkit-flex gtmkit-items-center gtmkit-max-w-xl","aria-hidden":"true"},Tt.map((function(n){return(0,e.createElement)(Dt,{key:n.step,step:n.step,currentStep:a,totalSteps:t})})))},It=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("header",{className:"gtmkit-text-center gtmkit-px-3"},(0,e.createElement)("h1",{className:"gtmkit-mt-3 md:gtmkit-mt-8 gtmkit-mb-4 gtmkit-w-[225px] gtmkit-inline-block"},(0,e.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyNDY3LjEgMTU4Ni40IiBoZWlnaHQ9IjU0IiB2aWV3Qm94PSIwIDAgMTYwIDU0IiB3aWR0aD0iMTYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IGZpbGw9IiM4ODgiIGhlaWdodD0iNTQiIHJ4PSI0LjI2NSIgd2lkdGg9IjE2MCIvPjxwYXRoIGQ9Im04OC42NTkgNy4wMDJoLTQ5LjI2NmMtMi45MTUgMC01LjM3OC0uMTg0LTkuMjMgMi41OTZsLTE4Ljc0MyAxMi43NTJjLTQuNTQ5IDMuMjkyLTQuNTcxIDYuMDAxIDAgOS4zMDJsMTguNzQzIDEyLjc1MWMzLjY1MiAyLjY0NiA2LjI5OSAyLjU5NyA5LjIzIDIuNTk3aDE1LjY4NiAzMy41OGMyLjkzMS0uMDU3IDUuMzk0LTEuNzg0IDUuMzQtMy45MjN2LTMyLjIxYy0uMDEyLTIuMTM0LTIuNDA5LTMuODY1LTUuMzQtMy44NjV6IiBmaWxsPSIjMzk2OWJiIiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgLTEgMTAxLjk5OTg2NyA1My45OTk1NDcpIi8+PGcgZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJtYXRyaXgoMS40NjUyMDIgMCAwIDEuNDY1MjAyIC00LjU4MjQzNiAtNy41NTMxMjYpIj48cGF0aCBkPSJtMTguMzE2IDIzLjA4Nmg0LjYzMnY2LjA1MmMtLjc1LjI0NS0xLjQ1OS40MTUtMi4xMjEuNTE0LS42NjMuMDk4LTEuMzQxLjE0OC0yLjAzMy4xNDgtMS43NjQgMC0zLjEwNi0uNTE3LTQuMDM1LTEuNTU0LS45MjktMS4wMzQtMS4zOTUtMi41MTktMS4zOTUtNC40NTcgMC0xLjg4Ni41MzgtMy4zNTYgMS42MTctNC40MSAxLjA3OC0xLjA1NCAyLjU3My0xLjU3OSA0LjQ4MS0xLjU3OSAxLjIgMCAyLjM1Ny4yMzkgMy40NjkuNzE4bC0uODIzIDEuOTc5Yy0uODUtLjQyNS0xLjczNy0uNjM3LTIuNjU3LS42MzctMS4wNzEgMC0xLjkzMi4zNTgtMi41NzIgMS4wNzctLjY0NS43MTgtLjk2OCAxLjY4NS0uOTY4IDIuODk5IDAgMS4yNjcuMjYgMi4yMzMuNzggMi45MDQuNTE2LjY2NyAxLjI3MS45OTkgMi4yNjIuOTk5LjUxNyAwIDEuMDQxLS4wNTIgMS41NzItLjE1OHYtMi40MzVoLTIuMjA5em0xMS45MTIgNi41NTVoLTIuNDc0di05LjYxNGgtMy4xNzN2LTIuMDZoOC44MTZ2Mi4wNmgtMy4xNjl6bTkuOTA4IDAtMi44MTEtOS4xNThoLS4wNzJjLjEwMyAxLjg2My4xNTQgMy4xMDUuMTU0IDMuNzI4djUuNDNoLTIuMjEzdi0xMS42NzRoMy4zNjhsMi43NjQgOC45MjdoLjA0OGwyLjkzNC04LjkyN2gzLjM2OXYxMS42NzRoLTIuMzA4di01LjUyNWMwLS4yNjEgMC0uNTYxLjAwOS0uOTAzLjAwOS0uMzQxLjA0OC0xLjI0Ni4xMTItMi43MTZoLS4wNzRsLTMuMDExIDkuMTQ0eiIvPjxwYXRoIGQ9Im04OC44ODMgMzEuODk4aC0zLjgxMWwtNC4xNDctNi42Ny0xLjQxNyAxLjAxOHY1LjY1MmgtMy4zNTd2LTE1LjgzaDMuMzU3djcuMjQybDEuMzE4LTEuODYxIDQuMjkzLTUuMzgxaDMuNzI0bC01LjUyMyA3LjAwNnptMS41ODktMTUuMjMzYzAtMS4wNzUuNi0xLjYxNCAxLjgtMS42MTQgMS4xOTkgMCAxLjc5OC41MzkgMS43OTggMS42MTQgMCAuNTEyLS4xNDguOTEtLjQ1IDEuMTk2LS4yOTcuMjg0LS43NDkuNDI5LTEuMzQ4LjQyOS0xLjIgMC0xLjgtLjU0My0xLjgtMS42MjV6bTMuNDQ5IDE1LjIzM2gtMy4zMDJ2LTEyLjEwNGgzLjMwMnptOC41NjMtMi40MTNjLjU3OCAwIDEuMjcxLS4xMjggMi4wNzctLjM4djIuNDU2Yy0uODIuMzctMS44MzEuNTUyLTMuMDMxLjU1Mi0xLjMyNCAwLTIuMjgtLjMzMy0yLjg4NS0xLjAwMS0uNjAyLS42NjctLjkwMi0xLjY2OC0uOTAyLTMuMDAzdi01LjgzNWgtMS41ODV2LTEuMzk5bDEuODIzLTEuMTAzLjk0OS0yLjU1N2gyLjExNXYyLjU3OWgzLjM4OHYyLjQ4aC0zLjM4OHY1LjgzNWMwIC40NjcuMTI5LjgxNS4zOTMgMS4wNDEuMjY0LjIyMi42MTQuMzM1IDEuMDQ2LjMzNXoiLz48L2c+PC9zdmc+",alt:(0,s.__)("GTM Kit","gtm-kit"),className:"gtmkit-w-full"}))),(0,e.createElement)(Ct,null)),Ot=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("footer",{className:"gtm-kit-settings-footer gtmkit-my-8 gtmkit-text-color-grey"},(0,e.createElement)("p",{className:"gtmkit-mx-auto gtmkit-max-w-max"},(0,e.createElement)("a",{className:"gtmkit-underline",href:window.gtmkitSettings.dashboardUrl},(0,s.__)("Go to the dashboard.","gtm-kit"))))),At=()=>{const{useSettings:t}=(0,a.useContext)(c);return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,null),(0,e.createElement)("main",{className:"gtmkit-max-w-3xl gtmkit-bg-white gtmkit-border-1 gtmkit-border-color-border gtmkit-rounded-md gtmkit-mx-auto gtmkit-py-12 gtmkit-px-16 gtmkit-text-base"},(0,e.createElement)(ht,null,(0,e.createElement)(dt,{exact:!0,path:"/welcome",element:(0,e.createElement)(vt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/essential-settings",element:(0,e.createElement)(_t,null)}),(0,e.createElement)(dt,{exact:!0,path:"/share-anonymous-data",element:(0,e.createElement)(bt,null)}),(0,e.createElement)(dt,{exact:!0,path:"/getting-started",element:(0,e.createElement)(wt,null)}),(0,e.createElement)(dt,{path:"/",element:(0,e.createElement)(ut,{replace:!0,to:"/welcome"})}))),(0,e.createElement)(Ot,null)):(0,e.createElement)(n.Spinner,{className:"gtm-kit-settings-page-loader"})},Ut=()=>(0,e.createElement)(Et,{basename:"/"},(0,e.createElement)(g,null,(0,e.createElement)(At,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Ut,null),document.getElementById(window.gtmkitSettings.rootId))}))})();
  • gtm-kit/trunk/assets/integration/woocommerce.js

    r3018660 r3032523  
    1 function gtmkitLoad(){const d=window.gtmkit_settings.datalayer_name;let a;const n={"wp-block-handpicked-products":1,"wp-block-product-best-sellers":1,"wp-block-product-category":1,"wp-block-product-new":1,"wp-block-product-on-sale":1,"wp-block-products-by-attribute":1,"wp-block-product-tag":1,"wp-block-product-top-rated":1};document.querySelectorAll(".wc-block-grid .wc-block-grid__product").forEach(function(t){var e=t.closest(".wc-block-grid"),i=t.querySelector(".gtmkit_product_data");if(e&&i){var o,r=e.classList;if(r)for(const c in n)r.contains(c)&&((o=JSON.parse(i.getAttribute("data-gtmkit_product_data"))).item_list_name=window.gtmkit_settings.wc.text[c],o.index=n[c],i.setAttribute("data-gtmkit_product_data",JSON.stringify(o)),n[c]++)}});var t=document.querySelectorAll(".gtmkit_product_data");if(t.length){const i=[];let e;t.forEach(function(t){e=JSON.parse(t.getAttribute("data-gtmkit_product_data")),i.push(e)}),window[d].push({ecommerce:null}),window[d].push({event:"view_item_list",ecommerce:{items:i}})}document.addEventListener("click",function(t){t=t.target;let e;if(!t)return!0;if(t.closest(".add_to_cart_button.ajax_add_to_cart:not(.single_add_to_cart_button)"))e="add_to_cart";else{if(!t.closest(".products")&&!t.closest(".wc-block-grid__products")||!t.closest(".add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list)"))return!0;e="add_to_wishlist"}t=t.closest(".product,.wc-block-grid__product"),t=t&&t.querySelector(".gtmkit_product_data");if(!t)return!0;t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=1,window[d].push({ecommerce:null}),window[d].push({event:e,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}})}),document.addEventListener("click",function(o){o=o.target;if(!o)return!0;let r,i=o.closest("form.cart");if(!i){let t=o.parentNode;for(;!i&&t;)i=t.querySelector("form.cart"),t=t.parentNode}if(!i)return!0;if(o.closest(".single_add_to_cart_button:not(.disabled,.input-needed)"))r="add_to_cart";else{if(!o.closest(".add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list,.disabled-add-wishlist)"))return!0;r="add_to_wishlist"}var o=i.querySelectorAll("[name=variation_id]"),t=i.classList&&i.classList.contains("grouped_form")&&!i.classList.contains("bundle_form");if(o.length){let t=1,e;a&&(o=i.querySelector("[name=quantity]"),a.quantity=o&&o.value||1,t=a.quantity,e=a.price),(a&&"add_to_cart"===r||"add_to_wishlist"===r)&&(window[d].push({ecommerce:null}),window[d].push({event:r,ecommerce:{currency:window.gtmkit_data.wc.currency,value:e*t,items:[a]}}))}else if(t){o=document.querySelectorAll(".grouped_form .gtmkit_product_data");const c=[];let i=0;if(o.forEach(function(t){let e=document.querySelectorAll("input[name=quantity\\["+t.getAttribute("data-gtmkit_product_id")+"\\]]");if(e=Number(e[0].value),0===(e=isNaN(e)?0:e)&&"add_to_cart"===r)return!0;0===e&&"add_to_wishlist"===r&&(e=1);t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=e,c.push(t),i+=t.price*t.quantity}),0===c.length)return!0;window[d].push({ecommerce:null}),window[d].push({event:r,ecommerce:{currency:window.gtmkit_data.wc.currency,value:i,items:c}})}else{t=JSON.parse(i.querySelector("[name=gtmkit_product_data]")&&i.querySelector("[name=gtmkit_product_data]").value);t.quantity=i.querySelector("[name=quantity]")&&i.querySelector("[name=quantity]").value,window[d].push({ecommerce:null}),window[d].push({event:r,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price*t.quantity,items:[t]}})}}),document.addEventListener("click",function(t){var t=t.target;return!t||!t.closest(".mini_cart_item a.remove,.product-remove a.remove")||!(t=JSON.parse(t.getAttribute("data-gtmkit_product_data")))||(window[d].push({ecommerce:null}),void window[d].push({event:"remove_from_cart",ecommerce:{items:[t]}}))});document.addEventListener("click",function(t){t=t.target;if(!t.closest(".products .product:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),.wc-block-grid__products li:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),.woocommerce-grouped-product-list-item__label a:not(.add_to_wishlist,.tinvwl_add_to_wishlist_button)"))return!0;var t=t.closest(".product,.wc-block-grid__product");let e;return!t||!(e=t.querySelector(".gtmkit_product_data"))||void 0===e.getAttribute("data-gtmkit_product_data")||!(t=JSON.parse(e.getAttribute("data-gtmkit_product_data")))||(window[d].push({ecommerce:null}),void window[d].push({event:"select_item",ecommerce:{items:[t]}}))}),jQuery(document).on("found_variation",function(t,e){if(void 0!==e){t=t.target;if(t.querySelector("[name=gtmkit_product_data]")){var t=JSON.parse(t.querySelector("[name=gtmkit_product_data]")&&t.querySelector("[name=gtmkit_product_data]").value),i=(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.variation_id,window.gtmkit_settings.wc.use_sku&&e.sku&&""!==e.sku&&(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.sku),t.price=e.display_price,[]);for(const o in e.attributes)i.push(e.attributes[o]);t.item_variant=i.filter(t=>t).join("|"),a=t,0!==window.gtmkit_settings.wc.view_item.config&&(window[d].push({ecommerce:null}),window[d].push({event:"view_item",ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}}))}}})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",gtmkitLoad):gtmkitLoad();
     1function gtmkitLoad(){const a=window.gtmkit_settings.datalayer_name;let d;const n={"wp-block-handpicked-products":1,"wp-block-product-best-sellers":1,"wp-block-product-category":1,"wp-block-product-new":1,"wp-block-product-on-sale":1,"wp-block-products-by-attribute":1,"wp-block-product-tag":1,"wp-block-product-top-rated":1};document.querySelectorAll(".wc-block-grid .wc-block-grid__product").forEach(function(t){var e=t.closest(".wc-block-grid"),i=t.querySelector(".gtmkit_product_data");if(e&&i){var r,c=e.classList;if(c)for(const o in n)c.contains(o)&&((r=JSON.parse(i.getAttribute("data-gtmkit_product_data"))).item_list_name=window.gtmkit_settings.wc.text[o],r.index=n[o],i.setAttribute("data-gtmkit_product_data",JSON.stringify(r)),n[o]++)}});var t=document.querySelectorAll(".gtmkit_product_data");if(t.length){const i=[];let e;t.forEach(function(t){e=JSON.parse(t.getAttribute("data-gtmkit_product_data")),i.push(e)}),window[a].push({ecommerce:null}),window[a].push({event:"view_item_list",ecommerce:{items:i}})}document.addEventListener("click",function(t){t=t.target;let e;if(!t)return!0;if(t.closest(".add_to_cart_button.ajax_add_to_cart:not(.single_add_to_cart_button)"))e="add_to_cart";else{if(!t.closest(".products")&&!t.closest(".wc-block-grid__products")||!t.closest(window.gtmkit_settings.wc.css_selectors.product_list_wishlist))return!0;e="add_to_wishlist"}t=t.closest(".product,.wc-block-grid__product"),t=t&&t.querySelector(".gtmkit_product_data");if(!t)return!0;t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=1,window[a].push({ecommerce:null}),window[a].push({event:e,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}})}),document.addEventListener("click",function(r){r=r.target;if(!r)return!0;let c,i=r.closest("form.cart");if(!i){let t=r.parentNode;for(;!i&&t;)i=t.querySelector("form.cart"),t=t.parentNode}if(!i)return!0;if(r.closest(".single_add_to_cart_button:not(.disabled,.input-needed)"))c="add_to_cart";else{if(!r.closest(window.gtmkit_settings.wc.css_selectors.single_product_wishlist))return!0;c="add_to_wishlist"}var r=i.querySelectorAll("[name=variation_id]"),t=i.classList&&i.classList.contains("grouped_form")&&!i.classList.contains("bundle_form");if(r.length){let t=1,e;d&&(r=i.querySelector("[name=quantity]"),d.quantity=r&&r.value||1,t=d.quantity,e=d.price),(d&&"add_to_cart"===c||"add_to_wishlist"===c)&&(window[a].push({ecommerce:null}),window[a].push({event:c,ecommerce:{currency:window.gtmkit_data.wc.currency,value:e*t,items:[d]}}))}else if(t){r=document.querySelectorAll(".grouped_form .gtmkit_product_data");const o=[];let i=0;if(r.forEach(function(t){let e=document.querySelectorAll("input[name=quantity\\["+t.getAttribute("data-gtmkit_product_id")+"\\]]");if(e=Number(e[0].value),0===(e=isNaN(e)?0:e)&&"add_to_cart"===c)return!0;0===e&&"add_to_wishlist"===c&&(e=1);t=JSON.parse(t.getAttribute("data-gtmkit_product_data"));t.quantity=e,o.push(t),i+=t.price*t.quantity}),0===o.length)return!0;window[a].push({ecommerce:null}),window[a].push({event:c,ecommerce:{currency:window.gtmkit_data.wc.currency,value:i,items:o}})}else{t=JSON.parse(i.querySelector("[name=gtmkit_product_data]")&&i.querySelector("[name=gtmkit_product_data]").value);t.quantity=i.querySelector("[name=quantity]")&&i.querySelector("[name=quantity]").value,window[a].push({ecommerce:null}),window[a].push({event:c,ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price*t.quantity,items:[t]}})}}),document.addEventListener("click",function(t){var t=t.target;return!t||!t.closest(".mini_cart_item a.remove,.product-remove a.remove")||!(t=JSON.parse(t.getAttribute("data-gtmkit_product_data")))||(window[a].push({ecommerce:null}),void window[a].push({event:"remove_from_cart",ecommerce:{items:[t]}}))}),document.addEventListener("click",function(t){t=t.target;if(!t.closest(window.gtmkit_settings.wc.css_selectors.product_list_select_item))return!0;var t=t.closest(".product,.wc-block-grid__product");let e;return!t||!(e=t.querySelector(".gtmkit_product_data"))||void 0===e.getAttribute("data-gtmkit_product_data")||!(t=JSON.parse(e.getAttribute("data-gtmkit_product_data")))||(window[a].push({ecommerce:null}),void window[a].push({event:"select_item",ecommerce:{items:[t]}}))}),jQuery(document).on("found_variation",function(t,e){if(void 0!==e){t=t.target;if(t.querySelector("[name=gtmkit_product_data]")){var t=JSON.parse(t.querySelector("[name=gtmkit_product_data]")&&t.querySelector("[name=gtmkit_product_data]").value),i=(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.variation_id,window.gtmkit_settings.wc.use_sku&&e.sku&&""!==e.sku&&(t.id=t.item_id=window.gtmkit_settings.wc.pid_prefix+e.sku),t.price=e.display_price,[]);for(const r in e.attributes)i.push(e.attributes[r]);t.item_variant=i.filter(t=>t).join("|"),d=t,0!==window.gtmkit_settings.wc.view_item.config&&(window[a].push({ecommerce:null}),window[a].push({event:"view_item",ecommerce:{currency:window.gtmkit_data.wc.currency,value:t.price,items:[t]}}))}}})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",gtmkitLoad):gtmkitLoad();
  • gtm-kit/trunk/gtm-kit.php

    r3018660 r3032523  
    44 *
    55 * Plugin Name: GTM Kit
    6  * Version:     1.18.1
     6 * Version:     1.19
    77 * Plugin URI:  https://gtmkit.com/
    88 * Description: Google Tag Manager implementation focusing on flexibility and pagespeed.
    9  * Author:      TLA Media
    10  * Author URI:  https://www.tlamedia.dk/
     9 * Author:      GTM Kit
     10 * Author URI:  https://gtmkit.com/
    1111 * Text Domain: gtm-kit
    1212 * Domain Path: /languages/
     
    1919 *
    2020 * @package GTM Kit
    21  * @copyright Copyright (C) 2023, TLA Media ApS
     21 * @copyright Copyright (C) 2021-2024, TLA Media ApS
    2222 */
    2323
     
    2828}
    2929
    30 const GTMKIT_VERSION = '1.18.1';
     30const GTMKIT_VERSION = '1.19';
    3131
    3232if ( ! defined( 'GTMKIT_FILE' ) ) {
  • gtm-kit/trunk/languages/gtm-kit.pot

    r3018660 r3032523  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: GTM Kit 1.18.1\n"
     5"Project-Id-Version: GTM Kit 1.19\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gtm-kit\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-01-05T14:48:44+00:00\n"
     12"POT-Creation-Date: 2024-02-06T14:22:05+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.9.0\n"
     
    4646msgstr ""
    4747
    48 #: src/Admin/AbstractOptionsPage.php:228
     48#: src/Admin/AbstractOptionsPage.php:232
    4949#: src/Admin/SetupWizard.php:179
    5050msgid "Whoops, something's not working."
    5151msgstr ""
    5252
    53 #: src/Admin/AbstractOptionsPage.php:231
     53#: src/Admin/AbstractOptionsPage.php:235
    5454#: src/Admin/SetupWizard.php:182
    5555msgid "It looks like something is preventing JavaScript from loading on your website. GTM Kit requires JavaScript in order to give you the best possible experience."
    5656msgstr ""
    5757
    58 #: src/Admin/AbstractOptionsPage.php:236
     58#: src/Admin/AbstractOptionsPage.php:240
    5959#: src/Admin/SetupWizard.php:130
    6060#: src/Admin/SetupWizard.php:187
     
    112112msgstr ""
    113113
    114 #: src/Common/Util.php:102
     114#: src/Common/Util.php:122
    115115msgid "Server type:"
    116116msgstr ""
    117117
    118 #: src/Common/Util.php:107
     118#: src/Common/Util.php:127
    119119msgid "PHP version number:"
    120120msgstr ""
    121121
    122 #: src/Common/Util.php:112
     122#: src/Common/Util.php:132
    123123msgid "WordPress version number:"
    124124msgstr ""
    125125
    126 #: src/Common/Util.php:117
     126#: src/Common/Util.php:137
    127127msgid "WordPress multisite:"
    128128msgstr ""
    129129
    130 #: src/Common/Util.php:118
     130#: src/Common/Util.php:138
    131131#: assets/admin/wizard.js:1
    132132msgid "Yes"
    133133msgstr ""
    134134
    135 #: src/Common/Util.php:118
     135#: src/Common/Util.php:138
    136136#: assets/admin/wizard.js:1
    137137msgid "No"
    138138msgstr ""
    139139
    140 #: src/Common/Util.php:122
     140#: src/Common/Util.php:142
    141141msgid "Current theme:"
    142142msgstr ""
    143143
    144 #: src/Common/Util.php:127
     144#: src/Common/Util.php:147
    145145msgid "Current site language:"
    146146msgstr ""
    147147
    148 #: src/Common/Util.php:132
     148#: src/Common/Util.php:152
    149149msgid "Active plugins:"
    150150msgstr ""
    151151
    152 #: src/Common/Util.php:133
     152#: src/Common/Util.php:153
    153153msgid "Plugin name and version of all active plugins"
    154154msgstr ""
    155155
    156 #: src/Common/Util.php:137
     156#: src/Common/Util.php:157
    157157msgid "Anonymized GTM Kit settings:"
    158158msgstr ""
    159159
    160 #: src/Common/Util.php:138
     160#: src/Common/Util.php:158
    161161msgid "Which GTM Kit settings are active"
    162162msgstr ""
     
    176176
    177177#: src/Integration/WooCommerce.php:249
    178 #: src/Integration/WooCommerce.php:948
     178#: src/Integration/WooCommerce.php:955
    179179msgid "Product Category"
    180180msgstr ""
     
    193193
    194194#: src/Integration/WooCommerce.php:253
    195 #: src/Integration/WooCommerce.php:950
     195#: src/Integration/WooCommerce.php:957
    196196msgid "Product Tag"
    197197msgstr ""
     
    205205msgstr ""
    206206
    207 #: src/Integration/WooCommerce.php:807
     207#: src/Integration/WooCommerce.php:814
    208208msgid "Grouped Product"
    209209msgstr ""
    210210
    211 #: src/Integration/WooCommerce.php:841
     211#: src/Integration/WooCommerce.php:848
    212212msgid "Search Results"
    213213msgstr ""
    214214
    215 #: src/Integration/WooCommerce.php:841
    216 #: src/Integration/WooCommerce.php:882
    217 #: src/Integration/WooCommerce.php:915
     215#: src/Integration/WooCommerce.php:848
     216#: src/Integration/WooCommerce.php:889
     217#: src/Integration/WooCommerce.php:922
    218218msgid "General Product List"
    219219msgstr ""
    220220
    221 #: src/Integration/WooCommerce.php:1099
     221#: src/Integration/WooCommerce.php:1106
    222222msgid "GTM Kit data."
    223223msgstr ""
     
    455455#: assets/admin/settings.js:1
    456456msgid "Learn more about Stape.io"
     457msgstr ""
     458
     459#: assets/admin/settings.js:1
     460msgid "Page Speed Optimization"
     461msgstr ""
     462
     463#: assets/admin/settings.js:1
     464msgid "load_js event"
     465msgstr ""
     466
     467#: assets/admin/settings.js:1
     468msgid "Setting this to On will push the event 'load_js' om page load."
     469msgstr ""
     470
     471#: assets/admin/settings.js:1
     472msgid "Delay JavaScript execution"
     473msgstr ""
     474
     475#: assets/admin/settings.js:1
     476msgid "Page optimization plugins can delay the 'load_js' event and this can be used to delay the triggering og tags in Google Tag Manager."
    457477msgstr ""
    458478
  • gtm-kit/trunk/readme.txt

    r3018660 r3032523  
    1 === GTM Kit - Google Tag Manager integration ===
    2 Contributors: tlamedia, torbenlundsgaard
     1=== GTM Kit - Google Tag Manager & GA4 integration ===
     2Contributors: tlamedia, torbenlundsgaard, gtmkit
    33Donate link: https://github.com/tlamedia/gtm-kit
    44Tags: google tag manager, gtm, woocommerce, analytics, ga4, gtag, easy digital downloads
    55Tested up to: 6.4
    6 Stable tag: 1.18.1
     6Stable tag: 1.19
    77License: GPLv3
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
    99
    10 Flexible tool for generating the data layer for Google Tag Manager. Including WooCommerce data for Google Analytics 4 and support for server side GTM.
     10Flexible tool for generating the data layer for Google Tag Manager and GA4. Including WooCommerce data for Google Analytics 4 and support for server side GTM.
    1111
    1212== Description ==
     
    8989== Changelog ==
    9090
     91= 1.19 =
     92
     93Release date: 2024-02-07
     94
     95Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-1-19/).
     96
     97#### Enhancements:
     98* Add option to fire a 'load_delayed_js' event, which can be used to delay JavaScript execution in Google Tag Manager.
     99* This release comes with many behind-the-scenes improvements and general enhancements.
     100* The script settings are the same on all pages and are now cached in the object cache for better performance.
     101* The function to share system data with the support team has been improved with more data.
     102* The code has been refactored for extendability.
     103
    91104= 1.18.1 =
    92105
     
    156169* Refactoring code for simplicity and maintainability
    157170
    158 = 1.16.2 =
    159 
    160 Release date: 2023-11-15
    161 
    162 #### Bugfixes:
    163 
    164 * Fix critical JS bug.
    165 
    166 = 1.16 =
    167 
    168 Release date: 2023-11-15
    169 
    170 Find out about what's new in our [our release post](https://gtmkit.com/gtm-kit-1-16/).
    171 
    172 #### Enhancements:
    173 
    174 * Add option to include customer data from Easy Digital Downloads on the purchase event.
    175 * Added the filter 'gtmkit_datalayer_script', which allows you to filter the datalayer script.
    176 * Added the constant 'GTMKIT_EDD_DEBUG_TRACK_PURCHASE', which allows users of Easy Digital Downloads to force tracking of purchase event on every page refresh for debugging.
    177 
    178 #### Bugfixes:
    179 
    180 * Billing state and shipping stat was not included in the customer data on the 'purchase' event.
    181 
    182 #### Other:
    183 
    184 * Tested up to WordPress 6.4
    185 * Tested up to WooCommerce 8.3
    186 
    187171= Earlier versions =
    188172For the changelog of earlier versions, please refer to [the changelog on gtmkit.com](https://gtmkit.com/changelog/).
  • gtm-kit/trunk/src/Admin/AbstractOptionsPage.php

    r2974164 r3032523  
    4040
    4141        add_filter( 'admin_body_class', [ $page, 'admin_body_class' ] );
     42
     43        add_action( 'activated_plugin', [ $page, 'clear_script_settings_cache' ] );
     44        add_action( 'deactivated_plugin', [ $page, 'clear_script_settings_cache' ] );
     45        add_action( 'switch_theme', [ $page, 'clear_script_settings_cache' ] );
    4246    }
    4347
     
    246250        <?php
    247251    }
     252
     253    /**
     254     * Clear the script settings cache.
     255     *
     256     * @return void
     257     */
     258    public function clear_script_settings_cache(): void {
     259        wp_cache_delete( 'gtmkit_script_settings', 'gtmkit' );
     260    }
    248261}
  • gtm-kit/trunk/src/Common/Util.php

    r3016305 r3032523  
    88namespace TLA_Media\GTM_Kit\Common;
    99
     10use TLA_Media\GTM_Kit\Integration\WooCommerce;
     11
    1012/**
    1113 * Class for common utilities.
     
    2123
    2224    /**
     25     * Asset path
     26     *
     27     * @var string
     28     */
     29    public $asset_path;
     30
     31    /**
     32     * Asset URL
     33     *
     34     * @var string
     35     */
     36    public $asset_url;
     37
     38    /**
    2339     * Constructor.
    2440     *
    2541     * @param RestAPIServer $rest_api_server Instance of RestAPIServer.
    26      */
    27     public function __construct( RestAPIServer $rest_api_server ) {
     42     * @param string        $path The plugin path.
     43     * @param string        $url The plugin URL.
     44     */
     45    public function __construct( RestAPIServer $rest_api_server, string $path = GTMKIT_PATH, string $url = GTMKIT_URL ) {
    2846        $this->rest_api_server = $rest_api_server;
     47        $this->asset_path      = $path . 'assets/';
     48        $this->asset_url       = $url . 'assets/';
    2949    }
    3050
     
    5474            $data = $this->add_active_plugin_and_version( $plugin, $key, $data );
    5575        }
    56 
    5776        $data['locale'] = explode( '_', get_locale() )[0];
    5877        if ( $anonymize ) {
    5978            $data = $this->add_shared_data( $data, $wp_version );
    6079        } else {
    61             $data['support_data'] = [
    62                 'site_url' => site_url(),
    63             ];
     80            $data['support_data']['site_url'] = site_url();
     81            if ( function_exists( 'WC' ) ) {
     82                $data['support_data']['pages'] = WooCommerce::instance()->get_pages_property( [] )['pages'];
     83            }
    6484        }
    6585
     
    82102        $data['php_version']       = $this->shorten_version( phpversion() );
    83103        $data['wordpress_version'] = $this->shorten_version( $wp_version );
    84         $data['current_theme']     = \wp_get_theme()->get( 'Name' );
     104        $data['current_theme']     = ( wp_get_theme()->get( 'Template' ) ) ? ucwords( wp_get_theme()->get( 'Template' ) ) : \wp_get_theme()->get( 'Name' );
    85105        $data['active_plugins']    = $this->get_active_plugins();
    86106        $data['multisite']         = \is_multisite();
     
    121141            5 => [
    122142                'label' => __( 'Current theme:', 'gtm-kit' ),
    123                 'value' => \wp_get_theme()->get( 'Name' ),
     143                'value' => ( wp_get_theme()->get( 'Template' ) ) ? ucwords( wp_get_theme()->get( 'Template' ) ) : \wp_get_theme()->get( 'Name' ),
    124144                'tag'   => 'code',
    125145            ],
     
    266286
    267287        if ( $has_asset_file ) {
    268             $file = GTMKIT_PATH . 'assets/' . substr_replace( $script, '.asset.php', - strlen( '.js' ) );
     288            $file = $this->asset_path . substr_replace( $script, '.asset.php', - strlen( '.js' ) );
    269289            if ( file_exists( $file ) ) {
    270290                $deps_file = require $file;
     
    277297        $deps[] = 'gtmkit-container';
    278298
    279         \wp_enqueue_script( $handle, GTMKIT_URL . 'assets/' . $script, $deps, $ver, $args );
     299        \wp_enqueue_script( $handle, $this->asset_url . $script, $deps, $ver, $args );
    280300    }
    281301}
  • gtm-kit/trunk/src/Frontend/Frontend.php

    r3016305 r3032523  
    6060        }
    6161
     62        if ( $options->get( 'general', 'load_js_event' ) ) {
     63            add_action( 'wp_enqueue_scripts', [ $page, 'enqueue_delay_js_script' ] );
     64        }
     65
    6266        if ( $noscript_implementation === '0' && $container_active ) {
    6367            add_action( 'wp_body_open', [ $page, 'get_body_script' ] );
     
    7579     */
    7680    public function enqueue_settings_and_data_script(): void {
    77         $settings = [
    78             'datalayer_name' => $this->datalayer_name,
    79             'console_log'    => $this->options->get( 'general', 'console_log' ),
    80         ];
     81        $settings = wp_cache_get( 'gtmkit_script_settings', 'gtmkit' );
     82        if ( ! $settings ) {
     83
     84            $settings = apply_filters(
     85                'gtmkit_header_script_settings',
     86                [
     87                    'datalayer_name' => $this->datalayer_name,
     88                    'console_log'    => $this->options->get( 'general', 'console_log' ),
     89                ]
     90            );
     91
     92            wp_cache_set( 'gtmkit_script_settings', $settings, 'gtmkit' );
     93        }
    8194
    8295        ob_start();
    8396        ?>
    84         window.gtmkit_settings = <?php echo wp_json_encode( apply_filters( 'gtmkit_header_script_settings', $settings ), JSON_FORCE_OBJECT ); ?>;
     97        window.gtmkit_settings = <?php echo wp_json_encode( $settings, JSON_FORCE_OBJECT ); ?>;
    8598        window.gtmkit_data = <?php echo wp_json_encode( apply_filters( 'gtmkit_header_script_data', [] ), JSON_FORCE_OBJECT ); ?>;
    8699        window.<?php echo esc_js( $this->datalayer_name ); ?> = window.<?php echo esc_js( $this->datalayer_name ); ?> || [];
     
    169182
    170183    /**
     184     * This script fires the 'delay_js' event in Google Tag Manager
     185     */
     186    public function enqueue_delay_js_script(): void {
     187
     188        $script = esc_attr( $this->datalayer_name ) . '.push({"event" : "load_delayed_js"});' . "\n";
     189
     190        wp_register_script( 'gtmkit-delay', '', [ 'gtmkit-container' ], GTMKIT_VERSION, [ 'strategy' => 'defer' ] );
     191        wp_enqueue_script( 'gtmkit-delay' );
     192        wp_add_inline_script( 'gtmkit-delay', $script, 'before' );
     193    }
     194
     195    /**
    171196     * Get GTM script
    172197     *
     
    204229    public function set_inline_script_attributes( array $attributes, string $script ): array { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
    205230        if ( isset( $attributes['id'] ) && strpos( $attributes['id'], 'gtmkit-' ) === 0 ) {
     231
     232            if ( strpos( $attributes['id'], 'gtmkit-delay' ) === 0 ) {
     233                return $attributes;
     234            }
     235
    206236            $script_attributes = apply_filters(
    207237                'gtmkit_header_script_attributes',
  • gtm-kit/trunk/src/Integration/WooCommerce.php

    r3018660 r3032523  
    256256            'payment-method-not-found'       => __( 'Payment method not found', 'gtm-kit' ),
    257257        ];
     258        $global_settings['wc']['css_selectors']               = [
     259            'single_product_wishlist'  => '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list,.disabled-add-wishlist)',
     260            'product_list_select_item' => '.products .product:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' .
     261                                        '.wc-block-grid__products li:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' .
     262                                        '.woocommerce-grouped-product-list-item__label a:not(.add_to_wishlist,.tinvwl_add_to_wishlist_button)',
     263            'product_list_wishlist'    => '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list)',
     264        ];
    258265
    259266        return $global_settings;
     
    601608     * @return array The datalayer content
    602609     */
    603     private function get_pages_property( array $data_layer ): array {
     610    public function get_pages_property( array $data_layer ): array {
    604611        $data_layer['pages'] = [
    605612            'cart'          => str_replace( \home_url(), '', \wc_get_cart_url() ),
  • gtm-kit/trunk/src/Options.php

    r3004949 r3032523  
    249249        // Now we need to re-cache values.
    250250        wp_cache_delete( self::OPTION_NAME, 'options' );
     251        wp_cache_delete( 'gtmkit_script_settings', 'gtmkit' );
    251252        $this->options = get_option( self::OPTION_NAME, [] );
    252253    }
  • gtm-kit/trunk/src/js/woocommerce.js

    r3018660 r3032523  
    9191                eventTargetElement.closest('.wc-block-grid__products')) &&
    9292            eventTargetElement.closest(
    93                 '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list)'
     93                window.gtmkit_settings.wc.css_selectors.product_list_wishlist
    9494            )
    9595        ) {
     
    149149            if ( eventTargetElement.closest( '.single_add_to_cart_button:not(.disabled,.input-needed)' ) ) {
    150150                event = 'add_to_cart';
    151             } else if ( eventTargetElement.closest( '.add_to_wishlist, .tinvwl_add_to_wishlist_button:not(.tinvwl-product-in-list,.disabled-add-wishlist)' ) ) {
     151            } else if ( eventTargetElement.closest( window.gtmkit_settings.wc.css_selectors.single_product_wishlist ) ) {
    152152                event = 'add_to_wishlist';
    153153            } else {
     
    288288
    289289    // select_item event on clicks in product lists
    290     const productListItemSelector =
    291         '.products .product:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' +
    292         '.wc-block-grid__products li:not(.product-category) a:not(.add_to_cart_button.ajax_add_to_cart,.add_to_wishlist,.tinvwl_add_to_wishlist_button),' +
    293         '.woocommerce-grouped-product-list-item__label a:not(.add_to_wishlist,.tinvwl_add_to_wishlist_button)';
    294290    document.addEventListener('click', function (e) {
    295291        const eventTargetElement = e.target;
    296         const linkElement = eventTargetElement.closest(productListItemSelector);
     292        const linkElement = eventTargetElement.closest( window.gtmkit_settings.wc.css_selectors.product_list_select_item );
    297293        if (!linkElement) return true;
    298294
  • gtm-kit/trunk/vendor/composer/installed.php

    r3018660 r3032523  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'cfde4bb434472c8c469284795c75b4479c67d526',
     6        'reference' => '2b02d248fe945a37d72cc6fb59ef2c6528ad87ba',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => 'cfde4bb434472c8c469284795c75b4479c67d526',
     16            'reference' => '2b02d248fe945a37d72cc6fb59ef2c6528ad87ba',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.