From 8810178cfc33584bac84d8881577bc2489559192 Mon Sep 17 00:00:00 2001 From: Torben Lundsgaard Date: Mon, 2 Oct 2023 16:12:19 +0200 Subject: [PATCH] Move assets to the folder assets --- {build => assets}/admin/settings.asset.php | 2 +- {build => assets}/admin/settings.css | 0 assets/admin/settings.js | 1 + {build => assets}/admin/wizard.asset.php | 0 {build => assets}/admin/wizard.css | 0 {build => assets}/admin/wizard.js | 0 .../frontend/woocommerce-blocks.asset.php | 0 {build => assets}/frontend/woocommerce-blocks.js | 0 assets/{js => integration}/contact-form-7.js | 0 assets/{js => integration}/edd-checkout.js | 0 assets/{js => integration}/edd.js | 0 assets/{js => integration}/woocommerce-checkout.js | 0 assets/{js => integration}/woocommerce.js | 0 build/admin/settings.js | 1 - package.json | 12 ++++++------ src/Admin/AbstractOptionsPage.php | 6 +++--- src/Admin/SetupWizard.php | 6 +++--- src/Common/Util.php | 4 ++-- src/Integration/ContactForm7.php | 2 +- src/Integration/EasyDigitalDownloads.php | 4 ++-- src/Integration/WooCommerce.php | 4 ++-- 21 files changed, 21 insertions(+), 21 deletions(-) rename {build => assets}/admin/settings.asset.php (74%) rename {build => assets}/admin/settings.css (100%) create mode 100644 assets/admin/settings.js rename {build => assets}/admin/wizard.asset.php (100%) rename {build => assets}/admin/wizard.css (100%) rename {build => assets}/admin/wizard.js (100%) rename {build => assets}/frontend/woocommerce-blocks.asset.php (100%) rename {build => assets}/frontend/woocommerce-blocks.js (100%) rename assets/{js => integration}/contact-form-7.js (100%) rename assets/{js => integration}/edd-checkout.js (100%) rename assets/{js => integration}/edd.js (100%) rename assets/{js => integration}/woocommerce-checkout.js (100%) rename assets/{js => integration}/woocommerce.js (100%) delete mode 100644 build/admin/settings.js diff --git a/build/admin/settings.asset.php b/assets/admin/settings.asset.php similarity index 74% rename from build/admin/settings.asset.php rename to assets/admin/settings.asset.php index 4c3c926..a47579d 100644 --- a/build/admin/settings.asset.php +++ b/assets/admin/settings.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '77ee83c4ea5024b59278'); + array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'ba69da201e2be1442d0d'); diff --git a/build/admin/settings.css b/assets/admin/settings.css similarity index 100% rename from build/admin/settings.css rename to assets/admin/settings.css diff --git a/assets/admin/settings.js b/assets/admin/settings.js new file mode 100644 index 0000000..1829def --- /dev/null +++ b/assets/admin/settings.js @@ -0,0 +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.wp.element,n=window.wp.components,a=window.lodash,i=window.wp.apiFetch,r=t.n(i);r().use(r().createNonceMiddleware(window.gtmkitSettings.nonce)),r().use(r().createRootURLMiddleware(window.gtmkitSettings.root));const o=async()=>{let t={};try{t=await r()({path:"gtmkit/v1/get-options",method:"POST"})}catch(t){return console.log("fetchSettings Errors:",t),{gtm_kit_settings_fetch_settings_errors:!0}}return!0===t.success?t.data:t},l=async()=>{let t={};try{t=await r()({path:"gtmkit/v1/get-site-data",method:"POST"})}catch(t){return console.log("fetchSiteData Errors:",t),{gtm_kit_settings_fetch_site_data_errors:!0}}return!0===t.success?t.data:t};var s=window.wp.i18n,m=(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,s.__)("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,s.__)("Saved Successfully.","gtm-kit"),i=!1;void 0!==e.payload.fetchedSettings.gtm_kit_settings_update_settings_errors&&(t=!0,a=(0,s.__)("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 c=(0,e.createContext)();var u,g=t=>{const[n,i]=(0,e.useReducer)(m,{fetchedSettings:{},stateSettings:{},isPending:!0,notice:"",hasError:"",canSave:!1}),s=async()=>{const[t,e]=await Promise.all([o(),l()]),n="wizard"===window.gtmkitSettings.currentPage?await(async()=>{let t={};try{t=await r()({path:"gtmkit/v1/get-install-data",method:"POST"})}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}})},u=async t=>{i({type:"UPDATE_STATE",payload:t})};(0,e.useEffect)((()=>{s()}),[]);const g={useDispatch:t=>{i(t)},useUpdateSettings:async()=>{i({type:"UPDATE_SETTINGS_BEFORE",payload:{isPending:!0}});const t=await(async t=>{let e={};try{e=await r()({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:s,useUpdateState:u,useUpdateStateSettings:async(t,e,i)=>{const r=JSON.parse(JSON.stringify(n.stateSettings));let o;r[t][e]=i,o=!(0,a.isEqual)(r,n.fetchedSettings),u({stateSettings:r,canSave:o})},useImportSettings:async(t,e)=>{const i=JSON.parse(JSON.stringify(n.stateSettings));let r;const o={};o.general={...i.general,...e.general},"integrations"in e&&(o.integrations={...i.integrations,...e.integrations}),r=!(0,a.isEqual)(o,n.fetchedSettings),u({stateSettings:o,canSave:r})},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)(c.Provider,{value:g},t.children)},d=window.React,p=t.n(d);function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e=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{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=B([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:O(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,P=2,G=1,I=10,D=-2,M=t=>"*"===t;function O(t,e){let n=t.split("/"),a=n.length;return n.some(M)&&(a+=D),e&&(a+=P),n.filter((t=>!M(t))).reduce(((t,e)=>t+(C.test(e)?T:""===e?G:I)),a)}function R(t,e){let{routesMeta:n}=t,a={},i="/",r=[];for(let t=0;t(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 W(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 and the router will parse it for you.'}function j(t){return t.filter(((t,e)=>0===e||t.route.path&&t.route.path.length>0))}function H(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("?"),W("?","pathname","search",i)),k(!i.pathname||!i.pathname.includes("#"),W("#","pathname","hash",i)),k(!i.search||!i.search.includes("#"),W("#","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 B=t=>t.join("/").replace(/\/\/+/g,"/"),F=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{n.current=!0})),d.useCallback((function(a,i){void 0===i&&(i={}),n.current&&("number"==typeof a?t.navigate(a):t.navigate(a,q({fromRouteId:e},i)))}),[t,e])}():function(){et()||k(!1);let t=d.useContext(V),{basename:e,navigator:n}=d.useContext(X),{matches:a}=d.useContext(Z),{pathname:i}=nt(),r=JSON.stringify(j(a).map((t=>t.pathnameBase))),o=d.useRef(!1);return at((()=>{o.current=!0})),d.useCallback((function(a,l){if(void 0===l&&(l={}),!o.current)return;if("number"==typeof a)return void n.go(a);let s=H(a,JSON.parse(r),i,"path"===l.relative);null==t&&"/"!==e&&(s.pathname="/"===s.pathname?e:B([e,s.pathname])),(l.replace?n.replace:n.push)(s,l.state,l)}),[e,n,r,i,t])}()}function rt(t,e){let{relative:n}=void 0===e?{}:e,{matches:a}=d.useContext(Z),{pathname:i}=nt(),r=JSON.stringify(j(a).map((t=>t.pathnameBase)));return d.useMemo((()=>H(t,JSON.parse(r),i,"path"===n)),[t,r,i,n])}function ot(t,e,n){et()||k(!1);let{navigator:a}=d.useContext(X),{matches:i}=d.useContext(Z),r=i[i.length-1],o=r?r.params:{},l=(r&&r.pathname,r?r.pathnameBase:"/");r&&r.route;let s,m=nt();if(e){var c;let t="string"==typeof e?y(e):e;"/"===l||(null==(c=t.pathname)?void 0:c.startsWith(l))||k(!1),s=t}else s=m;let g=s.pathname||"/",p=w(t,{pathname:"/"===l?g:g.slice(l.length)||"/"}),h=function(t,e,n){var a;if(void 0===e&&(e=[]),void 0===n&&(n=null),null==t){var i;if(null==(i=n)||!i.errors)return null;t=n.matches}let r=t,o=null==(a=n)?void 0:a.errors;if(null!=o){let t=r.findIndex((t=>t.route.id&&(null==o?void 0:o[t.route.id])));t>=0||k(!1),r=r.slice(0,Math.min(r.length,t+1))}return r.reduceRight(((t,a,i)=>{let l=a.route.id?null==o?void 0:o[a.route.id]:null,s=null;n&&(s=a.route.errorElement||st);let m=e.concat(r.slice(0,i+1)),c=()=>{let e;return e=l?s:a.route.Component?d.createElement(a.route.Component,null):a.route.element?a.route.element:t,d.createElement(ct,{match:a,routeContext:{outlet:t,matches:m,isDataRoute:null!=n},children:e})};return n&&(a.route.ErrorBoundary||a.route.errorElement||0===i)?d.createElement(mt,{location:n.location,revalidation:n.revalidation,component:s,error:l,children:c(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):c()}),null)}(p&&p.map((t=>Object.assign({},t,{params:Object.assign({},o,t.params),pathname:B([l,a.encodeLocation?a.encodeLocation(t.pathname).pathname:t.pathname]),pathnameBase:"/"===t.pathnameBase?l:B([l,a.encodeLocation?a.encodeLocation(t.pathnameBase).pathname:t.pathnameBase])}))),i,n);return e&&h?d.createElement(Q.Provider,{value:{location:q({pathname:"/",search:"",hash:"",state:null,key:"default"},s),navigationType:u.Pop}},h):h}function lt(){let t=function(){var t;let e=d.useContext(tt),n=function(t){let e=d.useContext(Y);return e||k(!1),e}(gt.UseRouteError),a=dt(gt.UseRouteError);return e||(null==(t=n.errors)?void 0:t[a])}(),e=function(t){return null!=t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"boolean"==typeof t.internal&&"data"in t}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},e),n?d.createElement("pre",{style:a},n):null,null)}const st=d.createElement(lt,null);class mt extends d.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?d.createElement(Z.Provider,{value:this.props.routeContext},d.createElement(tt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:e,match:n,children:a}=t,i=d.useContext(V);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),d.createElement(Z.Provider,{value:e},a)}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 e=function(t){let e=d.useContext(Z);return e||k(!1),e}(),n=e.matches[e.matches.length-1];return n.route.id||k(!1),n.route.id}function pt(t){let{to:e,replace:n,state:a,relative:i}=t;et()||k(!1);let{matches:r}=d.useContext(Z),{pathname:o}=nt(),l=it(),s=H(e,j(r).map((t=>t.pathnameBase)),o,"path"===i),m=JSON.stringify(s);return d.useEffect((()=>l(JSON.parse(m),{replace:n,state:a,relative:i})),[l,m,i,n,a]),null}function ht(t){k(!1)}function _t(t){let{basename:e="/",children:n=null,location:a,navigationType:i=u.Pop,navigator:r,static:o=!1}=t;et()&&k(!1);let l=e.replace(/^\/*/,"/"),s=d.useMemo((()=>({basename:l,navigator:r,static:o})),[l,r,o]);"string"==typeof a&&(a=y(a));let{pathname:m="/",search:c="",hash:g="",state:p=null,key:h="default"}=a,_=d.useMemo((()=>{let t=L(m,l);return null==t?null:{location:{pathname:t,search:c,hash:g,state:p,key:h},navigationType:i}}),[l,m,c,g,p,h,i]);return null==_?null:d.createElement(X.Provider,{value:s},d.createElement(Q.Provider,{children:n,value:_}))}function kt(t){let{children:e,location:n}=t;return ot(ft(e),n)}function ft(t,e){void 0===e&&(e=[]);let n=[];return d.Children.forEach(t,((t,a)=>{if(!d.isValidElement(t))return;let i=[...e,a];if(t.type===d.Fragment)return void n.push.apply(n,ft(t.props.children,i));t.type!==ht&&k(!1),t.props.index&&t.props.children&&k(!1);let r={id:t.props.id||i.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(r.children=ft(t.props.children,i)),n.push(r)})),n}function Et(){return Et=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(i[n]=t[n]);return i}d.startTransition,new Promise((()=>{})),d.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=d.startTransition;function wt(t){let{basename:e,children:n,future:a,window:i}=t,r=d.useRef();var o;null==r.current&&(r.current=(void 0===(o={window:i,v5Compat:!0})&&(o={}),function(t,e,n,a){void 0===a&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,o=i.history,l=u.Pop,s=null,m=c();function c(){return(o.state||{idx:null}).idx}function g(){l=u.Pop;let t=c(),e=null==t?null:t-m;m=t,s&&s({action:l,location:p.location,delta:e})}function d(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(_,g),s=t,()=>{i.removeEventListener(_,g),s=null}},createHref(t){return e(i,t)},createURL:d,encodeLocation(t){let e=d(t);return{pathname:e.pathname,search:e.search,hash:e.hash}},push:function(t,e){l=u.Push;let a=v(p.location,t,e);n&&n(a,t),m=c()+1;let g=E(a,m),d=p.createHref(a);try{o.pushState(g,"",d)}catch(t){if(t instanceof DOMException&&"DataCloneError"===t.name)throw t;i.location.assign(d)}r&&s&&s({action:l,location:p.location,delta:1})},replace:function(t,e){l=u.Replace;let a=v(p.location,t,e);n&&n(a,t),m=c();let i=E(a,m),g=p.createHref(a);o.replaceState(i,"",g),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)+")")}),o)));let l=r.current,[s,m]=d.useState({action:l.action,location:l.location}),{v7_startTransition:c}=a||{},g=d.useCallback((t=>{c&&xt?xt((()=>m(t))):m(t)}),[m,c]);return d.useLayoutEffect((()=>l.listen(g)),[l,g]),d.createElement(_t,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:l})}const St="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=d.forwardRef((function(t,e){let n,{onClick:a,relative:i,reloadDocument:r,replace:o,state:l,target:s,to:m,preventScrollReset:c}=t,u=vt(t,bt),{basename:g}=d.useContext(X),p=!1;if("string"==typeof m&&Nt.test(m)&&(n=m,St))try{let t=new URL(window.location.href),e=m.startsWith("//")?new URL(t.protocol+m):new URL(m),n=L(e.pathname,g);e.origin===t.origin&&null!=n?m=n+e.search+e.hash:p=!0}catch(t){}let h=function(t,e){let{relative:n}=void 0===e?{}:e;et()||k(!1);let{basename:a,navigator:i}=d.useContext(X),{hash:r,pathname:o,search:l}=rt(t,{relative:n}),s=o;return"/"!==a&&(s="/"===o?a:B([a,o])),i.createHref({pathname:s,search:l,hash:r})}(m,{relative:i}),_=function(t,e){let{target:n,replace:a,state:i,preventScrollReset:r,relative:o}=void 0===e?{}:e,l=it(),s=nt(),m=rt(t,{relative:o});return d.useCallback((e=>{if(function(t,e){return!(0!==t.button||e&&"_self"!==e||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t))}(e,n)){e.preventDefault();let n=void 0!==a?a:b(s)===b(m);l(t,{replace:n,state:i,preventScrollReset:r,relative:o})}}),[s,l,m,a,i,n,t,r,o])}(m,{replace:o,state:l,target:s,preventScrollReset:c,relative:i});return d.createElement("a",Et({},u,{href:n||h,onClick:p||r?a:function(t){a&&a(t),t.defaultPrevented||_(t)},ref:e,target:s}))})),Tt=d.forwardRef((function(t,e){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:r=!1,style:o,to:l,children:s}=t,m=vt(t,yt),c=rt(l,{relative:m.relative}),u=nt(),g=d.useContext(Y),{navigator:p}=d.useContext(X),h=p.encodeLocation?p.encodeLocation(c).pathname:c.pathname,_=u.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(_=_.toLowerCase(),k=k?k.toLowerCase():null,h=h.toLowerCase());let f,E=_===h||!r&&_.startsWith(h)&&"/"===_.charAt(h.length),v=null!=k&&(k===h||!r&&k.startsWith(h)&&"/"===k.charAt(h.length)),b=E?n:void 0;f="function"==typeof i?i({isActive:E,isPending:v}):[i,E?"active":null,v?"pending":null].filter(Boolean).join(" ");let y="function"==typeof o?o({isActive:E,isPending:v}):o;return d.createElement(Ct,Et({},m,{"aria-current":b,className:f,ref:e,style:y,to:l}),"function"==typeof s?s({isActive:E,isPending:v}):s)}));var Pt,Gt;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher"})(Pt||(Pt={})),function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"}(Gt||(Gt={}));var It=({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)),Dt=({page:t})=>(0,e.createElement)("nav",{className:"gtmkit-flex gtmkit-items-center gtmkit-px-8 gtmkit-border-y gtmkit-bg-white gtmkit-border-color-border gtmkit-text-sm gtmkit-space-x-8"},function({page:t}){const e=[{to:"general",title:(0,s.__)("Dashboard","gtm-kit")},{to:"container",title:(0,s.__)("Container","gtm-kit")},{to:"post-data",title:(0,s.__)("Post data","gtm-kit")},{to:"user-data",title:(0,s.__)("User data","gtm-kit")},{to:"google-consent-mode",title:(0,s.__)("Google Consent Mode","gtm-kit")},{to:"misc",title:(0,s.__)("Misc","gtm-kit")},{to:"whats-new",title:(0,s.__)("What's New","gtm-kit")}],n=[{to:"integrations",title:(0,s.__)("Integrations","gtm-kit")},{to:"woocommerce",title:"WooCommerce"},{to:"cf7",title:"Contact Form 7"},{to:"edd",title:"Easy Digital Downloads"}],a=[{to:"help",title:(0,s.__)("Help","gtm-kit")},{to:"support",title:(0,s.__)("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)(It,{to:t.to,title:t.title})}))),Mt=({page:t})=>{let n=(0,s.__)("Settings","gtm-kit");switch(t){case"general":n=(0,s.__)("Settings","gtm-kit");break;case"integrations":n=(0,s.__)("Integrations","gtm-kit");break;case"help":n=(0,s.__)("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))),(0,e.createElement)(Dt,{page:t}))};function Ot(){return Ot=Object.assign?Object.assign.bind():function(t){for(var e=1;e=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 Wt=window.ReactDOM,jt=t.n(Wt),Ht=p().createContext(null),Bt=function(t){return t.scrollTop},Ft="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?Ft:Kt,a.state={status:i},a.nextCallback=null,a}At(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Ft?{status:Kt}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==Jt&&n!==zt&&(e=Jt):n!==Jt&&n!==zt||(e=$t)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.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}},n.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:jt().findDOMNode(this);n&&Bt(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Kt&&this.setState({status:Ft})},n.performEnter=function(t){var e=this,n=this.props.enter,a=this.context?this.context.isMounting:t,i=this.props.nodeRef?[a]:[jt().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)}))},n.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),a=this.props.nodeRef?void 0:jt().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)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(a){n&&(n=!1,e.nextCallback=null,t(a))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:jt().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)},n.render=function(){var t=this.state.status;if(t===Ft)return null;var e=this.props,n=e.children,a=(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,Rt(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return p().createElement(Ht.Provider,{value:null},"function"==typeof n?n(t,a):p().cloneElement(p().Children.only(n),a))},e}(p().Component);function Vt(){}qt.contextType=Ht,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=Ft,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{const{useUpdateSettings:i,useIsPending:r,useCanSave:o}=(0,e.useContext)(c);return(0,e.createElement)(n.Button,{className:a,onClick:()=>i(),variant:"primary",disabled:r||!o},o?(0,s.__)(t,"gtm-kit"):(0,s.__)("Saved","gtm-kit"),r?(0,e.createElement)(n.Spinner,null):"")},ee=()=>{const{useCanSave:t}=(0,e.useContext)(c);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,s.__)("Active","gtm-kit"):(0,s.__)("Inactive","gtm-kit"))};const ae=(0,e.forwardRef)((({children:t,className:n="",...a},i)=>(0,e.createElement)("div",{...a,className:"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-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="group-hover:gtmkit-hidden",...i})=>(0,e.createElement)(t,{...i,className:a},n),ae.Button=({url:t,destination:a,newTab:i=!1,text:r,group:o="",...l})=>{const s=it();return(0,e.createElement)("div",{...l,className:"gtmkit-hidden group-hover:gtmkit-block"},(0,e.createElement)(n.Button,{variant:"primary",className:"gtmkit-rounded !gtmkit-py-4 !gtmkit-px-8 gtmkit-w-full",onClick:()=>{a&&t&&!1===i?window.gtmkitSettings.current_poage===o?s(a,{replace:!0}):window.location.href=t+"#"+a:t?i?window.open(t):window.location.href=t:s(a,{replace:!0})}},(0,e.createElement)("span",{className:"gtmkit-mx-auto gtmkit-text-sm gtmkit-font-bold"},r)))};var ie=ae,re=({title:t,data:n,className:a=""})=>{const{useSettings:i}=(0,e.useContext)(c);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] "+a},n.map((t=>!1===t.featured?null:(0,e.createElement)(ie,null,(0,e.createElement)(ie.Header,{title:t.title},t.pill?(0,e.createElement)(ne,{subject:i[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,s.__)("Read article","gtm-kit"),newTab:t.link.external,group:t.group}))))))};const oe=[{title:"Woocommerce",pill:!0,group:"integrations",option:"woocommerce_integration",text:[(0,s.__)("The #1 open source eCommerce platform built for WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/woocommerce",text:(0,s.__)("Setup integration","gtm-kit")}},{title:"Contact Form 7",pill:!0,group:"integrations",option:"cf7_integration",text:[(0,s.__)("Just another contact form plugin for WordPress. Simple but flexible","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/cf7",text:(0,s.__)("Setup integration","gtm-kit")}},{title:"Easy Digital Downloads",pill:!0,group:"integrations",option:"edd_integration",text:[(0,s.__)("Easy way to sell Digital Products With WordPress","gtm-kit")],link:{internal:!0,url:window.gtmkitSettings.integrationsUrl,destination:"/edd",text:(0,s.__)("Setup integration","gtm-kit")}}],le=[{title:"Getting started with GTM Kit",text:[(0,s.__)("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,s.__)("WooCommerce integration","gtm-kit"),text:[(0,s.__)("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,s.__)("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,s.__)("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,s.__)("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,s.__)("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,e.useContext)(c),n=le;return n.push({title:(0,s.__)("See all tutorials…","gtm-kit"),text:[(0,s.__)("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,s.__)("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,s.__)("Status","gtm-kit")),(0,e.createElement)("div",{className:"lg:gtmkit-flex 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,{className:"lg:gtmkit-w-1/2 2xl:gtmkit-w-1/3"},(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,s.__)("Container ID:","gtm-kit")," ",t&&t.general.gtm_id):(0,e.createElement)("p",null,(0,s.__)("The container is not active but the datalayer is generated.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/container",text:(0,s.__)("Edit container","gtm-kit")})),(0,e.createElement)(ie,{className:"lg:gtmkit-w-1/2 2xl:gtmkit-w-1/3"},(0,e.createElement)(ie.Header,{title:(0,s.__)("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,s.__)("Share anonymous data with the development team to help improve GTM Kit.","gtm-kit"))),(0,e.createElement)(ie.Button,{destination:"/misc",text:(0,s.__)("Share anonymous data","gtm-kit")}))),(0,e.createElement)(re,{title:(0,s.__)("Tutorials","gtm-kit"),data:n}),(0,e.createElement)(re,{title:(0,s.__)("Integrations","gtm-kit"),data:oe}))},me=({title:t,placeholder:a,help:i,className:r="gtmkit-settings-field-wrap gtmkit-py-4 gtmkit-max-w-md",optionGroup:o="general",optionName:l,pluginInactive:s})=>{const{useSettings:m,useUpdateStateSettings:u}=(0,e.useContext)(c);return(0,e.createElement)(n.TextControl,{label:t,placeholder:a,help:i,className:r,value:m&&m[o][l],onChange:t=>u(o,l,t),disabled:s})},ce=({title:t,label:a,optionGroup:i="general",optionName:r,disabled:o=!1})=>{const{useSettings:l,useUpdateStateSettings:s}=(0,e.useContext)(c);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"gtmkit-settings-field-wrap gtmkit-py-4"},(0,e.createElement)(n.BaseControl,{label:t},(0,e.createElement)(n.ToggleControl,{label:a,checked:!o&&l[i][r],onChange:()=>{s(i,r,!(l&&l[i][r]))},disabled:o}))))},ue=({title:t,options:a,help:i,className:r="gtmkit-settings-field-wrap gtmkit-py-4",optionGroup:o="general",optionName:l,disabled:s})=>{const{useSettings:m,useUpdateStateSettings:u}=(0,e.useContext)(c);return(0,e.createElement)(n.RadioControl,{label:t,options:a,help:i,className:r,selected:parseInt(m[o][l]),onChange:t=>u(o,l,t),disabled:s})},ge=({pluginName:t})=>(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,s.sprintf)((0,s.__)("%s is not active","gtm-kit"),t),className:"gtmkit-text-red-600"}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-6"},(0,s.sprintf)((0,s.__)("If you haven't installed and activated %s you must do that.","gtm-kit"),t)),(0,e.createElement)(n.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,s.sprintf)((0,s.__)("Install %s","gtm-kit"),t))));const de=(0,e.forwardRef)((({children:t,className:n="",disabled:a=!1,...i},r)=>(0,e.createElement)("div",{...i,className:"gtmkit-mb-12 gtmkit-border gtmkit-bg-white gtmkit-w-3/4 gtmkit-border-color-grey "+n+(a?"gtmkit-opacity-60":""),ref:r},t)));de.Header=({as:t="h3",title:n="",children:a,className:i="",...r})=>(0,e.createElement)(t,{...r,className:"gtmkit-font-bold gtmkit-text-lg gtmkit-px-8 gtmkit-py-4 gtmkit-border-b gtmkit-border-color-grey "+i},n,a),de.Content=({as:t="div",children:n,className:a="",...i})=>(0,e.createElement)(t,{...i,className:"gtmkit-px-8 gtmkit-py-6 "+a},n);var pe=de,he=()=>(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,s.__)("Google Tag Manager container","gtm-kit")),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,s.__)("Google Tag Manager container code","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)("p",{className:"gtmkit-mb-4"},(0,s.__)("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,s.__)("Container ID:","gtm-kit"),optionName:"gtm_id",placeholder:(0,s.__)("Enter Container ID","gtm-kit")}),(0,e.createElement)(ce,{title:(0,s.__)("Inject Container Code","gtm-kit"),label:(0,s.__)("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,s.__)("Just the container","gtm-kit"),label:(0,s.__)("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,s.__)("dataLayer variable name:","gtm-kit"),optionName:"datalayer_name",placeholder:"dataLayer",help:(0,s.__)("The default name of the data layer object is dataLayer. If you prefer to use a different name for your data layer, you may do.","gtm-kit")}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,s.__)("GTM Server Side","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(me,{title:(0,s.__)("GTM Server Side Domain:","gtm-kit"),optionName:"sgtm_domain",placeholder:(0,s.__)("Enter domain …","gtm-kit"),help:(0,s.__)("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,s.__)("sGTM container identifier:","gtm-kit"),optionName:"sgtm_container_identifier",placeholder:(0,s.__)("Enter loader name …","gtm-kit"),help:(0,s.__)("Only use if you are using a custom loader.","gtm-kit")}))),(0,e.createElement)(pe,null,(0,e.createElement)(pe.Header,{title:(0,s.__)("Container Code Implementation","gtm-kit")}),(0,e.createElement)(pe.Content,null,(0,e.createElement)(ue,{title:(0,s.__)("Container code implementation:","gtm-kit"),options:[{label:(0,s.__)("Standard implementation as recommended by Google (no delay)","gtm-kit"),value:0},{label:(0,s.__)("Load container when browser is idle (requestIdleCallback)","gtm-kit"),value:1}],help:(0,s.__)("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,s.__)("Container code noscript implementation:","gtm-kit"),options:[{label:(0,s.__)("Just after the opening tag","gtm-kit"),value:0},{label:(0,s.__)("Footer of the page (not recommended by Google)","gtm-kit"),value:1},{label:(0,s.__)("Custom (insert function in your template)","gtm-kit"),value:2},{label:(0,s.__)("Disable