Changeset 2996217
- Timestamp:
- 11/15/2023 07:44:12 AM (2 years ago)
- Location:
- gtm-kit
- Files:
-
- 8 edited
- 1 copied
-
tags/1.16.1 (copied) (copied from gtm-kit/trunk)
-
tags/1.16.1/assets/admin/settings.asset.php (modified) (1 diff)
-
tags/1.16.1/assets/admin/settings.js (modified) (1 diff)
-
tags/1.16.1/gtm-kit.php (modified) (2 diffs)
-
tags/1.16.1/readme.txt (modified) (2 diffs)
-
trunk/assets/admin/settings.asset.php (modified) (1 diff)
-
trunk/assets/admin/settings.js (modified) (1 diff)
-
trunk/gtm-kit.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gtm-kit/tags/1.16.1/assets/admin/settings.asset.php
r2996198 r2996217 1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '1 689401046804ff129b1');1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '144bdea183542adb3387'); -
gtm-kit/tags/1.16.1/assets/admin/settings.js
r2996198 r2996217 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.element,i=window.wp.components,r=window.lodash,o=window.wp.apiFetch,l=t.n(o);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const s=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-options",method:"GET"})}catch(t){return console.log("fetchSettings Errors:",t),{gtm_kit_settings_fetch_settings_errors:!0}}return!0===t.success?t.data:t},m=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-site-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t};var c=window.wp.i18n,u=(t,e)=>{const n=Object.assign({},t);switch(e.type){case"FETCH_SETTINGS":n.fetchedSettings=e.payload.fetchedSettings,n.stateSettings=e.payload.stateSettings,n.siteData=e.payload.siteData,n.installData=e.payload.installData,n.isPending=!1,n.canSave=!1,void 0===e.payload.fetchedSettings.integrations&&(n.fetchedSettings.integrations={}),void 0!==e.payload.fetchedSettings.gtm_kit_settings_fetch_settings_errors&&(n.notice=(0,c.__)("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;let t=!1,a=(0,c.__)("Saved Successfully.","gtm-kit"),i=!1;void 0!==e.payload.fetchedSettings.gtm_kit_settings_update_settings_errors&&(t=!0,a=(0,c.__)("An error occurred.","gtm-kit"),i=!0),n.canSave=t,n.notice=a,n.hasError=i;break;case"UPDATE_STATE":e.payload.fetchedSettings&&(n.fetchedSettings=e.payload.fetchedSettings),e.payload.stateSettings&&(n.stateSettings=e.payload.stateSettings),void 0!==e.payload.isPending&&(n.isPending=e.payload.isPending),void 0!==e.payload.notice&&(n.notice=e.payload.notice),void 0!==e.payload.hasError&&(n.hasError=e.payload.hasError),void 0!==e.payload.canSave&&(n.canSave=e.payload.canSave)}return n};const g=(0,a.createContext)();var d,p=t=>{const[n,i]=(0,a.useReducer)(u,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:"",canSave:!1}),o=async()=>{const[t,e]=await Promise.all([s(),m()]),n="wizard"===window.gtmkitSettings.currentPage?await(async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-install-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t})():{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:n}})},c=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{o()}),[]);const d={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(async t=>{let e={};try{e=await l()({path:"gtmkit/v1/set-options",method:"POST",data:t})}catch(t){return console.log("updateSettings Errors:",t),{gtm_kit_settings_update_settings_errors:!0}}return!0===e.success?e.data:e})(n.stateSettings);i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:o,useUpdateState:c,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let o;i[t][e]=a,o=!(0,r.isEqual)(i,n.fetchedSettings),c({stateSettings:i,canSave:o})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const o={};o.general={...a.general,...e.general},"integrations"in e&&(o.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(o,n.fetchedSettings),c({stateSettings:o,canSave:i})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData};return(0,e.createElement)(g.Provider,{value:d},t.children)};function h(){return h=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},h.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(d||(d={}));const _="popstate";function k(t,e){if(!1===t||null==t)throw new Error(e)}function f(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function E(t,e){return{usr:t.state,key:t.key,idx:e}}function v(t,e,n,a){return void 0===n&&(n=null),h({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:n,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function b(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 y(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 x;function w(t,e,n){void 0===n&&(n="/");let a=L(("string"==typeof e?y(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=M(i[t],A(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("/")&&(k(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&&(k(!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:R(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 N(t.path))i(t,e,n);else i(t,e)})),e}function N(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=N(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"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const C=/^:\w+$/,T=3,G=2,D=1,I=10,P=-2,O=t=>"*"===t;function R(t,e){let n=t.split("/"),a=n.length;return n.some(O)&&(a+=P),e&&(a+=G),n.filter((t=>!O(t))).reduce(((t,e)=>t+(C.test(e)?T:""===e?D:I)),a)}function M(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=U({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:W(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function U(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),f("*"===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)=>(a.push(e),"/([^\\/]+)")));return t.endsWith("*")?(a.push("*"),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)=>{if("*"===e){let t=l[n]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}return t[e]=function(t,e){try{return decodeURIComponent(t)}catch(n){return f(!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}}(l[n]||"",e),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return f(!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 L(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 j(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 B(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}function F(t,e,n,a){let i;void 0===a&&(a=!1),"string"==typeof t?i=y(t):(i=h({},t),k(!i.pathname||!i.pathname.includes("?"),j("?","pathname","search",i)),k(!i.pathname||!i.pathname.includes("#"),j("#","pathname","hash",i)),k(!i.search||!i.search.includes("#"),j("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(a||null==l)r=n;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?y(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:K(a),hash:J(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,"/"),W=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),K=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",J=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const z=["post","put","patch","delete"],$=(new Set(z),["get",...z]);function q(){return q=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},q.apply(this,arguments)}new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext(null),Z=e.createContext({outlet:null,matches:[],isDataRoute:!1}),tt=e.createContext(null);function et(){return null!=e.useContext(Q)}function nt(){return et()||k(!1),e.useContext(Q).location}function at(t){e.useContext(X).static||e.useLayoutEffect(t)}function it(){let{isDataRoute:t}=e.useContext(Z);return t?function(){let{router:t}=function(t){let n=e.useContext(V);return n||k(!1),n}(ut.UseNavigateStable),n=dt(gt.UseNavigateStable),a=e.useRef(!1);return at((()=>{a.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,q({fromRouteId:n},i)))}),[t,n])}():function(){et()||k(!1);let t=e.useContext(V),{basename:n,navigator:a}=e.useContext(X),{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase))),l=e.useRef(!1);return at((()=>{l.current=!0})),e.useCallback((function(e,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof e)return void a.go(e);let s=F(e,JSON.parse(o),r,"path"===i.relative);null==t&&"/"!==n&&(s.pathname="/"===s.pathname?n:H([n,s.pathname])),(i.replace?a.replace:a.push)(s,i.state,i)}),[n,a,o,r,t])}()}function rt(t,n){let{relative:a}=void 0===n?{}:n,{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase)));return e.useMemo((()=>F(t,JSON.parse(o),r,"path"===a)),[t,o,r,a])}function ot(t,n,a){et()||k(!1);let{navigator:i}=e.useContext(X),{matches:r}=e.useContext(Z),o=r[r.length-1],l=o?o.params:{},s=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let m,c=nt();if(n){var u;let t="string"==typeof n?y(n):n;"/"===s||(null==(u=t.pathname)?void 0:u.startsWith(s))||k(!1),m=t}else m=c;let g=m.pathname||"/",p=w(t,{pathname:"/"===s?g:g.slice(s.length)||"/"}),h=function(t,n,a){var i;if(void 0===n&&(n=[]),void 0===a&&(a=null),null==t){var r;if(null==(r=a)||!r.errors)return null;t=a.matches}let o=t,l=null==(i=a)?void 0:i.errors;if(null!=l){let t=o.findIndex((t=>t.route.id&&(null==l?void 0:l[t.route.id])));t>=0||k(!1),o=o.slice(0,Math.min(o.length,t+1))}return o.reduceRight(((t,i,r)=>{let s=i.route.id?null==l?void 0:l[i.route.id]:null,m=null;a&&(m=i.route.errorElement||st);let c=n.concat(o.slice(0,r+1)),u=()=>{let n;return n=s?m:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(ct,{match:i,routeContext:{outlet:t,matches:c,isDataRoute:null!=a},children:n})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(mt,{location:a.location,revalidation:a.revalidation,component:m,error:s,children:u(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):u()}),null)}(p&&p.map((t=>Object.assign({},t,{params:Object.assign({},l,t.params),pathname:H([s,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?s:H([s,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),r,a);return n&&h?e.createElement(Q.Provider,{value:{location:q({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:d.Pop}},h):h}function lt(){let t=function(){var t;let n=e.useContext(tt),a=function(t){let n=e.useContext(Y);return n||k(!1),n}(gt.UseRouteError),i=dt(gt.UseRouteError);return 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 st=e.createElement(lt,null);class mt 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: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 this.state.error?e.createElement(Z.Provider,{value:this.props.routeContext},e.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:n,match:a,children:i}=t,r=e.useContext(V);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),e.createElement(Z.Provider,{value:n},i)}var ut=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ut||{}),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 dt(t){let n=function(t){let n=e.useContext(Z);return n||k(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||k(!1),a.route.id}function pt(t){let{to:n,replace:a,state:i,relative:r}=t;et()||k(!1);let{matches:o}=e.useContext(Z),{pathname:l}=nt(),s=it(),m=F(n,B(o).map((t=>t.pathnameBase)),l,"path"===r),c=JSON.stringify(m);return e.useEffect((()=>s(JSON.parse(c),{replace:a,state:i,relative:r})),[s,c,r,a,i]),null}function ht(t){k(!1)}function _t(t){let{basename:n="/",children:a=null,location:i,navigationType:r=d.Pop,navigator:o,static:l=!1}=t;et()&&k(!1);let s=n.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:s,navigator:o,static:l})),[s,o,l]);"string"==typeof i&&(i=y(i));let{pathname:c="/",search:u="",hash:g="",state:p=null,key:h="default"}=i,_=e.useMemo((()=>{let t=L(c,s);return null==t?null:{location:{pathname:t,search:u,hash:g,state:p,key:h},navigationType:r}}),[s,c,u,g,p,h,r]);return null==_?null:e.createElement(X.Provider,{value:m},e.createElement(Q.Provider,{children:a,value:_}))}function kt(t){let{children:e,location:n}=t;return ot(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&&k(!1),t.props.index&&t.props.children&&k(!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}function Et(){return Et=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},Et.apply(this,arguments)}function vt(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}e.startTransition,new Promise((()=>{})),e.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const bt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],yt=["aria-current","caseSensitive","className","end","style","to","children"],xt=e.startTransition;function wt(t){let{basename:n,children:a,future:i,window:r}=t,o=e.useRef();var l;null==o.current&&(o.current=(void 0===(l={window:r,v5Compat:!0})&&(l={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,o=i.history,l=d.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function u(){l=d.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:p.location,delta:e})}function g(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof t?t:b(t);return k(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,o.replaceState(h({},o.state,{idx:m}),""));let p={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(_,u),s=t,()=>{i.removeEventListener(_,u),s=null}},createHref(t){return e(i,t)},createURL:g,encodeLocation(t){let e=g(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=d.Push;let a=v(p.location,t,e);n&&n(a,t),m=c()+1;let u=E(a,m),g=p.createHref(a);try{o.pushState(u,"",g)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(g)}r&&s&&s({action:l,location:p.location,delta:1})},replace:function(t,e){l=d.Replace;let a=v(p.location,t,e);n&&n(a,t),m=c();let i=E(a,m),u=p.createHref(a);o.replaceState(i,"",u),r&&s&&s({action:l,location:p.location,delta:0})},go(t){return o.go(t)}};return p}((function(t,e){let{pathname:n="/",search:a="",hash:i=""}=y(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),v("",{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:b(e))}),(function(t,e){f("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),l)));let s=o.current,[m,c]=e.useState({action:s.action,location:s.location}),{v7_startTransition:u}=i||{},g=e.useCallback((t=>{u&&xt?xt((()=>c(t))):c(t)}),[c,u]);return e.useLayoutEffect((()=>s.listen(g)),[s,g]),e.createElement(_t,{basename:n,children:a,location:m.location,navigationType:m.action,navigator:s})}const St="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=e.forwardRef((function(t,n){let a,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:u}=t,g=vt(t,bt),{basename:d}=e.useContext(X),p=!1;if("string"==typeof c&&Nt.test(c)&&(a=c,St))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=L(e.pathname,d);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:p=!0}catch(t){}let h=function(t,n){let{relative:a}=void 0===n?{}:n;et()||k(!1);let{basename:i,navigator:r}=e.useContext(X),{hash:o,pathname:l,search:s}=rt(t,{relative:a}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),_=function(t,n){let{target:a,replace:i,state:r,preventScrollReset:o,relative:l}=void 0===n?{}:n,s=it(),m=nt(),c=rt(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:b(m)===b(c);s(t,{replace:n,state:r,preventScrollReset:o,relative:l})}}),[m,s,c,i,r,a,t,o,l])}(c,{replace:l,state:s,target:m,preventScrollReset:u,relative:r});return e.createElement("a",Et({},g,{href:a||h,onClick:p||o?i:function(t){i&&i(t),t.defaultPrevented||_(t)},ref:n,target:m}))})),Tt=e.forwardRef((function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,children:m}=t,c=vt(t,yt),u=rt(s,{relative:c.relative}),g=nt(),d=e.useContext(Y),{navigator:p}=e.useContext(X),h=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=g.pathname,k=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;i||(_=_.toLowerCase(),k=k?k.toLowerCase():null,h=h.toLowerCase());let f,E=_===h||!o&&_.startsWith(h)&&"/"===_.charAt(h.length),v=null!=k&&(k===h||!o&&k.startsWith(h)&&"/"===k.charAt(h.length)),b=E?a:void 0;f="function"==typeof r?r({isActive:E,isPending:v}):[r,E?"active":null,v?"pending":null].filter(Boolean).join(" ");let y="function"==typeof l?l({isActive:E,isPending:v}):l;return e.createElement(Ct,Et({},c,{"aria-current":b,className:f,ref:n,style:y,to:s}),"function"==typeof m?m({isActive:E,isPending:v}):m)}));var Gt,Dt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher"})(Gt||(Gt={})),function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Dt||(Dt={}));var It=({page:t})=>{let n=(0,c.__)("Settings","gtm-kit");switch(t){case"general":n=(0,c.__)("Settings","gtm-kit");break;case"integrations":n=(0,c.__)("Integrations","gtm-kit");break;case"help":n=(0,c.__)("Help","gtm-kit")}return(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"}))),n))))};var Pt=({to:t,title:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Tt,{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)),Ot=({page: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"},function({page:t}){const e=[{to:"general",title:(0,c.__)("Dashboard","gtm-kit")},{to:"container",title:(0,c.__)("Container","gtm-kit")},{to:"post-data",title:(0,c.__)("Post data","gtm-kit")},{to:"user-data",title:(0,c.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,c.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,c.__)("Misc","gtm-kit")}],n=[{to:"integrations",title:(0,c.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],a=[{to:"help",title:(0,c.__)("Help","gtm-kit")},{to:"support",title:(0,c.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return n;case"help":return a}}({page:t}).map((function(t){return(0,e.createElement)(Pt,{key:t.to,to:t.to,title:t.title})})));function Rt(){return Rt=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},Rt.apply(this,arguments)}function Mt(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 Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function At(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ut(t,e)}function Lt(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var jt=window.ReactDOM,Bt=t.n(jt),Ft=n().createContext(null),Ht=function(t){return t.scrollTop},Wt="unmounted",Kt="exited",Jt="entering",zt="entered",$t="exiting",qt=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=Kt,a.appearStatus=Jt):i=zt:i=e.unmountOnExit||e.mountOnEnter?Wt:Kt,a.state={status:i},a.nextCallback=null,a}At(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Wt?{status:Kt}: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!==Jt&&n!==zt&&(e=Jt):n!==Jt&&n!==zt||(e=$t)}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===Jt){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Bt().findDOMNode(this);n&&Ht(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Kt&&this.setState({status:Wt})},a.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[Bt().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:Jt},(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:Bt().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:$t},(function(){t.props.onExiting(a),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:Kt},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:Kt},(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:Bt().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===Wt)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,Mt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n().createElement(Ft.Provider,{value:null},"function"==typeof a?a(t,i):n().cloneElement(n().Children.only(a),i))},e}(n().Component);function Vt(){}qt.contextType=Ft,qt.propTypes={},qt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vt,onEntering:Vt,onEntered:Vt,onExit:Vt,onExiting:Vt,onExited:Vt},qt.UNMOUNTED=Wt,qt.EXITED=Kt,qt.ENTERING=Jt,qt.ENTERED=zt,qt.EXITING=$t;var Yt=qt,Xt=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=Lt(n.className,a):n.setAttribute("class",Lt(n.className&&n.className.baseVal||"",a)));var n,a}))},Qt=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}At(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&&Ht(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&&Xt(t,a),i&&Xt(t,i),r&&Xt(t,r)},a.render=function(){var t=this.props,e=(t.classNames,Mt(t,["classNames"]));return n().createElement(Yt,Rt({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n().Component);Qt.defaultProps={classNames:""},Qt.propTypes={};var Zt=Qt,te=({title:t=(0,c.__)("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:r,useIsPending:o,useCanSave:l}=(0,a.useContext)(g);return(0,e.createElement)(i.Button,{className:n,onClick:()=>r(),variant:"primary",disabled:o||!l},l?(0,c.__)(t,"gtm-kit"):(0,c.__)("Saved","gtm-kit"),o?(0,e.createElement)(i.Spinner,null):"")},ee=()=>{const{useCanSave:t}=(0,a.useContext)(g);return(0,e.createElement)(Zt,{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)(te,null)))},ne=({subject:t})=>{const n=!0===t||"on"===t,a=!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 "+a},n?(0,c.__)("Active","gtm-kit"):(0,c.__)("Inactive","gtm-kit"))};const ae=(0,a.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)));ae.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),ae.Content=({as:t="div",children:n,className:a="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:a},n),ae.Button=({url:t,destination:n,newTab:a=!1,text:r,group:o="",...l})=>{const s=it();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(i.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"},r)))};var ie=ae,re=({title:t,data:n,className:i=""})=>{const{useSettings:r}=(0,a.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] "+i},n.map(((t,n)=>!1===t.featured?null:(0,e.createElement)(ie,{key:n},(0,e.createElement)(ie.Header,{title:t.title},t.pill?(0,e.createElement)(ne,{subject:r[t.group][t.option]}):null),(0,e.createElement)(ie.Content,null,t.text.map(((t,n)=>(0,e.createElement)("p",{key:n},t)))),(0,e.createElement)(ie.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,c.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))};const oe=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,c.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,c.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,c.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,c.__)("Setup integration","gtm-kit")}}],le=[{title:"Getting started with GTM Kit",text:[(0,c.__)("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,c.__)("WooCommerce integration","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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,c.__)("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,c.__)("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 se=()=>{const{useSettings:t}=(0,a.useContext)(g),[n,i]=(0,a.useState)(le),r=Boolean(t.general.sgtm_domain .trim());return(0,a.useEffect)((()=>{i((t=>[...t,{title:(0,c.__)("See all tutorials…","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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)(ie,null,(0,e.createElement)(ie.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ne,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(ie.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,c.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,c.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ne,{subject:r})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ne,{subject:t.general.analytics_active})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/misc",text:(0,c.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(re,{title:(0,c.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe}))},me=({title:t,placeholder:n,help:r,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,a.useContext)(g);return(0,e.createElement)(i.TextControl,{label:t,placeholder:n,help:r,className:o,value:c[l][s],onChange:t=>u(l,s,t),disabled:m})},ce=({title:t,label:n,optionGroup:r="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,a.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(i.BaseControl,{label:t},(0,e.createElement)(i.ToggleControl,{label:n,checked:!l&&s[r][o],onChange:()=>{m(r,o,!(s&&s[r][o]))},disabled:l}))))},ue=({title:t,options:n,help:r,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,a.useContext)(g);return(0,e.createElement)(i.RadioControl,{label:t,options:n,help:r,className:o,selected:parseInt(c[l][s]),onChange:t=>u(l,s,t),disabled:m})};const ge=(0,a.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)));ge.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),ge.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);var de=ge,pe=()=>{const{useSettings:t}=(0,a.useContext)(g),n=!(t.general.sgtm_domain.trim()&&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,c.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager container code","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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)(me,{title:(0,c.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,c.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Inject Container Code","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Just the container","gtm-kit"),label:(0,c.__)("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)(me,{title:(0,c.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(de.Content,null,(0,e.createElement)(me,{title:(0,c.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,c.__)("Enter domain …","gtm-kit"),help:(0,c.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(me,{title:(0,c.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,c.__)("Enter loader name …","gtm-kit"),help:(0,c.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,c.__)("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,c.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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"},(0,c.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,c.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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,c.__)("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,c.__)("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"},(0,c.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Container code implementation:","gtm-kit"),options:[{label:(0,c.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,c.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,c.__)("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,c.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,c.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,c.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,c.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,c.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,c.__)('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(); } ?>")))))},he=()=>(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,c.__)("Post Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Post type","gtm-kit"),id:"post-type",label:(0,c.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ce,{title:(0,c.__)("Page type","gtm-kit"),id:"page-type",label:(0,c.__)('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)(ce,{title:(0,c.__)("Categories","gtm-kit"),id:"categories",label:(0,c.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ce,{title:(0,c.__)("Tags","gtm-kit"),id:"tags",label:(0,c.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ce,{title:(0,c.__)("Post title","gtm-kit"),id:"post-title",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ce,{title:(0,c.__)("Post ID","gtm-kit"),id:"post-id",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ce,{title:(0,c.__)("Post data","gtm-kit"),id:"post-date",label:(0,c.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,c.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,c.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),_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,c.__)("User Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,c.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ce,{title:(0,c.__)("User ID","gtm-kit"),id:"user-id",label:(0,c.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ce,{title:(0,c.__)("User role","gtm-kit"),id:"user-role",label:(0,c.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),ke=()=>{const{useSettings:t}=(0,a.useContext)(g),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,c.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,c.__)("Warning!","gtm-kit"))),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("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,c.__)("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,c.__)("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,c.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ce,{title:(0,c.__)("Activate GCM settings","gtm-kit"),label:(0,c.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Ad Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Analytics Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Functionality Storage","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Personalization Storage","gtm-kit"),label:(0,c.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Security Storage","gtm-kit"),label:(0,c.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:n}))))},fe=({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))),Ee=()=>{const{useSiteData:t}=(0,a.useContext)(g),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,c.__)("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,c.__)("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)(fe,{key:n,label:t.label,value:t.value,tag:t.tag})})))))},ve=()=>{const{}=(0,a.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,c.__)("Misc","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(Ee,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,c.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Share anonymous data","gtm-kit"),label:(0,c.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Console log","gtm-kit"),label:(0,c.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},be=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe})),ye=({pluginName:t})=>(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,c.sprintf)((0,c.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(i.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,c.sprintf)((0,c.__)("Install %s","gtm-kit"),t)))),xe=({title:t,options:n,className:r="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:o="general",optionName:l,disabled:s=!1,help:m="",notSet:u=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,a.useContext)(g),h=u?[{label:(0,c.__)("(not set)","gtm-kit"),value:""},...n]:n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(i.SelectControl,{label:t,value:d&&d[o][l],options:h,className:r,onChange:t=>p(o,l,t),disabled:s,help:m}))},we=({pluginName:t,optionName:n,pluginInactive:a})=>(0,e.createElement)(de,{disabled:a},(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.sprintf)((0,c.__)("Track %s","gtm-kit"),t),label:(0,c.sprintf)((0,c.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:n,disabled:a})));const Se=[{label:(0,c.__)("Retail","gtm-kit"),value:"retail"},{label:(0,c.__)("Education","gtm-kit"),value:"education"},{label:(0,c.__)("Flights","gtm-kit"),value:"flights"},{label:(0,c.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,c.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,c.__)("Local deals","gtm-kit"),value:"local"},{label:(0,c.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,c.__)("Travel","gtm-kit"),value:"travel"},{label:(0,c.__)("Custom","gtm-kit"),value:"custom"}];var Ne=()=>{const{useSettings:t}=(0,a.useContext)(g),n="WooCommerce",i=!window.gtmkitSettings.plugins.woocommerce,r=i||!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,c.__)("WooCommerce","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"woocommerce_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,c.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude shipping from revenue","gtm-kit"),label:(0,c.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Event customization","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:"view_item_list (with product filter)",options:[{label:(0,c.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,c.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,c.__)("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:r}),(0,e.createElement)(ue,{title:"view_item",options:[{label:(0,c.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,c.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,c.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,c.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:r}),(0,e.createElement)(ue,{title:"add_shipping_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:r}),(0,e.createElement)(ue,{title:"add_payment_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include permalink structure","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include path of pages","gtm-kit"),label:(0,c.__)("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:r}))))},Ce=()=>{const{useSettings:t}=(0,a.useContext)(g),n="Contact Form 7",i=!window.gtmkitSettings.plugins.cf7,r=i||!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,c.__)("Contact Form 7","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"cf7_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Load JavaScript","gtm-kit"),options:[{label:(0,c.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,c.__)("On all pages","gtm-kit"),value:2}],help:(0,c.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:r}))))},Te=()=>{const t="Easy Digital Downloads",n=!window.gtmkitSettings.plugins.edd,{useSettings:i}=(0,a.useContext)(g),r=n||!i.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,c.__)("Easy Digital Downloads","gtm-kit")),n?(0,e.createElement)(ye,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:n}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}))))},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,c.__)("Help","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,c.__)("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,c.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,c.__)("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,c.__)("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,c.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Tutorials","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("ul",null,le.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)))))))))),De=()=>{const{useSiteData:t}=(0,a.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,c.__)("Get support","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Support options","gtm-kit")}),(0,e.createElement)(de.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,c.__)("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,c.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,c.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("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,c.__)("Version:","gtm-kit")," ",t.gtmkit_version,")")),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",null,(0,c.__)("You can see the changes of all versions in:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,c.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,c.__)("The Github repository","gtm-kit"))))))};const Ie=()=>{const{useSettings:t}=(0,a.useContext)(g),n=window.gtmkitSettings.currentPage;return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,{page:n}),(0,e.createElement)(Ot,{page:n}),(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)(se,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(pe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(ve,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ne,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(Te,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)(De,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+n})}))),(0,e.createElement)(ee,null)):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(i.Spinner,null)))},Pe=()=>(0,e.createElement)(wt,{basename:"/"},(0,e.createElement)(p,null,(0,e.createElement)(Ie,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Pe,null),document.getElementById(window.gtmkitSettings.rootId))}))}();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.element,i=window.wp.components,r=window.lodash,o=window.wp.apiFetch,l=t.n(o);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const s=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-options",method:"GET"})}catch(t){return console.log("fetchSettings Errors:",t),{gtm_kit_settings_fetch_settings_errors:!0}}return!0===t.success?t.data:t},m=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-site-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t};var c=window.wp.i18n,u=(t,e)=>{const n=Object.assign({},t);switch(e.type){case"FETCH_SETTINGS":n.fetchedSettings=e.payload.fetchedSettings,n.stateSettings=e.payload.stateSettings,n.siteData=e.payload.siteData,n.installData=e.payload.installData,n.isPending=!1,n.canSave=!1,void 0===e.payload.fetchedSettings.integrations&&(n.fetchedSettings.integrations={}),void 0!==e.payload.fetchedSettings.gtm_kit_settings_fetch_settings_errors&&(n.notice=(0,c.__)("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;let t=!1,a=(0,c.__)("Saved Successfully.","gtm-kit"),i=!1;void 0!==e.payload.fetchedSettings.gtm_kit_settings_update_settings_errors&&(t=!0,a=(0,c.__)("An error occurred.","gtm-kit"),i=!0),n.canSave=t,n.notice=a,n.hasError=i;break;case"UPDATE_STATE":e.payload.fetchedSettings&&(n.fetchedSettings=e.payload.fetchedSettings),e.payload.stateSettings&&(n.stateSettings=e.payload.stateSettings),void 0!==e.payload.isPending&&(n.isPending=e.payload.isPending),void 0!==e.payload.notice&&(n.notice=e.payload.notice),void 0!==e.payload.hasError&&(n.hasError=e.payload.hasError),void 0!==e.payload.canSave&&(n.canSave=e.payload.canSave)}return n};const g=(0,a.createContext)();var d,p=t=>{const[n,i]=(0,a.useReducer)(u,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:"",canSave:!1}),o=async()=>{const[t,e]=await Promise.all([s(),m()]),n="wizard"===window.gtmkitSettings.currentPage?await(async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-install-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t})():{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:n}})},c=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{o()}),[]);const d={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(async t=>{let e={};try{e=await l()({path:"gtmkit/v1/set-options",method:"POST",data:t})}catch(t){return console.log("updateSettings Errors:",t),{gtm_kit_settings_update_settings_errors:!0}}return!0===e.success?e.data:e})(n.stateSettings);i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:o,useUpdateState:c,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let o;i[t][e]=a,o=!(0,r.isEqual)(i,n.fetchedSettings),c({stateSettings:i,canSave:o})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const o={};o.general={...a.general,...e.general},"integrations"in e&&(o.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(o,n.fetchedSettings),c({stateSettings:o,canSave:i})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData};return(0,e.createElement)(g.Provider,{value:d},t.children)};function h(){return h=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},h.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(d||(d={}));const _="popstate";function k(t,e){if(!1===t||null==t)throw new Error(e)}function f(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function E(t,e){return{usr:t.state,key:t.key,idx:e}}function v(t,e,n,a){return void 0===n&&(n=null),h({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:n,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function b(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 y(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 x;function w(t,e,n){void 0===n&&(n="/");let a=L(("string"==typeof e?y(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=M(i[t],A(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("/")&&(k(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&&(k(!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:R(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 N(t.path))i(t,e,n);else i(t,e)})),e}function N(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=N(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"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const C=/^:\w+$/,T=3,G=2,D=1,I=10,P=-2,O=t=>"*"===t;function R(t,e){let n=t.split("/"),a=n.length;return n.some(O)&&(a+=P),e&&(a+=G),n.filter((t=>!O(t))).reduce(((t,e)=>t+(C.test(e)?T:""===e?D:I)),a)}function M(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=U({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:W(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function U(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),f("*"===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)=>(a.push(e),"/([^\\/]+)")));return t.endsWith("*")?(a.push("*"),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)=>{if("*"===e){let t=l[n]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}return t[e]=function(t,e){try{return decodeURIComponent(t)}catch(n){return f(!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}}(l[n]||"",e),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return f(!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 L(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 j(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 B(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}function F(t,e,n,a){let i;void 0===a&&(a=!1),"string"==typeof t?i=y(t):(i=h({},t),k(!i.pathname||!i.pathname.includes("?"),j("?","pathname","search",i)),k(!i.pathname||!i.pathname.includes("#"),j("#","pathname","hash",i)),k(!i.search||!i.search.includes("#"),j("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(a||null==l)r=n;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?y(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:K(a),hash:J(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,"/"),W=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),K=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",J=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const z=["post","put","patch","delete"],$=(new Set(z),["get",...z]);function q(){return q=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},q.apply(this,arguments)}new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext(null),Z=e.createContext({outlet:null,matches:[],isDataRoute:!1}),tt=e.createContext(null);function et(){return null!=e.useContext(Q)}function nt(){return et()||k(!1),e.useContext(Q).location}function at(t){e.useContext(X).static||e.useLayoutEffect(t)}function it(){let{isDataRoute:t}=e.useContext(Z);return t?function(){let{router:t}=function(t){let n=e.useContext(V);return n||k(!1),n}(ut.UseNavigateStable),n=dt(gt.UseNavigateStable),a=e.useRef(!1);return at((()=>{a.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,q({fromRouteId:n},i)))}),[t,n])}():function(){et()||k(!1);let t=e.useContext(V),{basename:n,navigator:a}=e.useContext(X),{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase))),l=e.useRef(!1);return at((()=>{l.current=!0})),e.useCallback((function(e,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof e)return void a.go(e);let s=F(e,JSON.parse(o),r,"path"===i.relative);null==t&&"/"!==n&&(s.pathname="/"===s.pathname?n:H([n,s.pathname])),(i.replace?a.replace:a.push)(s,i.state,i)}),[n,a,o,r,t])}()}function rt(t,n){let{relative:a}=void 0===n?{}:n,{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase)));return e.useMemo((()=>F(t,JSON.parse(o),r,"path"===a)),[t,o,r,a])}function ot(t,n,a){et()||k(!1);let{navigator:i}=e.useContext(X),{matches:r}=e.useContext(Z),o=r[r.length-1],l=o?o.params:{},s=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let m,c=nt();if(n){var u;let t="string"==typeof n?y(n):n;"/"===s||(null==(u=t.pathname)?void 0:u.startsWith(s))||k(!1),m=t}else m=c;let g=m.pathname||"/",p=w(t,{pathname:"/"===s?g:g.slice(s.length)||"/"}),h=function(t,n,a){var i;if(void 0===n&&(n=[]),void 0===a&&(a=null),null==t){var r;if(null==(r=a)||!r.errors)return null;t=a.matches}let o=t,l=null==(i=a)?void 0:i.errors;if(null!=l){let t=o.findIndex((t=>t.route.id&&(null==l?void 0:l[t.route.id])));t>=0||k(!1),o=o.slice(0,Math.min(o.length,t+1))}return o.reduceRight(((t,i,r)=>{let s=i.route.id?null==l?void 0:l[i.route.id]:null,m=null;a&&(m=i.route.errorElement||st);let c=n.concat(o.slice(0,r+1)),u=()=>{let n;return n=s?m:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(ct,{match:i,routeContext:{outlet:t,matches:c,isDataRoute:null!=a},children:n})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(mt,{location:a.location,revalidation:a.revalidation,component:m,error:s,children:u(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):u()}),null)}(p&&p.map((t=>Object.assign({},t,{params:Object.assign({},l,t.params),pathname:H([s,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?s:H([s,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),r,a);return n&&h?e.createElement(Q.Provider,{value:{location:q({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:d.Pop}},h):h}function lt(){let t=function(){var t;let n=e.useContext(tt),a=function(t){let n=e.useContext(Y);return n||k(!1),n}(gt.UseRouteError),i=dt(gt.UseRouteError);return 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 st=e.createElement(lt,null);class mt 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: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 this.state.error?e.createElement(Z.Provider,{value:this.props.routeContext},e.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:n,match:a,children:i}=t,r=e.useContext(V);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),e.createElement(Z.Provider,{value:n},i)}var ut=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ut||{}),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 dt(t){let n=function(t){let n=e.useContext(Z);return n||k(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||k(!1),a.route.id}function pt(t){let{to:n,replace:a,state:i,relative:r}=t;et()||k(!1);let{matches:o}=e.useContext(Z),{pathname:l}=nt(),s=it(),m=F(n,B(o).map((t=>t.pathnameBase)),l,"path"===r),c=JSON.stringify(m);return e.useEffect((()=>s(JSON.parse(c),{replace:a,state:i,relative:r})),[s,c,r,a,i]),null}function ht(t){k(!1)}function _t(t){let{basename:n="/",children:a=null,location:i,navigationType:r=d.Pop,navigator:o,static:l=!1}=t;et()&&k(!1);let s=n.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:s,navigator:o,static:l})),[s,o,l]);"string"==typeof i&&(i=y(i));let{pathname:c="/",search:u="",hash:g="",state:p=null,key:h="default"}=i,_=e.useMemo((()=>{let t=L(c,s);return null==t?null:{location:{pathname:t,search:u,hash:g,state:p,key:h},navigationType:r}}),[s,c,u,g,p,h,r]);return null==_?null:e.createElement(X.Provider,{value:m},e.createElement(Q.Provider,{children:a,value:_}))}function kt(t){let{children:e,location:n}=t;return ot(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&&k(!1),t.props.index&&t.props.children&&k(!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}function Et(){return Et=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},Et.apply(this,arguments)}function vt(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}e.startTransition,new Promise((()=>{})),e.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const bt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],yt=["aria-current","caseSensitive","className","end","style","to","children"],xt=e.startTransition;function wt(t){let{basename:n,children:a,future:i,window:r}=t,o=e.useRef();var l;null==o.current&&(o.current=(void 0===(l={window:r,v5Compat:!0})&&(l={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,o=i.history,l=d.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function u(){l=d.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:p.location,delta:e})}function g(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof t?t:b(t);return k(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,o.replaceState(h({},o.state,{idx:m}),""));let p={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(_,u),s=t,()=>{i.removeEventListener(_,u),s=null}},createHref(t){return e(i,t)},createURL:g,encodeLocation(t){let e=g(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=d.Push;let a=v(p.location,t,e);n&&n(a,t),m=c()+1;let u=E(a,m),g=p.createHref(a);try{o.pushState(u,"",g)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(g)}r&&s&&s({action:l,location:p.location,delta:1})},replace:function(t,e){l=d.Replace;let a=v(p.location,t,e);n&&n(a,t),m=c();let i=E(a,m),u=p.createHref(a);o.replaceState(i,"",u),r&&s&&s({action:l,location:p.location,delta:0})},go(t){return o.go(t)}};return p}((function(t,e){let{pathname:n="/",search:a="",hash:i=""}=y(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),v("",{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:b(e))}),(function(t,e){f("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),l)));let s=o.current,[m,c]=e.useState({action:s.action,location:s.location}),{v7_startTransition:u}=i||{},g=e.useCallback((t=>{u&&xt?xt((()=>c(t))):c(t)}),[c,u]);return e.useLayoutEffect((()=>s.listen(g)),[s,g]),e.createElement(_t,{basename:n,children:a,location:m.location,navigationType:m.action,navigator:s})}const St="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=e.forwardRef((function(t,n){let a,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:u}=t,g=vt(t,bt),{basename:d}=e.useContext(X),p=!1;if("string"==typeof c&&Nt.test(c)&&(a=c,St))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=L(e.pathname,d);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:p=!0}catch(t){}let h=function(t,n){let{relative:a}=void 0===n?{}:n;et()||k(!1);let{basename:i,navigator:r}=e.useContext(X),{hash:o,pathname:l,search:s}=rt(t,{relative:a}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),_=function(t,n){let{target:a,replace:i,state:r,preventScrollReset:o,relative:l}=void 0===n?{}:n,s=it(),m=nt(),c=rt(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:b(m)===b(c);s(t,{replace:n,state:r,preventScrollReset:o,relative:l})}}),[m,s,c,i,r,a,t,o,l])}(c,{replace:l,state:s,target:m,preventScrollReset:u,relative:r});return e.createElement("a",Et({},g,{href:a||h,onClick:p||o?i:function(t){i&&i(t),t.defaultPrevented||_(t)},ref:n,target:m}))})),Tt=e.forwardRef((function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,children:m}=t,c=vt(t,yt),u=rt(s,{relative:c.relative}),g=nt(),d=e.useContext(Y),{navigator:p}=e.useContext(X),h=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=g.pathname,k=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;i||(_=_.toLowerCase(),k=k?k.toLowerCase():null,h=h.toLowerCase());let f,E=_===h||!o&&_.startsWith(h)&&"/"===_.charAt(h.length),v=null!=k&&(k===h||!o&&k.startsWith(h)&&"/"===k.charAt(h.length)),b=E?a:void 0;f="function"==typeof r?r({isActive:E,isPending:v}):[r,E?"active":null,v?"pending":null].filter(Boolean).join(" ");let y="function"==typeof l?l({isActive:E,isPending:v}):l;return e.createElement(Ct,Et({},c,{"aria-current":b,className:f,ref:n,style:y,to:s}),"function"==typeof m?m({isActive:E,isPending:v}):m)}));var Gt,Dt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher"})(Gt||(Gt={})),function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Dt||(Dt={}));var It=({page:t})=>{let n=(0,c.__)("Settings","gtm-kit");switch(t){case"general":n=(0,c.__)("Settings","gtm-kit");break;case"integrations":n=(0,c.__)("Integrations","gtm-kit");break;case"help":n=(0,c.__)("Help","gtm-kit")}return(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"}))),n))))};var Pt=({to:t,title:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Tt,{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)),Ot=({page: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"},function({page:t}){const e=[{to:"general",title:(0,c.__)("Dashboard","gtm-kit")},{to:"container",title:(0,c.__)("Container","gtm-kit")},{to:"post-data",title:(0,c.__)("Post data","gtm-kit")},{to:"user-data",title:(0,c.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,c.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,c.__)("Misc","gtm-kit")}],n=[{to:"integrations",title:(0,c.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],a=[{to:"help",title:(0,c.__)("Help","gtm-kit")},{to:"support",title:(0,c.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return n;case"help":return a}}({page:t}).map((function(t){return(0,e.createElement)(Pt,{key:t.to,to:t.to,title:t.title})})));function Rt(){return Rt=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},Rt.apply(this,arguments)}function Mt(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 Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function At(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ut(t,e)}function Lt(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var jt=window.ReactDOM,Bt=t.n(jt),Ft=n().createContext(null),Ht=function(t){return t.scrollTop},Wt="unmounted",Kt="exited",Jt="entering",zt="entered",$t="exiting",qt=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=Kt,a.appearStatus=Jt):i=zt:i=e.unmountOnExit||e.mountOnEnter?Wt:Kt,a.state={status:i},a.nextCallback=null,a}At(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Wt?{status:Kt}: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!==Jt&&n!==zt&&(e=Jt):n!==Jt&&n!==zt||(e=$t)}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===Jt){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Bt().findDOMNode(this);n&&Ht(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Kt&&this.setState({status:Wt})},a.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[Bt().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:Jt},(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:Bt().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:$t},(function(){t.props.onExiting(a),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:Kt},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:Kt},(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:Bt().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===Wt)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,Mt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n().createElement(Ft.Provider,{value:null},"function"==typeof a?a(t,i):n().cloneElement(n().Children.only(a),i))},e}(n().Component);function Vt(){}qt.contextType=Ft,qt.propTypes={},qt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vt,onEntering:Vt,onEntered:Vt,onExit:Vt,onExiting:Vt,onExited:Vt},qt.UNMOUNTED=Wt,qt.EXITED=Kt,qt.ENTERING=Jt,qt.ENTERED=zt,qt.EXITING=$t;var Yt=qt,Xt=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=Lt(n.className,a):n.setAttribute("class",Lt(n.className&&n.className.baseVal||"",a)));var n,a}))},Qt=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}At(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&&Ht(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&&Xt(t,a),i&&Xt(t,i),r&&Xt(t,r)},a.render=function(){var t=this.props,e=(t.classNames,Mt(t,["classNames"]));return n().createElement(Yt,Rt({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n().Component);Qt.defaultProps={classNames:""},Qt.propTypes={};var Zt=Qt,te=({title:t=(0,c.__)("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:r,useIsPending:o,useCanSave:l}=(0,a.useContext)(g);return(0,e.createElement)(i.Button,{className:n,onClick:()=>r(),variant:"primary",disabled:o||!l},l?(0,c.__)(t,"gtm-kit"):(0,c.__)("Saved","gtm-kit"),o?(0,e.createElement)(i.Spinner,null):"")},ee=()=>{const{useCanSave:t}=(0,a.useContext)(g);return(0,e.createElement)(Zt,{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)(te,null)))},ne=({subject:t})=>{const n=!0===t||"on"===t,a=!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 "+a},n?(0,c.__)("Active","gtm-kit"):(0,c.__)("Inactive","gtm-kit"))};const ae=(0,a.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)));ae.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),ae.Content=({as:t="div",children:n,className:a="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:a},n),ae.Button=({url:t,destination:n,newTab:a=!1,text:r,group:o="",...l})=>{const s=it();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(i.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"},r)))};var ie=ae,re=({title:t,data:n,className:i=""})=>{const{useSettings:r}=(0,a.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] "+i},n.map(((t,n)=>!1===t.featured?null:(0,e.createElement)(ie,{key:n},(0,e.createElement)(ie.Header,{title:t.title},t.pill?(0,e.createElement)(ne,{subject:r[t.group][t.option]}):null),(0,e.createElement)(ie.Content,null,t.text.map(((t,n)=>(0,e.createElement)("p",{key:n},t)))),(0,e.createElement)(ie.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,c.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))};const oe=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,c.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,c.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,c.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,c.__)("Setup integration","gtm-kit")}}],le=[{title:"Getting started with GTM Kit",text:[(0,c.__)("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,c.__)("WooCommerce integration","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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,c.__)("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,c.__)("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 se=()=>{const{useSettings:t}=(0,a.useContext)(g),[n,i]=(0,a.useState)(le),r=Boolean(t.general.sgtm_domain&&t.general.sgtm_domain.trim());return(0,a.useEffect)((()=>{i((t=>[...t,{title:(0,c.__)("See all tutorials…","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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)(ie,null,(0,e.createElement)(ie.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ne,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(ie.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,c.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,c.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ne,{subject:r})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ne,{subject:t.general.analytics_active})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/misc",text:(0,c.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(re,{title:(0,c.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe}))},me=({title:t,placeholder:n,help:r,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,a.useContext)(g);return(0,e.createElement)(i.TextControl,{label:t,placeholder:n,help:r,className:o,value:c[l][s],onChange:t=>u(l,s,t),disabled:m})},ce=({title:t,label:n,optionGroup:r="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,a.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(i.BaseControl,{label:t},(0,e.createElement)(i.ToggleControl,{label:n,checked:!l&&s[r][o],onChange:()=>{m(r,o,!(s&&s[r][o]))},disabled:l}))))},ue=({title:t,options:n,help:r,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,a.useContext)(g);return(0,e.createElement)(i.RadioControl,{label:t,options:n,help:r,className:o,selected:parseInt(c[l][s]),onChange:t=>u(l,s,t),disabled:m})};const ge=(0,a.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)));ge.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),ge.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);var de=ge,pe=()=>{const{useSettings:t}=(0,a.useContext)(g),n=!(t.general.sgtm_domain.trim()&&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,c.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager container code","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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)(me,{title:(0,c.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,c.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Inject Container Code","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Just the container","gtm-kit"),label:(0,c.__)("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)(me,{title:(0,c.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(de.Content,null,(0,e.createElement)(me,{title:(0,c.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,c.__)("Enter domain …","gtm-kit"),help:(0,c.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(me,{title:(0,c.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,c.__)("Enter loader name …","gtm-kit"),help:(0,c.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,c.__)("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,c.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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"},(0,c.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,c.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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,c.__)("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,c.__)("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"},(0,c.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Container code implementation:","gtm-kit"),options:[{label:(0,c.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,c.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,c.__)("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,c.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,c.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,c.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,c.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,c.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,c.__)('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(); } ?>")))))},he=()=>(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,c.__)("Post Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Post type","gtm-kit"),id:"post-type",label:(0,c.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ce,{title:(0,c.__)("Page type","gtm-kit"),id:"page-type",label:(0,c.__)('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)(ce,{title:(0,c.__)("Categories","gtm-kit"),id:"categories",label:(0,c.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ce,{title:(0,c.__)("Tags","gtm-kit"),id:"tags",label:(0,c.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ce,{title:(0,c.__)("Post title","gtm-kit"),id:"post-title",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ce,{title:(0,c.__)("Post ID","gtm-kit"),id:"post-id",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ce,{title:(0,c.__)("Post data","gtm-kit"),id:"post-date",label:(0,c.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,c.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,c.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),_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,c.__)("User Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,c.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ce,{title:(0,c.__)("User ID","gtm-kit"),id:"user-id",label:(0,c.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ce,{title:(0,c.__)("User role","gtm-kit"),id:"user-role",label:(0,c.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),ke=()=>{const{useSettings:t}=(0,a.useContext)(g),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,c.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,c.__)("Warning!","gtm-kit"))),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("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,c.__)("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,c.__)("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,c.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ce,{title:(0,c.__)("Activate GCM settings","gtm-kit"),label:(0,c.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Ad Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Analytics Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Functionality Storage","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Personalization Storage","gtm-kit"),label:(0,c.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Security Storage","gtm-kit"),label:(0,c.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:n}))))},fe=({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))),Ee=()=>{const{useSiteData:t}=(0,a.useContext)(g),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,c.__)("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,c.__)("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)(fe,{key:n,label:t.label,value:t.value,tag:t.tag})})))))},ve=()=>{const{}=(0,a.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,c.__)("Misc","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(Ee,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,c.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Share anonymous data","gtm-kit"),label:(0,c.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Console log","gtm-kit"),label:(0,c.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},be=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe})),ye=({pluginName:t})=>(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,c.sprintf)((0,c.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(i.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,c.sprintf)((0,c.__)("Install %s","gtm-kit"),t)))),xe=({title:t,options:n,className:r="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:o="general",optionName:l,disabled:s=!1,help:m="",notSet:u=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,a.useContext)(g),h=u?[{label:(0,c.__)("(not set)","gtm-kit"),value:""},...n]:n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(i.SelectControl,{label:t,value:d&&d[o][l],options:h,className:r,onChange:t=>p(o,l,t),disabled:s,help:m}))},we=({pluginName:t,optionName:n,pluginInactive:a})=>(0,e.createElement)(de,{disabled:a},(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.sprintf)((0,c.__)("Track %s","gtm-kit"),t),label:(0,c.sprintf)((0,c.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:n,disabled:a})));const Se=[{label:(0,c.__)("Retail","gtm-kit"),value:"retail"},{label:(0,c.__)("Education","gtm-kit"),value:"education"},{label:(0,c.__)("Flights","gtm-kit"),value:"flights"},{label:(0,c.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,c.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,c.__)("Local deals","gtm-kit"),value:"local"},{label:(0,c.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,c.__)("Travel","gtm-kit"),value:"travel"},{label:(0,c.__)("Custom","gtm-kit"),value:"custom"}];var Ne=()=>{const{useSettings:t}=(0,a.useContext)(g),n="WooCommerce",i=!window.gtmkitSettings.plugins.woocommerce,r=i||!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,c.__)("WooCommerce","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"woocommerce_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,c.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude shipping from revenue","gtm-kit"),label:(0,c.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Event customization","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:"view_item_list (with product filter)",options:[{label:(0,c.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,c.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,c.__)("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:r}),(0,e.createElement)(ue,{title:"view_item",options:[{label:(0,c.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,c.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,c.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,c.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:r}),(0,e.createElement)(ue,{title:"add_shipping_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:r}),(0,e.createElement)(ue,{title:"add_payment_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include permalink structure","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include path of pages","gtm-kit"),label:(0,c.__)("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:r}))))},Ce=()=>{const{useSettings:t}=(0,a.useContext)(g),n="Contact Form 7",i=!window.gtmkitSettings.plugins.cf7,r=i||!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,c.__)("Contact Form 7","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"cf7_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Load JavaScript","gtm-kit"),options:[{label:(0,c.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,c.__)("On all pages","gtm-kit"),value:2}],help:(0,c.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:r}))))},Te=()=>{const t="Easy Digital Downloads",n=!window.gtmkitSettings.plugins.edd,{useSettings:i}=(0,a.useContext)(g),r=n||!i.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,c.__)("Easy Digital Downloads","gtm-kit")),n?(0,e.createElement)(ye,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:n}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}))))},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,c.__)("Help","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,c.__)("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,c.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,c.__)("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,c.__)("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,c.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Tutorials","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("ul",null,le.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)))))))))),De=()=>{const{useSiteData:t}=(0,a.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,c.__)("Get support","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Support options","gtm-kit")}),(0,e.createElement)(de.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,c.__)("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,c.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,c.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("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,c.__)("Version:","gtm-kit")," ",t.gtmkit_version,")")),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",null,(0,c.__)("You can see the changes of all versions in:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,c.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,c.__)("The Github repository","gtm-kit"))))))};const Ie=()=>{const{useSettings:t}=(0,a.useContext)(g),n=window.gtmkitSettings.currentPage;return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,{page:n}),(0,e.createElement)(Ot,{page:n}),(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)(se,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(pe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(ve,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ne,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(Te,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)(De,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+n})}))),(0,e.createElement)(ee,null)):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(i.Spinner,null)))},Pe=()=>(0,e.createElement)(wt,{basename:"/"},(0,e.createElement)(p,null,(0,e.createElement)(Ie,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Pe,null),document.getElementById(window.gtmkitSettings.rootId))}))}(); -
gtm-kit/tags/1.16.1/gtm-kit.php
r2996198 r2996217 4 4 * 5 5 * Plugin Name: GTM Kit 6 * Version: 1.16 6 * Version: 1.16.1 7 7 * Plugin URI: https://gtmkit.com/ 8 8 * Description: Google Tag Manager implementation focusing on flexibility and pagespeed. … … 28 28 } 29 29 30 const GTMKIT_VERSION = '1.16 ';30 const GTMKIT_VERSION = '1.16.1'; 31 31 32 32 if ( ! defined( 'GTMKIT_FILE' ) ) { -
gtm-kit/tags/1.16.1/readme.txt
r2996198 r2996217 4 4 Tags: google tag manager, gtm, woocommerce, analytics, ga4, gtag, easy digital downloads 5 5 Tested up to: 6.4 6 Stable tag: 1.16 6 Stable tag: 1.16.1 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 89 89 == Changelog == 90 90 91 = 1.16.1 = 92 93 Release date: 2023-11-15 94 95 #### Bugfixes: 96 97 * Fix critical JS bug. 98 99 91 100 = 1.16 = 92 101 -
gtm-kit/trunk/assets/admin/settings.asset.php
r2996198 r2996217 1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '1 689401046804ff129b1');1 <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '144bdea183542adb3387'); -
gtm-kit/trunk/assets/admin/settings.js
r2996198 r2996217 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.element,i=window.wp.components,r=window.lodash,o=window.wp.apiFetch,l=t.n(o);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const s=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-options",method:"GET"})}catch(t){return console.log("fetchSettings Errors:",t),{gtm_kit_settings_fetch_settings_errors:!0}}return!0===t.success?t.data:t},m=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-site-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t};var c=window.wp.i18n,u=(t,e)=>{const n=Object.assign({},t);switch(e.type){case"FETCH_SETTINGS":n.fetchedSettings=e.payload.fetchedSettings,n.stateSettings=e.payload.stateSettings,n.siteData=e.payload.siteData,n.installData=e.payload.installData,n.isPending=!1,n.canSave=!1,void 0===e.payload.fetchedSettings.integrations&&(n.fetchedSettings.integrations={}),void 0!==e.payload.fetchedSettings.gtm_kit_settings_fetch_settings_errors&&(n.notice=(0,c.__)("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;let t=!1,a=(0,c.__)("Saved Successfully.","gtm-kit"),i=!1;void 0!==e.payload.fetchedSettings.gtm_kit_settings_update_settings_errors&&(t=!0,a=(0,c.__)("An error occurred.","gtm-kit"),i=!0),n.canSave=t,n.notice=a,n.hasError=i;break;case"UPDATE_STATE":e.payload.fetchedSettings&&(n.fetchedSettings=e.payload.fetchedSettings),e.payload.stateSettings&&(n.stateSettings=e.payload.stateSettings),void 0!==e.payload.isPending&&(n.isPending=e.payload.isPending),void 0!==e.payload.notice&&(n.notice=e.payload.notice),void 0!==e.payload.hasError&&(n.hasError=e.payload.hasError),void 0!==e.payload.canSave&&(n.canSave=e.payload.canSave)}return n};const g=(0,a.createContext)();var d,p=t=>{const[n,i]=(0,a.useReducer)(u,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:"",canSave:!1}),o=async()=>{const[t,e]=await Promise.all([s(),m()]),n="wizard"===window.gtmkitSettings.currentPage?await(async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-install-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t})():{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:n}})},c=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{o()}),[]);const d={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(async t=>{let e={};try{e=await l()({path:"gtmkit/v1/set-options",method:"POST",data:t})}catch(t){return console.log("updateSettings Errors:",t),{gtm_kit_settings_update_settings_errors:!0}}return!0===e.success?e.data:e})(n.stateSettings);i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:o,useUpdateState:c,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let o;i[t][e]=a,o=!(0,r.isEqual)(i,n.fetchedSettings),c({stateSettings:i,canSave:o})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const o={};o.general={...a.general,...e.general},"integrations"in e&&(o.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(o,n.fetchedSettings),c({stateSettings:o,canSave:i})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData};return(0,e.createElement)(g.Provider,{value:d},t.children)};function h(){return h=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},h.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(d||(d={}));const _="popstate";function k(t,e){if(!1===t||null==t)throw new Error(e)}function f(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function E(t,e){return{usr:t.state,key:t.key,idx:e}}function v(t,e,n,a){return void 0===n&&(n=null),h({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:n,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function b(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 y(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 x;function w(t,e,n){void 0===n&&(n="/");let a=L(("string"==typeof e?y(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=M(i[t],A(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("/")&&(k(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&&(k(!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:R(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 N(t.path))i(t,e,n);else i(t,e)})),e}function N(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=N(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"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const C=/^:\w+$/,T=3,G=2,D=1,I=10,P=-2,O=t=>"*"===t;function R(t,e){let n=t.split("/"),a=n.length;return n.some(O)&&(a+=P),e&&(a+=G),n.filter((t=>!O(t))).reduce(((t,e)=>t+(C.test(e)?T:""===e?D:I)),a)}function M(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=U({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:W(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function U(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),f("*"===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)=>(a.push(e),"/([^\\/]+)")));return t.endsWith("*")?(a.push("*"),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)=>{if("*"===e){let t=l[n]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}return t[e]=function(t,e){try{return decodeURIComponent(t)}catch(n){return f(!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}}(l[n]||"",e),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return f(!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 L(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 j(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 B(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}function F(t,e,n,a){let i;void 0===a&&(a=!1),"string"==typeof t?i=y(t):(i=h({},t),k(!i.pathname||!i.pathname.includes("?"),j("?","pathname","search",i)),k(!i.pathname||!i.pathname.includes("#"),j("#","pathname","hash",i)),k(!i.search||!i.search.includes("#"),j("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(a||null==l)r=n;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?y(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:K(a),hash:J(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,"/"),W=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),K=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",J=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const z=["post","put","patch","delete"],$=(new Set(z),["get",...z]);function q(){return q=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},q.apply(this,arguments)}new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext(null),Z=e.createContext({outlet:null,matches:[],isDataRoute:!1}),tt=e.createContext(null);function et(){return null!=e.useContext(Q)}function nt(){return et()||k(!1),e.useContext(Q).location}function at(t){e.useContext(X).static||e.useLayoutEffect(t)}function it(){let{isDataRoute:t}=e.useContext(Z);return t?function(){let{router:t}=function(t){let n=e.useContext(V);return n||k(!1),n}(ut.UseNavigateStable),n=dt(gt.UseNavigateStable),a=e.useRef(!1);return at((()=>{a.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,q({fromRouteId:n},i)))}),[t,n])}():function(){et()||k(!1);let t=e.useContext(V),{basename:n,navigator:a}=e.useContext(X),{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase))),l=e.useRef(!1);return at((()=>{l.current=!0})),e.useCallback((function(e,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof e)return void a.go(e);let s=F(e,JSON.parse(o),r,"path"===i.relative);null==t&&"/"!==n&&(s.pathname="/"===s.pathname?n:H([n,s.pathname])),(i.replace?a.replace:a.push)(s,i.state,i)}),[n,a,o,r,t])}()}function rt(t,n){let{relative:a}=void 0===n?{}:n,{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase)));return e.useMemo((()=>F(t,JSON.parse(o),r,"path"===a)),[t,o,r,a])}function ot(t,n,a){et()||k(!1);let{navigator:i}=e.useContext(X),{matches:r}=e.useContext(Z),o=r[r.length-1],l=o?o.params:{},s=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let m,c=nt();if(n){var u;let t="string"==typeof n?y(n):n;"/"===s||(null==(u=t.pathname)?void 0:u.startsWith(s))||k(!1),m=t}else m=c;let g=m.pathname||"/",p=w(t,{pathname:"/"===s?g:g.slice(s.length)||"/"}),h=function(t,n,a){var i;if(void 0===n&&(n=[]),void 0===a&&(a=null),null==t){var r;if(null==(r=a)||!r.errors)return null;t=a.matches}let o=t,l=null==(i=a)?void 0:i.errors;if(null!=l){let t=o.findIndex((t=>t.route.id&&(null==l?void 0:l[t.route.id])));t>=0||k(!1),o=o.slice(0,Math.min(o.length,t+1))}return o.reduceRight(((t,i,r)=>{let s=i.route.id?null==l?void 0:l[i.route.id]:null,m=null;a&&(m=i.route.errorElement||st);let c=n.concat(o.slice(0,r+1)),u=()=>{let n;return n=s?m:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(ct,{match:i,routeContext:{outlet:t,matches:c,isDataRoute:null!=a},children:n})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(mt,{location:a.location,revalidation:a.revalidation,component:m,error:s,children:u(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):u()}),null)}(p&&p.map((t=>Object.assign({},t,{params:Object.assign({},l,t.params),pathname:H([s,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?s:H([s,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),r,a);return n&&h?e.createElement(Q.Provider,{value:{location:q({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:d.Pop}},h):h}function lt(){let t=function(){var t;let n=e.useContext(tt),a=function(t){let n=e.useContext(Y);return n||k(!1),n}(gt.UseRouteError),i=dt(gt.UseRouteError);return 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 st=e.createElement(lt,null);class mt 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: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 this.state.error?e.createElement(Z.Provider,{value:this.props.routeContext},e.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:n,match:a,children:i}=t,r=e.useContext(V);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),e.createElement(Z.Provider,{value:n},i)}var ut=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ut||{}),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 dt(t){let n=function(t){let n=e.useContext(Z);return n||k(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||k(!1),a.route.id}function pt(t){let{to:n,replace:a,state:i,relative:r}=t;et()||k(!1);let{matches:o}=e.useContext(Z),{pathname:l}=nt(),s=it(),m=F(n,B(o).map((t=>t.pathnameBase)),l,"path"===r),c=JSON.stringify(m);return e.useEffect((()=>s(JSON.parse(c),{replace:a,state:i,relative:r})),[s,c,r,a,i]),null}function ht(t){k(!1)}function _t(t){let{basename:n="/",children:a=null,location:i,navigationType:r=d.Pop,navigator:o,static:l=!1}=t;et()&&k(!1);let s=n.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:s,navigator:o,static:l})),[s,o,l]);"string"==typeof i&&(i=y(i));let{pathname:c="/",search:u="",hash:g="",state:p=null,key:h="default"}=i,_=e.useMemo((()=>{let t=L(c,s);return null==t?null:{location:{pathname:t,search:u,hash:g,state:p,key:h},navigationType:r}}),[s,c,u,g,p,h,r]);return null==_?null:e.createElement(X.Provider,{value:m},e.createElement(Q.Provider,{children:a,value:_}))}function kt(t){let{children:e,location:n}=t;return ot(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&&k(!1),t.props.index&&t.props.children&&k(!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}function Et(){return Et=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},Et.apply(this,arguments)}function vt(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}e.startTransition,new Promise((()=>{})),e.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const bt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],yt=["aria-current","caseSensitive","className","end","style","to","children"],xt=e.startTransition;function wt(t){let{basename:n,children:a,future:i,window:r}=t,o=e.useRef();var l;null==o.current&&(o.current=(void 0===(l={window:r,v5Compat:!0})&&(l={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,o=i.history,l=d.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function u(){l=d.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:p.location,delta:e})}function g(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof t?t:b(t);return k(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,o.replaceState(h({},o.state,{idx:m}),""));let p={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(_,u),s=t,()=>{i.removeEventListener(_,u),s=null}},createHref(t){return e(i,t)},createURL:g,encodeLocation(t){let e=g(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=d.Push;let a=v(p.location,t,e);n&&n(a,t),m=c()+1;let u=E(a,m),g=p.createHref(a);try{o.pushState(u,"",g)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(g)}r&&s&&s({action:l,location:p.location,delta:1})},replace:function(t,e){l=d.Replace;let a=v(p.location,t,e);n&&n(a,t),m=c();let i=E(a,m),u=p.createHref(a);o.replaceState(i,"",u),r&&s&&s({action:l,location:p.location,delta:0})},go(t){return o.go(t)}};return p}((function(t,e){let{pathname:n="/",search:a="",hash:i=""}=y(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),v("",{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:b(e))}),(function(t,e){f("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),l)));let s=o.current,[m,c]=e.useState({action:s.action,location:s.location}),{v7_startTransition:u}=i||{},g=e.useCallback((t=>{u&&xt?xt((()=>c(t))):c(t)}),[c,u]);return e.useLayoutEffect((()=>s.listen(g)),[s,g]),e.createElement(_t,{basename:n,children:a,location:m.location,navigationType:m.action,navigator:s})}const St="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=e.forwardRef((function(t,n){let a,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:u}=t,g=vt(t,bt),{basename:d}=e.useContext(X),p=!1;if("string"==typeof c&&Nt.test(c)&&(a=c,St))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=L(e.pathname,d);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:p=!0}catch(t){}let h=function(t,n){let{relative:a}=void 0===n?{}:n;et()||k(!1);let{basename:i,navigator:r}=e.useContext(X),{hash:o,pathname:l,search:s}=rt(t,{relative:a}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),_=function(t,n){let{target:a,replace:i,state:r,preventScrollReset:o,relative:l}=void 0===n?{}:n,s=it(),m=nt(),c=rt(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:b(m)===b(c);s(t,{replace:n,state:r,preventScrollReset:o,relative:l})}}),[m,s,c,i,r,a,t,o,l])}(c,{replace:l,state:s,target:m,preventScrollReset:u,relative:r});return e.createElement("a",Et({},g,{href:a||h,onClick:p||o?i:function(t){i&&i(t),t.defaultPrevented||_(t)},ref:n,target:m}))})),Tt=e.forwardRef((function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,children:m}=t,c=vt(t,yt),u=rt(s,{relative:c.relative}),g=nt(),d=e.useContext(Y),{navigator:p}=e.useContext(X),h=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=g.pathname,k=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;i||(_=_.toLowerCase(),k=k?k.toLowerCase():null,h=h.toLowerCase());let f,E=_===h||!o&&_.startsWith(h)&&"/"===_.charAt(h.length),v=null!=k&&(k===h||!o&&k.startsWith(h)&&"/"===k.charAt(h.length)),b=E?a:void 0;f="function"==typeof r?r({isActive:E,isPending:v}):[r,E?"active":null,v?"pending":null].filter(Boolean).join(" ");let y="function"==typeof l?l({isActive:E,isPending:v}):l;return e.createElement(Ct,Et({},c,{"aria-current":b,className:f,ref:n,style:y,to:s}),"function"==typeof m?m({isActive:E,isPending:v}):m)}));var Gt,Dt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher"})(Gt||(Gt={})),function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Dt||(Dt={}));var It=({page:t})=>{let n=(0,c.__)("Settings","gtm-kit");switch(t){case"general":n=(0,c.__)("Settings","gtm-kit");break;case"integrations":n=(0,c.__)("Integrations","gtm-kit");break;case"help":n=(0,c.__)("Help","gtm-kit")}return(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"}))),n))))};var Pt=({to:t,title:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Tt,{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)),Ot=({page: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"},function({page:t}){const e=[{to:"general",title:(0,c.__)("Dashboard","gtm-kit")},{to:"container",title:(0,c.__)("Container","gtm-kit")},{to:"post-data",title:(0,c.__)("Post data","gtm-kit")},{to:"user-data",title:(0,c.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,c.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,c.__)("Misc","gtm-kit")}],n=[{to:"integrations",title:(0,c.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],a=[{to:"help",title:(0,c.__)("Help","gtm-kit")},{to:"support",title:(0,c.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return n;case"help":return a}}({page:t}).map((function(t){return(0,e.createElement)(Pt,{key:t.to,to:t.to,title:t.title})})));function Rt(){return Rt=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},Rt.apply(this,arguments)}function Mt(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 Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function At(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ut(t,e)}function Lt(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var jt=window.ReactDOM,Bt=t.n(jt),Ft=n().createContext(null),Ht=function(t){return t.scrollTop},Wt="unmounted",Kt="exited",Jt="entering",zt="entered",$t="exiting",qt=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=Kt,a.appearStatus=Jt):i=zt:i=e.unmountOnExit||e.mountOnEnter?Wt:Kt,a.state={status:i},a.nextCallback=null,a}At(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Wt?{status:Kt}: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!==Jt&&n!==zt&&(e=Jt):n!==Jt&&n!==zt||(e=$t)}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===Jt){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Bt().findDOMNode(this);n&&Ht(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Kt&&this.setState({status:Wt})},a.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[Bt().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:Jt},(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:Bt().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:$t},(function(){t.props.onExiting(a),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:Kt},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:Kt},(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:Bt().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===Wt)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,Mt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n().createElement(Ft.Provider,{value:null},"function"==typeof a?a(t,i):n().cloneElement(n().Children.only(a),i))},e}(n().Component);function Vt(){}qt.contextType=Ft,qt.propTypes={},qt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vt,onEntering:Vt,onEntered:Vt,onExit:Vt,onExiting:Vt,onExited:Vt},qt.UNMOUNTED=Wt,qt.EXITED=Kt,qt.ENTERING=Jt,qt.ENTERED=zt,qt.EXITING=$t;var Yt=qt,Xt=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=Lt(n.className,a):n.setAttribute("class",Lt(n.className&&n.className.baseVal||"",a)));var n,a}))},Qt=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}At(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&&Ht(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&&Xt(t,a),i&&Xt(t,i),r&&Xt(t,r)},a.render=function(){var t=this.props,e=(t.classNames,Mt(t,["classNames"]));return n().createElement(Yt,Rt({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n().Component);Qt.defaultProps={classNames:""},Qt.propTypes={};var Zt=Qt,te=({title:t=(0,c.__)("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:r,useIsPending:o,useCanSave:l}=(0,a.useContext)(g);return(0,e.createElement)(i.Button,{className:n,onClick:()=>r(),variant:"primary",disabled:o||!l},l?(0,c.__)(t,"gtm-kit"):(0,c.__)("Saved","gtm-kit"),o?(0,e.createElement)(i.Spinner,null):"")},ee=()=>{const{useCanSave:t}=(0,a.useContext)(g);return(0,e.createElement)(Zt,{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)(te,null)))},ne=({subject:t})=>{const n=!0===t||"on"===t,a=!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 "+a},n?(0,c.__)("Active","gtm-kit"):(0,c.__)("Inactive","gtm-kit"))};const ae=(0,a.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)));ae.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),ae.Content=({as:t="div",children:n,className:a="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:a},n),ae.Button=({url:t,destination:n,newTab:a=!1,text:r,group:o="",...l})=>{const s=it();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(i.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"},r)))};var ie=ae,re=({title:t,data:n,className:i=""})=>{const{useSettings:r}=(0,a.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] "+i},n.map(((t,n)=>!1===t.featured?null:(0,e.createElement)(ie,{key:n},(0,e.createElement)(ie.Header,{title:t.title},t.pill?(0,e.createElement)(ne,{subject:r[t.group][t.option]}):null),(0,e.createElement)(ie.Content,null,t.text.map(((t,n)=>(0,e.createElement)("p",{key:n},t)))),(0,e.createElement)(ie.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,c.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))};const oe=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,c.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,c.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,c.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,c.__)("Setup integration","gtm-kit")}}],le=[{title:"Getting started with GTM Kit",text:[(0,c.__)("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,c.__)("WooCommerce integration","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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,c.__)("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,c.__)("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 se=()=>{const{useSettings:t}=(0,a.useContext)(g),[n,i]=(0,a.useState)(le),r=Boolean(t.general.sgtm_domain .trim());return(0,a.useEffect)((()=>{i((t=>[...t,{title:(0,c.__)("See all tutorials…","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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)(ie,null,(0,e.createElement)(ie.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ne,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(ie.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,c.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,c.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ne,{subject:r})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ne,{subject:t.general.analytics_active})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/misc",text:(0,c.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(re,{title:(0,c.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe}))},me=({title:t,placeholder:n,help:r,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,a.useContext)(g);return(0,e.createElement)(i.TextControl,{label:t,placeholder:n,help:r,className:o,value:c[l][s],onChange:t=>u(l,s,t),disabled:m})},ce=({title:t,label:n,optionGroup:r="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,a.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(i.BaseControl,{label:t},(0,e.createElement)(i.ToggleControl,{label:n,checked:!l&&s[r][o],onChange:()=>{m(r,o,!(s&&s[r][o]))},disabled:l}))))},ue=({title:t,options:n,help:r,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,a.useContext)(g);return(0,e.createElement)(i.RadioControl,{label:t,options:n,help:r,className:o,selected:parseInt(c[l][s]),onChange:t=>u(l,s,t),disabled:m})};const ge=(0,a.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)));ge.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),ge.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);var de=ge,pe=()=>{const{useSettings:t}=(0,a.useContext)(g),n=!(t.general.sgtm_domain.trim()&&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,c.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager container code","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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)(me,{title:(0,c.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,c.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Inject Container Code","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Just the container","gtm-kit"),label:(0,c.__)("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)(me,{title:(0,c.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(de.Content,null,(0,e.createElement)(me,{title:(0,c.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,c.__)("Enter domain …","gtm-kit"),help:(0,c.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(me,{title:(0,c.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,c.__)("Enter loader name …","gtm-kit"),help:(0,c.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,c.__)("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,c.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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"},(0,c.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,c.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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,c.__)("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,c.__)("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"},(0,c.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Container code implementation:","gtm-kit"),options:[{label:(0,c.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,c.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,c.__)("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,c.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,c.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,c.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,c.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,c.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,c.__)('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(); } ?>")))))},he=()=>(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,c.__)("Post Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Post type","gtm-kit"),id:"post-type",label:(0,c.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ce,{title:(0,c.__)("Page type","gtm-kit"),id:"page-type",label:(0,c.__)('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)(ce,{title:(0,c.__)("Categories","gtm-kit"),id:"categories",label:(0,c.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ce,{title:(0,c.__)("Tags","gtm-kit"),id:"tags",label:(0,c.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ce,{title:(0,c.__)("Post title","gtm-kit"),id:"post-title",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ce,{title:(0,c.__)("Post ID","gtm-kit"),id:"post-id",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ce,{title:(0,c.__)("Post data","gtm-kit"),id:"post-date",label:(0,c.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,c.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,c.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),_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,c.__)("User Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,c.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ce,{title:(0,c.__)("User ID","gtm-kit"),id:"user-id",label:(0,c.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ce,{title:(0,c.__)("User role","gtm-kit"),id:"user-role",label:(0,c.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),ke=()=>{const{useSettings:t}=(0,a.useContext)(g),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,c.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,c.__)("Warning!","gtm-kit"))),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("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,c.__)("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,c.__)("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,c.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ce,{title:(0,c.__)("Activate GCM settings","gtm-kit"),label:(0,c.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Ad Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Analytics Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Functionality Storage","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Personalization Storage","gtm-kit"),label:(0,c.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Security Storage","gtm-kit"),label:(0,c.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:n}))))},fe=({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))),Ee=()=>{const{useSiteData:t}=(0,a.useContext)(g),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,c.__)("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,c.__)("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)(fe,{key:n,label:t.label,value:t.value,tag:t.tag})})))))},ve=()=>{const{}=(0,a.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,c.__)("Misc","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(Ee,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,c.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Share anonymous data","gtm-kit"),label:(0,c.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Console log","gtm-kit"),label:(0,c.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},be=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe})),ye=({pluginName:t})=>(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,c.sprintf)((0,c.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(i.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,c.sprintf)((0,c.__)("Install %s","gtm-kit"),t)))),xe=({title:t,options:n,className:r="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:o="general",optionName:l,disabled:s=!1,help:m="",notSet:u=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,a.useContext)(g),h=u?[{label:(0,c.__)("(not set)","gtm-kit"),value:""},...n]:n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(i.SelectControl,{label:t,value:d&&d[o][l],options:h,className:r,onChange:t=>p(o,l,t),disabled:s,help:m}))},we=({pluginName:t,optionName:n,pluginInactive:a})=>(0,e.createElement)(de,{disabled:a},(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.sprintf)((0,c.__)("Track %s","gtm-kit"),t),label:(0,c.sprintf)((0,c.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:n,disabled:a})));const Se=[{label:(0,c.__)("Retail","gtm-kit"),value:"retail"},{label:(0,c.__)("Education","gtm-kit"),value:"education"},{label:(0,c.__)("Flights","gtm-kit"),value:"flights"},{label:(0,c.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,c.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,c.__)("Local deals","gtm-kit"),value:"local"},{label:(0,c.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,c.__)("Travel","gtm-kit"),value:"travel"},{label:(0,c.__)("Custom","gtm-kit"),value:"custom"}];var Ne=()=>{const{useSettings:t}=(0,a.useContext)(g),n="WooCommerce",i=!window.gtmkitSettings.plugins.woocommerce,r=i||!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,c.__)("WooCommerce","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"woocommerce_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,c.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude shipping from revenue","gtm-kit"),label:(0,c.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Event customization","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:"view_item_list (with product filter)",options:[{label:(0,c.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,c.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,c.__)("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:r}),(0,e.createElement)(ue,{title:"view_item",options:[{label:(0,c.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,c.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,c.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,c.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:r}),(0,e.createElement)(ue,{title:"add_shipping_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:r}),(0,e.createElement)(ue,{title:"add_payment_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include permalink structure","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include path of pages","gtm-kit"),label:(0,c.__)("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:r}))))},Ce=()=>{const{useSettings:t}=(0,a.useContext)(g),n="Contact Form 7",i=!window.gtmkitSettings.plugins.cf7,r=i||!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,c.__)("Contact Form 7","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"cf7_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Load JavaScript","gtm-kit"),options:[{label:(0,c.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,c.__)("On all pages","gtm-kit"),value:2}],help:(0,c.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:r}))))},Te=()=>{const t="Easy Digital Downloads",n=!window.gtmkitSettings.plugins.edd,{useSettings:i}=(0,a.useContext)(g),r=n||!i.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,c.__)("Easy Digital Downloads","gtm-kit")),n?(0,e.createElement)(ye,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:n}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}))))},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,c.__)("Help","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,c.__)("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,c.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,c.__)("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,c.__)("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,c.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Tutorials","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("ul",null,le.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)))))))))),De=()=>{const{useSiteData:t}=(0,a.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,c.__)("Get support","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Support options","gtm-kit")}),(0,e.createElement)(de.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,c.__)("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,c.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,c.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("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,c.__)("Version:","gtm-kit")," ",t.gtmkit_version,")")),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",null,(0,c.__)("You can see the changes of all versions in:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,c.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,c.__)("The Github repository","gtm-kit"))))))};const Ie=()=>{const{useSettings:t}=(0,a.useContext)(g),n=window.gtmkitSettings.currentPage;return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,{page:n}),(0,e.createElement)(Ot,{page:n}),(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)(se,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(pe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(ve,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ne,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(Te,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)(De,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+n})}))),(0,e.createElement)(ee,null)):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(i.Spinner,null)))},Pe=()=>(0,e.createElement)(wt,{basename:"/"},(0,e.createElement)(p,null,(0,e.createElement)(Ie,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Pe,null),document.getElementById(window.gtmkitSettings.rootId))}))}();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.element,i=window.wp.components,r=window.lodash,o=window.wp.apiFetch,l=t.n(o);l().use(l().createNonceMiddleware(window.gtmkitSettings.nonce)),l().use(l().createRootURLMiddleware(window.gtmkitSettings.root));const s=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-options",method:"GET"})}catch(t){return console.log("fetchSettings Errors:",t),{gtm_kit_settings_fetch_settings_errors:!0}}return!0===t.success?t.data:t},m=async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-site-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t};var c=window.wp.i18n,u=(t,e)=>{const n=Object.assign({},t);switch(e.type){case"FETCH_SETTINGS":n.fetchedSettings=e.payload.fetchedSettings,n.stateSettings=e.payload.stateSettings,n.siteData=e.payload.siteData,n.installData=e.payload.installData,n.isPending=!1,n.canSave=!1,void 0===e.payload.fetchedSettings.integrations&&(n.fetchedSettings.integrations={}),void 0!==e.payload.fetchedSettings.gtm_kit_settings_fetch_settings_errors&&(n.notice=(0,c.__)("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;let t=!1,a=(0,c.__)("Saved Successfully.","gtm-kit"),i=!1;void 0!==e.payload.fetchedSettings.gtm_kit_settings_update_settings_errors&&(t=!0,a=(0,c.__)("An error occurred.","gtm-kit"),i=!0),n.canSave=t,n.notice=a,n.hasError=i;break;case"UPDATE_STATE":e.payload.fetchedSettings&&(n.fetchedSettings=e.payload.fetchedSettings),e.payload.stateSettings&&(n.stateSettings=e.payload.stateSettings),void 0!==e.payload.isPending&&(n.isPending=e.payload.isPending),void 0!==e.payload.notice&&(n.notice=e.payload.notice),void 0!==e.payload.hasError&&(n.hasError=e.payload.hasError),void 0!==e.payload.canSave&&(n.canSave=e.payload.canSave)}return n};const g=(0,a.createContext)();var d,p=t=>{const[n,i]=(0,a.useReducer)(u,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:"",canSave:!1}),o=async()=>{const[t,e]=await Promise.all([s(),m()]),n="wizard"===window.gtmkitSettings.currentPage?await(async()=>{let t={};try{t=await l()({path:"gtmkit/v1/get-install-data",method:"GET"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t})():{};i({type:"FETCH_SETTINGS",payload:{fetchedSettings:t,stateSettings:t,siteData:e,installData:n}})},c=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,a.useEffect)((()=>{o()}),[]);const d={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(async t=>{let e={};try{e=await l()({path:"gtmkit/v1/set-options",method:"POST",data:t})}catch(t){return console.log("updateSettings Errors:",t),{gtm_kit_settings_update_settings_errors:!0}}return!0===e.success?e.data:e})(n.stateSettings);i({type:"UPDATE_SETTINGS",payload:{fetchedSettings:t,stateSettings:t}})},useFetchSettings:o,useUpdateState:c,useUpdateStateSettings:async(t,e,a)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let o;i[t][e]=a,o=!(0,r.isEqual)(i,n.fetchedSettings),c({stateSettings:i,canSave:o})},useImportSettings:async(t,e)=>{const a=JSON.parse(JSON.stringify(n.stateSettings));let i;const o={};o.general={...a.general,...e.general},"integrations"in e&&(o.integrations={...a.integrations,...e.integrations}),i=!(0,r.isEqual)(o,n.fetchedSettings),c({stateSettings:o,canSave:i})},useSettings:n.stateSettings,useIsPending:n.isPending,useNotice:n.notice,useHasError:n.hasError,useCanSave:n.canSave,useSiteData:n.siteData,useInstallData:n.installData};return(0,e.createElement)(g.Provider,{value:d},t.children)};function h(){return h=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},h.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(d||(d={}));const _="popstate";function k(t,e){if(!1===t||null==t)throw new Error(e)}function f(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}function E(t,e){return{usr:t.state,key:t.key,idx:e}}function v(t,e,n,a){return void 0===n&&(n=null),h({pathname:"string"==typeof t?t:t.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:n,key:e&&e.key||a||Math.random().toString(36).substr(2,8)})}function b(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 y(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 x;function w(t,e,n){void 0===n&&(n="/");let a=L(("string"==typeof e?y(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=M(i[t],A(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("/")&&(k(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&&(k(!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:R(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 N(t.path))i(t,e,n);else i(t,e)})),e}function N(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=N(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"}(x||(x={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const C=/^:\w+$/,T=3,G=2,D=1,I=10,P=-2,O=t=>"*"===t;function R(t,e){let n=t.split("/"),a=n.length;return n.some(O)&&(a+=P),e&&(a+=G),n.filter((t=>!O(t))).reduce(((t,e)=>t+(C.test(e)?T:""===e?D:I)),a)}function M(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=U({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:W(H([i,m.pathnameBase])),route:c}),"/"!==m.pathnameBase&&(i=H([i,m.pathnameBase]))}return r}function U(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),f("*"===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)=>(a.push(e),"/([^\\/]+)")));return t.endsWith("*")?(a.push("*"),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)=>{if("*"===e){let t=l[n]||"";o=r.slice(0,r.length-t.length).replace(/(.)\/+$/,"$1")}return t[e]=function(t,e){try{return decodeURIComponent(t)}catch(n){return f(!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}}(l[n]||"",e),t}),{}),pathname:r,pathnameBase:o,pattern:t}}function A(t){try{return decodeURI(t)}catch(e){return f(!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 L(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 j(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 B(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}function F(t,e,n,a){let i;void 0===a&&(a=!1),"string"==typeof t?i=y(t):(i=h({},t),k(!i.pathname||!i.pathname.includes("?"),j("?","pathname","search",i)),k(!i.pathname||!i.pathname.includes("#"),j("#","pathname","hash",i)),k(!i.search||!i.search.includes("#"),j("#","search","hash",i)));let r,o=""===t||""===i.pathname,l=o?"/":i.pathname;if(a||null==l)r=n;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?y(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:K(a),hash:J(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,"/"),W=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),K=t=>t&&"?"!==t?t.startsWith("?")?t:"?"+t:"",J=t=>t&&"#"!==t?t.startsWith("#")?t:"#"+t:"";Error;const z=["post","put","patch","delete"],$=(new Set(z),["get",...z]);function q(){return q=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},q.apply(this,arguments)}new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const V=e.createContext(null),Y=e.createContext(null),X=e.createContext(null),Q=e.createContext(null),Z=e.createContext({outlet:null,matches:[],isDataRoute:!1}),tt=e.createContext(null);function et(){return null!=e.useContext(Q)}function nt(){return et()||k(!1),e.useContext(Q).location}function at(t){e.useContext(X).static||e.useLayoutEffect(t)}function it(){let{isDataRoute:t}=e.useContext(Z);return t?function(){let{router:t}=function(t){let n=e.useContext(V);return n||k(!1),n}(ut.UseNavigateStable),n=dt(gt.UseNavigateStable),a=e.useRef(!1);return at((()=>{a.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),a.current&&("number"==typeof e?t.navigate(e):t.navigate(e,q({fromRouteId:n},i)))}),[t,n])}():function(){et()||k(!1);let t=e.useContext(V),{basename:n,navigator:a}=e.useContext(X),{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase))),l=e.useRef(!1);return at((()=>{l.current=!0})),e.useCallback((function(e,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof e)return void a.go(e);let s=F(e,JSON.parse(o),r,"path"===i.relative);null==t&&"/"!==n&&(s.pathname="/"===s.pathname?n:H([n,s.pathname])),(i.replace?a.replace:a.push)(s,i.state,i)}),[n,a,o,r,t])}()}function rt(t,n){let{relative:a}=void 0===n?{}:n,{matches:i}=e.useContext(Z),{pathname:r}=nt(),o=JSON.stringify(B(i).map((t=>t.pathnameBase)));return e.useMemo((()=>F(t,JSON.parse(o),r,"path"===a)),[t,o,r,a])}function ot(t,n,a){et()||k(!1);let{navigator:i}=e.useContext(X),{matches:r}=e.useContext(Z),o=r[r.length-1],l=o?o.params:{},s=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let m,c=nt();if(n){var u;let t="string"==typeof n?y(n):n;"/"===s||(null==(u=t.pathname)?void 0:u.startsWith(s))||k(!1),m=t}else m=c;let g=m.pathname||"/",p=w(t,{pathname:"/"===s?g:g.slice(s.length)||"/"}),h=function(t,n,a){var i;if(void 0===n&&(n=[]),void 0===a&&(a=null),null==t){var r;if(null==(r=a)||!r.errors)return null;t=a.matches}let o=t,l=null==(i=a)?void 0:i.errors;if(null!=l){let t=o.findIndex((t=>t.route.id&&(null==l?void 0:l[t.route.id])));t>=0||k(!1),o=o.slice(0,Math.min(o.length,t+1))}return o.reduceRight(((t,i,r)=>{let s=i.route.id?null==l?void 0:l[i.route.id]:null,m=null;a&&(m=i.route.errorElement||st);let c=n.concat(o.slice(0,r+1)),u=()=>{let n;return n=s?m:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(ct,{match:i,routeContext:{outlet:t,matches:c,isDataRoute:null!=a},children:n})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===r)?e.createElement(mt,{location:a.location,revalidation:a.revalidation,component:m,error:s,children:u(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):u()}),null)}(p&&p.map((t=>Object.assign({},t,{params:Object.assign({},l,t.params),pathname:H([s,i.encodeLocation?i.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?s:H([s,i.encodeLocation?i.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),r,a);return n&&h?e.createElement(Q.Provider,{value:{location:q({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:d.Pop}},h):h}function lt(){let t=function(){var t;let n=e.useContext(tt),a=function(t){let n=e.useContext(Y);return n||k(!1),n}(gt.UseRouteError),i=dt(gt.UseRouteError);return 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 st=e.createElement(lt,null);class mt 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: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 this.state.error?e.createElement(Z.Provider,{value:this.props.routeContext},e.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:n,match:a,children:i}=t,r=e.useContext(V);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),e.createElement(Z.Provider,{value:n},i)}var ut=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(ut||{}),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 dt(t){let n=function(t){let n=e.useContext(Z);return n||k(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||k(!1),a.route.id}function pt(t){let{to:n,replace:a,state:i,relative:r}=t;et()||k(!1);let{matches:o}=e.useContext(Z),{pathname:l}=nt(),s=it(),m=F(n,B(o).map((t=>t.pathnameBase)),l,"path"===r),c=JSON.stringify(m);return e.useEffect((()=>s(JSON.parse(c),{replace:a,state:i,relative:r})),[s,c,r,a,i]),null}function ht(t){k(!1)}function _t(t){let{basename:n="/",children:a=null,location:i,navigationType:r=d.Pop,navigator:o,static:l=!1}=t;et()&&k(!1);let s=n.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:s,navigator:o,static:l})),[s,o,l]);"string"==typeof i&&(i=y(i));let{pathname:c="/",search:u="",hash:g="",state:p=null,key:h="default"}=i,_=e.useMemo((()=>{let t=L(c,s);return null==t?null:{location:{pathname:t,search:u,hash:g,state:p,key:h},navigationType:r}}),[s,c,u,g,p,h,r]);return null==_?null:e.createElement(X.Provider,{value:m},e.createElement(Q.Provider,{children:a,value:_}))}function kt(t){let{children:e,location:n}=t;return ot(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&&k(!1),t.props.index&&t.props.children&&k(!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}function Et(){return Et=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},Et.apply(this,arguments)}function vt(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}e.startTransition,new Promise((()=>{})),e.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const bt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],yt=["aria-current","caseSensitive","className","end","style","to","children"],xt=e.startTransition;function wt(t){let{basename:n,children:a,future:i,window:r}=t,o=e.useRef();var l;null==o.current&&(o.current=(void 0===(l={window:r,v5Compat:!0})&&(l={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,o=i.history,l=d.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function u(){l=d.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:p.location,delta:e})}function g(t){let e="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof t?t:b(t);return k(e,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,e)}null==m&&(m=0,o.replaceState(h({},o.state,{idx:m}),""));let p={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(_,u),s=t,()=>{i.removeEventListener(_,u),s=null}},createHref(t){return e(i,t)},createURL:g,encodeLocation(t){let e=g(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=d.Push;let a=v(p.location,t,e);n&&n(a,t),m=c()+1;let u=E(a,m),g=p.createHref(a);try{o.pushState(u,"",g)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(g)}r&&s&&s({action:l,location:p.location,delta:1})},replace:function(t,e){l=d.Replace;let a=v(p.location,t,e);n&&n(a,t),m=c();let i=E(a,m),u=p.createHref(a);o.replaceState(i,"",u),r&&s&&s({action:l,location:p.location,delta:0})},go(t){return o.go(t)}};return p}((function(t,e){let{pathname:n="/",search:a="",hash:i=""}=y(t.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),v("",{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:b(e))}),(function(t,e){f("/"===t.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")")}),l)));let s=o.current,[m,c]=e.useState({action:s.action,location:s.location}),{v7_startTransition:u}=i||{},g=e.useCallback((t=>{u&&xt?xt((()=>c(t))):c(t)}),[c,u]);return e.useLayoutEffect((()=>s.listen(g)),[s,g]),e.createElement(_t,{basename:n,children:a,location:m.location,navigationType:m.action,navigator:s})}const St="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=e.forwardRef((function(t,n){let a,{onClick:i,relative:r,reloadDocument:o,replace:l,state:s,target:m,to:c,preventScrollReset:u}=t,g=vt(t,bt),{basename:d}=e.useContext(X),p=!1;if("string"==typeof c&&Nt.test(c)&&(a=c,St))try{let t=new URL(window.location.href),e=c.startsWith("//")?new URL(t.protocol+c):new URL(c),n=L(e.pathname,d);e.origin===t.origin&&null!=n?c=n+e.search+e.hash:p=!0}catch(t){}let h=function(t,n){let{relative:a}=void 0===n?{}:n;et()||k(!1);let{basename:i,navigator:r}=e.useContext(X),{hash:o,pathname:l,search:s}=rt(t,{relative:a}),m=l;return"/"!==i&&(m="/"===l?i:H([i,l])),r.createHref({pathname:m,search:s,hash:o})}(c,{relative:r}),_=function(t,n){let{target:a,replace:i,state:r,preventScrollReset:o,relative:l}=void 0===n?{}:n,s=it(),m=nt(),c=rt(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:b(m)===b(c);s(t,{replace:n,state:r,preventScrollReset:o,relative:l})}}),[m,s,c,i,r,a,t,o,l])}(c,{replace:l,state:s,target:m,preventScrollReset:u,relative:r});return e.createElement("a",Et({},g,{href:a||h,onClick:p||o?i:function(t){i&&i(t),t.defaultPrevented||_(t)},ref:n,target:m}))})),Tt=e.forwardRef((function(t,n){let{"aria-current":a="page",caseSensitive:i=!1,className:r="",end:o=!1,style:l,to:s,children:m}=t,c=vt(t,yt),u=rt(s,{relative:c.relative}),g=nt(),d=e.useContext(Y),{navigator:p}=e.useContext(X),h=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=g.pathname,k=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;i||(_=_.toLowerCase(),k=k?k.toLowerCase():null,h=h.toLowerCase());let f,E=_===h||!o&&_.startsWith(h)&&"/"===_.charAt(h.length),v=null!=k&&(k===h||!o&&k.startsWith(h)&&"/"===k.charAt(h.length)),b=E?a:void 0;f="function"==typeof r?r({isActive:E,isPending:v}):[r,E?"active":null,v?"pending":null].filter(Boolean).join(" ");let y="function"==typeof l?l({isActive:E,isPending:v}):l;return e.createElement(Ct,Et({},c,{"aria-current":b,className:f,ref:n,style:y,to:s}),"function"==typeof m?m({isActive:E,isPending:v}):m)}));var Gt,Dt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher"})(Gt||(Gt={})),function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Dt||(Dt={}));var It=({page:t})=>{let n=(0,c.__)("Settings","gtm-kit");switch(t){case"general":n=(0,c.__)("Settings","gtm-kit");break;case"integrations":n=(0,c.__)("Integrations","gtm-kit");break;case"help":n=(0,c.__)("Help","gtm-kit")}return(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"}))),n))))};var Pt=({to:t,title:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Tt,{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)),Ot=({page: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"},function({page:t}){const e=[{to:"general",title:(0,c.__)("Dashboard","gtm-kit")},{to:"container",title:(0,c.__)("Container","gtm-kit")},{to:"post-data",title:(0,c.__)("Post data","gtm-kit")},{to:"user-data",title:(0,c.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,c.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,c.__)("Misc","gtm-kit")}],n=[{to:"integrations",title:(0,c.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],a=[{to:"help",title:(0,c.__)("Help","gtm-kit")},{to:"support",title:(0,c.__)("Support","gtm-kit")}];switch(t){case"general":return e;case"integrations":return n;case"help":return a}}({page:t}).map((function(t){return(0,e.createElement)(Pt,{key:t.to,to:t.to,title:t.title})})));function Rt(){return Rt=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},Rt.apply(this,arguments)}function Mt(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 Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function At(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ut(t,e)}function Lt(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var jt=window.ReactDOM,Bt=t.n(jt),Ft=n().createContext(null),Ht=function(t){return t.scrollTop},Wt="unmounted",Kt="exited",Jt="entering",zt="entered",$t="exiting",qt=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=Kt,a.appearStatus=Jt):i=zt:i=e.unmountOnExit||e.mountOnEnter?Wt:Kt,a.state={status:i},a.nextCallback=null,a}At(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Wt?{status:Kt}: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!==Jt&&n!==zt&&(e=Jt):n!==Jt&&n!==zt||(e=$t)}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===Jt){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Bt().findDOMNode(this);n&&Ht(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Kt&&this.setState({status:Wt})},a.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[Bt().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:Jt},(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:Bt().findDOMNode(this);e?(this.props.onExit(a),this.safeSetState({status:$t},(function(){t.props.onExiting(a),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:Kt},(function(){t.props.onExited(a)}))}))}))):this.safeSetState({status:Kt},(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:Bt().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===Wt)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,Mt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n().createElement(Ft.Provider,{value:null},"function"==typeof a?a(t,i):n().cloneElement(n().Children.only(a),i))},e}(n().Component);function Vt(){}qt.contextType=Ft,qt.propTypes={},qt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vt,onEntering:Vt,onEntered:Vt,onExit:Vt,onExiting:Vt,onExited:Vt},qt.UNMOUNTED=Wt,qt.EXITED=Kt,qt.ENTERING=Jt,qt.ENTERED=zt,qt.EXITING=$t;var Yt=qt,Xt=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=Lt(n.className,a):n.setAttribute("class",Lt(n.className&&n.className.baseVal||"",a)));var n,a}))},Qt=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}At(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&&Ht(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&&Xt(t,a),i&&Xt(t,i),r&&Xt(t,r)},a.render=function(){var t=this.props,e=(t.classNames,Mt(t,["classNames"]));return n().createElement(Yt,Rt({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n().Component);Qt.defaultProps={classNames:""},Qt.propTypes={};var Zt=Qt,te=({title:t=(0,c.__)("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:r,useIsPending:o,useCanSave:l}=(0,a.useContext)(g);return(0,e.createElement)(i.Button,{className:n,onClick:()=>r(),variant:"primary",disabled:o||!l},l?(0,c.__)(t,"gtm-kit"):(0,c.__)("Saved","gtm-kit"),o?(0,e.createElement)(i.Spinner,null):"")},ee=()=>{const{useCanSave:t}=(0,a.useContext)(g);return(0,e.createElement)(Zt,{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)(te,null)))},ne=({subject:t})=>{const n=!0===t||"on"===t,a=!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 "+a},n?(0,c.__)("Active","gtm-kit"):(0,c.__)("Inactive","gtm-kit"))};const ae=(0,a.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)));ae.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),ae.Content=({as:t="div",children:n,className:a="gtmkit-flex-auto",...i})=>(0,e.createElement)(t,{...i,className:a},n),ae.Button=({url:t,destination:n,newTab:a=!1,text:r,group:o="",...l})=>{const s=it();return(0,e.createElement)("div",{...l,className:"gtmkit-mt-4 gtmkit-mb-0.5"},(0,e.createElement)(i.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"},r)))};var ie=ae,re=({title:t,data:n,className:i=""})=>{const{useSettings:r}=(0,a.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] "+i},n.map(((t,n)=>!1===t.featured?null:(0,e.createElement)(ie,{key:n},(0,e.createElement)(ie.Header,{title:t.title},t.pill?(0,e.createElement)(ne,{subject:r[t.group][t.option]}):null),(0,e.createElement)(ie.Content,null,t.text.map(((t,n)=>(0,e.createElement)("p",{key:n},t)))),(0,e.createElement)(ie.Button,{url:t.link.url,destination:t.link.destination,text:t.link.text?t.link.text:(0,c.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))};const oe=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,c.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,c.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,c.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,c.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,c.__)("Setup integration","gtm-kit")}}],le=[{title:"Getting started with GTM Kit",text:[(0,c.__)("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,c.__)("WooCommerce integration","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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,c.__)("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,c.__)("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 se=()=>{const{useSettings:t}=(0,a.useContext)(g),[n,i]=(0,a.useState)(le),r=Boolean(t.general.sgtm_domain&&t.general.sgtm_domain.trim());return(0,a.useEffect)((()=>{i((t=>[...t,{title:(0,c.__)("See all tutorials…","gtm-kit"),text:[(0,c.__)("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,c.__)("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,c.__)("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)(ie,null,(0,e.createElement)(ie.Header,{title:"Google Tag Manager Container"},(0,e.createElement)(ne,{subject:t.general.gtm_id&&t.general.container_active})),(0,e.createElement)(ie.Content,null,t.general.gtm_id&&t.general.container_active?(0,e.createElement)("p",null,(0,c.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,c.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Server-side GTM","gtm-kit")},(0,e.createElement)(ne,{subject:r})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Server-side tagging is a silver bullet that gives you improved data accuracy, performance, privacy, and flexibility.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,c.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")},(0,e.createElement)(ne,{subject:t.general.analytics_active})),(0,e.createElement)(ie.Content,null,(0,e.createElement)("p",null,(0,c.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/misc",text:(0,c.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(re,{title:(0,c.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe}))},me=({title:t,placeholder:n,help:r,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,a.useContext)(g);return(0,e.createElement)(i.TextControl,{label:t,placeholder:n,help:r,className:o,value:c[l][s],onChange:t=>u(l,s,t),disabled:m})},ce=({title:t,label:n,optionGroup:r="general",optionName:o,disabled:l=!1})=>{const{useSettings:s,useUpdateStateSettings:m}=(0,a.useContext)(g);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(i.BaseControl,{label:t},(0,e.createElement)(i.ToggleControl,{label:n,checked:!l&&s[r][o],onChange:()=>{m(r,o,!(s&&s[r][o]))},disabled:l}))))},ue=({title:t,options:n,help:r,className:o="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:l="general",optionName:s,disabled:m})=>{const{useSettings:c,useUpdateStateSettings:u}=(0,a.useContext)(g);return(0,e.createElement)(i.RadioControl,{label:t,options:n,help:r,className:o,selected:parseInt(c[l][s]),onChange:t=>u(l,s,t),disabled:m})};const ge=(0,a.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)));ge.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),ge.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);var de=ge,pe=()=>{const{useSettings:t}=(0,a.useContext)(g),n=!(t.general.sgtm_domain.trim()&&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,c.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager container code","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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)(me,{title:(0,c.__)("GTM Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,c.__)("Enter GTM Container ID","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Inject Container Code","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Just the container","gtm-kit"),label:(0,c.__)("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)(me,{title:(0,c.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Server-side Tagging (sGTM)","gtm-kit")}),(0,e.createElement)("div",{className:"gtmkit-grid gtmkit-grid-cols-2 gtmkit-gap-4"},(0,e.createElement)(de.Content,null,(0,e.createElement)(me,{title:(0,c.__)("sGTM Container Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,c.__)("Enter domain …","gtm-kit"),help:(0,c.__)("Enter your custom domain name if you are using a custom server side GTM container for tracking.","gtm-kit")}),(0,e.createElement)(me,{title:(0,c.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,c.__)("Enter loader name …","gtm-kit"),help:(0,c.__)("Only use if you are using a custom loader.","gtm-kit")}),(0,e.createElement)(ce,{title:(0,c.__)("Cookie Keeper (for Stape users only)","gtm-kit"),label:(0,c.__)("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,c.__)("Google Tag Manager Server-side Tagging","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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"},(0,c.__)("Learn more","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-pt-4 gtmkit-mb-4 gtmkit-text-lg gtmkit-font-bold"},(0,c.__)("Hosting server-side GTM containers","gtm-kit")),(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("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,c.__)("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,c.__)("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"},(0,c.__)("Learn more about Stape.io","gtm-kit"))))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Container code implementation:","gtm-kit"),options:[{label:(0,c.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,c.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,c.__)("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,c.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,c.__)("Just after the opening <body> tag","gtm-kit"),value:0},{label:(0,c.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,c.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,c.__)("Disable <noscript> implementation","gtm-kit"),value:3}],help:(0,c.__)('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(); } ?>")))))},he=()=>(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,c.__)("Post Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Post Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Specify which post data elements you wish to include in the dataLayer for use in Google Tag Manager.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Post type","gtm-kit"),id:"post-type",label:(0,c.__)("Include the type of the current post or archive page.","gtm-kit"),optionName:"datalayer_post_type"}),(0,e.createElement)(ce,{title:(0,c.__)("Page type","gtm-kit"),id:"page-type",label:(0,c.__)('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)(ce,{title:(0,c.__)("Categories","gtm-kit"),id:"categories",label:(0,c.__)("Include the categories of the current post or archive page.","gtm-kit"),optionName:"datalayer_categories"}),(0,e.createElement)(ce,{title:(0,c.__)("Tags","gtm-kit"),id:"tags",label:(0,c.__)("Include the tags of the current post or archive page.","gtm-kit"),optionName:"datalayer_tags"}),(0,e.createElement)(ce,{title:(0,c.__)("Post title","gtm-kit"),id:"post-title",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_title"}),(0,e.createElement)(ce,{title:(0,c.__)("Post ID","gtm-kit"),id:"post-id",label:(0,c.__)("Include the Post ID of the current post.","gtm-kit"),optionName:"datalayer_post_id"}),(0,e.createElement)(ce,{title:(0,c.__)("Post data","gtm-kit"),id:"post-date",label:(0,c.__)("Include the post date.","gtm-kit"),optionName:"datalayer_post_date"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author name","gtm-kit"),id:"post-author-name",label:(0,c.__)("Include the post author name.","gtm-kit"),optionName:"datalayer_post_author_name"}),(0,e.createElement)(ce,{title:(0,c.__)("Post author ID","gtm-kit"),id:"post-author-id",label:(0,c.__)("Include the post author ID.","gtm-kit"),optionName:"datalayer_post_author_id"})))),_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,c.__)("User Data","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Warning!","gtm-kit"),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("Including user data is not compatible with full page caching.","gtm-kit")),(0,e.createElement)("p",null,(0,c.__)("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)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("User Data Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Logged in","gtm-kit"),id:"logged-in",label:(0,c.__)("Include whether the user is logged in.","gtm-kit"),optionName:"datalayer_logged_in"}),(0,e.createElement)(ce,{title:(0,c.__)("User ID","gtm-kit"),id:"user-id",label:(0,c.__)("Include the user ID if the user is logged in.","gtm-kit"),optionName:"datalayer_user_id"}),(0,e.createElement)(ce,{title:(0,c.__)("User role","gtm-kit"),id:"user-role",label:(0,c.__)("Include the user role if the user is logged in.","gtm-kit"),optionName:"datalayer_user_role"})))),ke=()=>{const{useSettings:t}=(0,a.useContext)(g),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,c.__)("Google Consent Mode","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Activation","gtm-kit")},(0,e.createElement)("span",{className:"gtmkit-text-red-600 gtmkit-ml-2"},(0,c.__)("Warning!","gtm-kit"))),(0,e.createElement)(de.Content,{className:"gtmkit-space-y-2"},(0,e.createElement)("p",null,(0,c.__)("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,c.__)("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,c.__)("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,c.__)("See an example of how consent is updated","gtm-kit"))),(0,e.createElement)(ce,{title:(0,c.__)("Activate GCM settings","gtm-kit"),label:(0,c.__)("Choose this option if you would like to activate the default settings below","gtm-kit"),optionName:"gcm_default_settings"}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Consent Mode Default Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Ad Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to advertising","gtm-kit"),optionName:"gcm_ad_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Analytics Storage","gtm-kit"),label:(0,c.__)("Enables storage, such as cookies, related to analytics (for example, visit duration)","gtm-kit"),optionName:"gcm_analytics_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Functionality Storage","gtm-kit"),label:(0,c.__)("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)(ce,{title:(0,c.__)("Personalization Storage","gtm-kit"),label:(0,c.__)("Enables storage related to personalization such as video recommendations","gtm-kit"),optionName:"gcm_personalization_storage",disabled:n}),(0,e.createElement)(ce,{title:(0,c.__)("Security Storage","gtm-kit"),label:(0,c.__)("Enables storage related to security such as authentication functionality, fraud prevention, and other user protection","gtm-kit"),optionName:"gcm_security_storage",disabled:n}))))},fe=({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))),Ee=()=>{const{useSiteData:t}=(0,a.useContext)(g),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,c.__)("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,c.__)("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)(fe,{key:n,label:t.label,value:t.value,tag:t.tag})})))))},ve=()=>{const{}=(0,a.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,c.__)("Misc","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Help improve GTM Kit","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(Ee,null),(0,e.createElement)("p",{className:"gtmkit-my-4 gtmkit-mb-2 gtmkit-text-color-grey"},(0,c.__)("GTM Kit will never transmit any domain names or container ID's.","gtm-kit")),(0,e.createElement)(ce,{title:(0,c.__)("Share anonymous data","gtm-kit"),label:(0,c.__)("I agree to share anonymous data with the development team to help improve GTM Kit.","gtm-kit"),optionName:"analytics_active"}))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Logging and debugging","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Console log","gtm-kit"),label:(0,c.__)("Log helpful messages and warnings to the browser log.","gtm-kit"),optionName:"console_log"}))))},be=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(re,{title:(0,c.__)("Integrations","gtm-kit"),data:oe})),ye=({pluginName:t})=>(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,c.sprintf)((0,c.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(i.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,c.sprintf)((0,c.__)("Install %s","gtm-kit"),t)))),xe=({title:t,options:n,className:r="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:o="general",optionName:l,disabled:s=!1,help:m="",notSet:u=!1})=>{const{useSettings:d,useUpdateStateSettings:p}=(0,a.useContext)(g),h=u?[{label:(0,c.__)("(not set)","gtm-kit"),value:""},...n]:n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(i.SelectControl,{label:t,value:d&&d[o][l],options:h,className:r,onChange:t=>p(o,l,t),disabled:s,help:m}))},we=({pluginName:t,optionName:n,pluginInactive:a})=>(0,e.createElement)(de,{disabled:a},(0,e.createElement)(de.Header,{title:(0,c.sprintf)((0,c.__)("%s Integration","gtm-kit"),t)}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.sprintf)((0,c.__)("Track %s","gtm-kit"),t),label:(0,c.sprintf)((0,c.__)("Activate the %s integration","gtm-kit"),t),optionGroup:"integrations",optionName:n,disabled:a})));const Se=[{label:(0,c.__)("Retail","gtm-kit"),value:"retail"},{label:(0,c.__)("Education","gtm-kit"),value:"education"},{label:(0,c.__)("Flights","gtm-kit"),value:"flights"},{label:(0,c.__)("Hotel rental","gtm-kit"),value:"hotel_rental"},{label:(0,c.__)("Jobs","gtm-kit"),value:"jobs"},{label:(0,c.__)("Local deals","gtm-kit"),value:"local"},{label:(0,c.__)("Real estate","gtm-kit"),value:"real_estate"},{label:(0,c.__)("Travel","gtm-kit"),value:"travel"},{label:(0,c.__)("Custom","gtm-kit"),value:"custom"}];var Ne=()=>{const{useSettings:t}=(0,a.useContext)(g),n="WooCommerce",i=!window.gtmkitSettings.plugins.woocommerce,r=i||!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,c.__)("WooCommerce","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"woocommerce_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Brand","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_brand",options:window.gtmkitSettings.taxonomyOptions,help:(0,c.__)("Select the taxonomy that is used for product brands","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude shipping from revenue","gtm-kit"),label:(0,c.__)("Exclude shipping from revenue","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_exclude_shipping",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Event customization","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:"view_item_list (with product filter)",options:[{label:(0,c.__)("Push view_item_list when the list is updated using a product filter.","gtm-kit"),value:0},{label:(0,c.__)("Only only push view_item_list once per per page for each list.","gtm-kit"),value:1}],help:(0,c.__)("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:r}),(0,e.createElement)(ue,{title:"view_item",options:[{label:(0,c.__)("Only push view_item on the master product","gtm-kit"),value:0},{label:(0,c.__)("Push view_item on master and variation products (higher number of views).","gtm-kit"),value:1},{label:(0,c.__)("Only push view_item on variation products.","gtm-kit"),value:2}],help:(0,c.__)('When do you want to fire the "view_item" event on variable products?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_variable_product_tracking",disabled:r}),(0,e.createElement)(ue,{title:"add_shipping_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a shipment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_shipment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_shipment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_shipping_info",disabled:r}),(0,e.createElement)(ue,{title:"add_payment_info ",options:[{label:(0,c.__)("When the 'Place order' button is clicked","gtm-kit"),value:1},{label:(0,c.__)("When a payment method is selected with fallback to the 'Place order' button.","gtm-kit"),value:2},{label:(0,c.__)("Disable the 'add_payment_info' event.","gtm-kit"),value:0}],help:(0,c.__)('When do you want to fire the "add_payment_info" event?',"gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_payment_info",disabled:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"woocommerce_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include permalink structure","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include path of pages","gtm-kit"),label:(0,c.__)("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:r}))))},Ce=()=>{const{useSettings:t}=(0,a.useContext)(g),n="Contact Form 7",i=!window.gtmkitSettings.plugins.cf7,r=i||!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,c.__)("Contact Form 7","gtm-kit")),i?(0,e.createElement)(ye,{pluginName:n}):null,(0,e.createElement)(we,{pluginName:n,optionName:"cf7_integration",pluginInactive:i}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ue,{title:(0,c.__)("Load JavaScript","gtm-kit"),options:[{label:(0,c.__)("Only on pages where where the Contact Form 7 script is registered (recommended).","gtm-kit"),value:1},{label:(0,c.__)("On all pages","gtm-kit"),value:2}],help:(0,c.__)("Where do you want load the JavaScript?","gtm-kit"),optionGroup:"integrations",optionName:"cf7_load_js",disabled:r}))))},Te=()=>{const t="Easy Digital Downloads",n=!window.gtmkitSettings.plugins.edd,{useSettings:i}=(0,a.useContext)(g),r=n||!i.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,c.__)("Easy Digital Downloads","gtm-kit")),n?(0,e.createElement)(ye,{pluginName:t}):null,(0,e.createElement)(we,{pluginName:t,optionName:"edd_integration",pluginInactive:n}),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Basic Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Use SKU instead of ID","gtm-kit"),label:(0,c.__)("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:r}),(0,e.createElement)(ce,{title:(0,c.__)("Exclude tax","gtm-kit"),label:(0,c.__)("Exclude tax from prices and revenue","gtm-kit"),optionGroup:"integrations",optionName:"edd_exclude_tax",disabled:r}),(0,e.createElement)(ce,{title:(0,c.__)("Include customer data","gtm-kit"),label:(0,c.__)('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:r}))),(0,e.createElement)(de,{disabled:r},(0,e.createElement)(de.Header,{title:(0,c.__)("Google Ads Settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(xe,{title:(0,c.__)("Google Business Vertical","gtm-kit"),optionGroup:"integrations",optionName:"edd_google_business_vertical",options:Se,help:(0,c.__)("In order to use Google Ads Remarketing you must select your business type (vertical).","gtm-kit"),notSet:!0,disabled:r}),(0,e.createElement)(me,{title:(0,c.__)("Product ID prefix","gtm-kit"),optionGroup:"integrations",optionName:"edd_product_id_prefix",placeholder:(0,c.__)("Enter prefix …","gtm-kit"),help:(0,c.__)("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:r}))),(0,e.createElement)(de,{disabled:n},(0,e.createElement)(de.Header,{title:(0,c.__)("Advanced settings","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)(ce,{title:(0,c.__)("Dequeue the default JavaScript","gtm-kit"),label:(0,c.__)("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:r}))))},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,c.__)("Help","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Google Tag Manager templates","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,c.__)("Below you will find GTM container import files, with all the necessary tags, trigger, and variables to use Google Analytics 4.","gtm-kit"),(0,c.__)("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,c.__)("Read guide","gtm-kit"))),(0,e.createElement)("h4",{className:"gtmkit-font-bold"},(0,c.__)("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,c.__)("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,c.__)("Google Analytics 4 - eCommerce","gtm-kit")))))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Tutorials","gtm-kit")}),(0,e.createElement)(de.Content,null,(0,e.createElement)("ul",null,le.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)))))))))),De=()=>{const{useSiteData:t}=(0,a.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,c.__)("Get support","gtm-kit")),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("Support options","gtm-kit")}),(0,e.createElement)(de.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,c.__)("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,c.__)("GITHub repository","gtm-kit"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"https://gtmkit.com/",target:"_blank",rel:"noreferrer"},(0,c.__)("Plugin Homepage","gtm-kit"))," ","(gtmkit.com)")))),(0,e.createElement)(de,null,(0,e.createElement)(de.Header,{title:(0,c.__)("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,c.__)("Version:","gtm-kit")," ",t.gtmkit_version,")")),(0,e.createElement)(de.Content,null,(0,e.createElement)("p",null,(0,c.__)("You can see the changes of all versions in:","gtm-kit"),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://gtmkit.com/changelog/",target:"_blank",rel:"noreferrer"},(0,c.__)("The changelog","gtm-kit")),(0,e.createElement)("br",null),(0,e.createElement)("a",{className:"gtmkit-text-color-primary gtmkit-ml-2 hover:gtmkit-underline",href:"https://github.com/tlamedia/gtm-kit",target:"_blank",rel:"noreferrer"},(0,c.__)("The Github repository","gtm-kit"))))))};const Ie=()=>{const{useSettings:t}=(0,a.useContext)(g),n=window.gtmkitSettings.currentPage;return Object.keys(t).length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(It,{page:n}),(0,e.createElement)(Ot,{page:n}),(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)(se,null)}),(0,e.createElement)(ht,{exact:!0,path:"/container",element:(0,e.createElement)(pe,null)}),(0,e.createElement)(ht,{exact:!0,path:"/post-data",element:(0,e.createElement)(he,null)}),(0,e.createElement)(ht,{exact:!0,path:"/user-data",element:(0,e.createElement)(_e,null)}),(0,e.createElement)(ht,{exact:!0,path:"/google-consent-mode",element:(0,e.createElement)(ke,null)}),(0,e.createElement)(ht,{exact:!0,path:"/misc",element:(0,e.createElement)(ve,null)}),(0,e.createElement)(ht,{exact:!0,path:"/integrations",element:(0,e.createElement)(be,null)}),(0,e.createElement)(ht,{exact:!0,path:"/woocommerce",element:(0,e.createElement)(Ne,null)}),(0,e.createElement)(ht,{exact:!0,path:"/cf7",element:(0,e.createElement)(Ce,null)}),(0,e.createElement)(ht,{exact:!0,path:"/edd",element:(0,e.createElement)(Te,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)(De,null)}),(0,e.createElement)(ht,{path:"/",element:(0,e.createElement)(pt,{replace:!0,to:"/"+n})}))),(0,e.createElement)(ee,null)):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-h-screen gtmkit-flex gtmkit-items-center gtmkit-justify-center"},(0,e.createElement)(i.Spinner,null)))},Pe=()=>(0,e.createElement)(wt,{basename:"/"},(0,e.createElement)(p,null,(0,e.createElement)(Ie,null)));document.addEventListener("DOMContentLoaded",(()=>{void 0!==document.getElementById(window.gtmkitSettings.rootId)&&null!==document.getElementById(window.gtmkitSettings.rootId)&&(0,a.render)((0,e.createElement)(Pe,null),document.getElementById(window.gtmkitSettings.rootId))}))}(); -
gtm-kit/trunk/gtm-kit.php
r2996198 r2996217 4 4 * 5 5 * Plugin Name: GTM Kit 6 * Version: 1.16 6 * Version: 1.16.1 7 7 * Plugin URI: https://gtmkit.com/ 8 8 * Description: Google Tag Manager implementation focusing on flexibility and pagespeed. … … 28 28 } 29 29 30 const GTMKIT_VERSION = '1.16 ';30 const GTMKIT_VERSION = '1.16.1'; 31 31 32 32 if ( ! defined( 'GTMKIT_FILE' ) ) { -
gtm-kit/trunk/readme.txt
r2996198 r2996217 4 4 Tags: google tag manager, gtm, woocommerce, analytics, ga4, gtag, easy digital downloads 5 5 Tested up to: 6.4 6 Stable tag: 1.16 6 Stable tag: 1.16.1 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 89 89 == Changelog == 90 90 91 = 1.16.1 = 92 93 Release date: 2023-11-15 94 95 #### Bugfixes: 96 97 * Fix critical JS bug. 98 99 91 100 = 1.16 = 92 101
Note: See TracChangeset
for help on using the changeset viewer.