Plugin Directory

Changeset 3365593


Ignore:
Timestamp:
09/22/2025 07:32:52 AM (5 months ago)
Author:
devnethr
Message:

v.1.5.1

Location:
easy-subscribe
Files:
490 added
2 deleted
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • easy-subscribe/tags/1.5.1/README.txt

    r3333420 r3365593  
    44Requires PHP: 7.4
    55Requires at least: 6.4
    6 Stable tag: 1.5.0
     6Stable tag: 1.5.1
    77Tested up to: 6.8
    88License: GPLv2 or later
     
    121121== Changelog ==
    122122
     123= 1.5.1 =
     124
     125*2025-09-22*
     126
     127* Fix: Ensure database tables are created properly on plugin activation
     128* Update: Freemius SDK updated to the latest version
     129
     130
    123131= 1.5.0 =
    124132
  • easy-subscribe/tags/1.5.1/admin/admin.php

    r3333420 r3365593  
    258258            'double_opt_in' => $request->get_param( 'double_opt_in' ),
    259259            'origin_url'    => $request->get_param( 'origin_url' ),
     260            'form_id'       => $request->get_param( 'form_id' ),
    260261        ];
    261262        // Return data as JSON
     
    337338                    'type'              => 'string',
    338339                    'sanitize_callback' => 'sanitize_url',
     340                    'validate_callback' => 'rest_validate_request_arg',
     341                    'required'          => false,
     342                ],
     343                'form_id'       => [
     344                    'type'              => 'string',
     345                    'sanitize_callback' => 'sanitize_text_field',
    339346                    'validate_callback' => 'rest_validate_request_arg',
    340347                    'required'          => false,
  • easy-subscribe/tags/1.5.1/assets/build/preview.asset.php

    r3288202 r3365593  
    1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'd71d095da75acacdd5c9');
     1<?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => '5903b0a0e4a0b307ebfb');
  • easy-subscribe/tags/1.5.1/assets/build/preview.js

    r3288202 r3365593  
    9999    `),Cc))),Pc=mr("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),Mc=mr("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${vo(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((({ownerState:e,theme:t})=>s({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})),(({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&Vr(wc||(wc=kc`
    100100      animation: ${0} 1.4s ease-in-out infinite;
    101     `),Rc))),Tc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=l(n,vc),m=s({},n,{color:o,disableShrink:i,size:a,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return _n({root:["root",n,`color${vo(r)}`],svg:["svg"],circle:["circle",`circle${vo(n)}`,o&&"circleDisableShrink"]},bc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((Ec-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,st.jsx)($c,s({className:Bn(h.root,r),style:s({width:a,height:a},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,st.jsx)(Pc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,st.jsx)(Mc,{className:h.circle,style:g,ownerState:m,cx:Ec,cy:Ec,r:(Ec-u)/2,fill:"none",strokeWidth:u})})}))})),Oc=Tc;function zc(e){return Yr("MuiAlert",e)}const Ic=Zr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function Ac(e){return Yr("MuiIconButton",e)}const Nc=Zr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),jc=["edge","children","className","color","disabled","disableFocusRipple","size"],Lc=mr(bo,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${vo(n.color)}`],n.edge&&t[`edge${vo(n.edge)}`],t[`size${vo(n.size)}`]]}})((({theme:e,ownerState:t})=>s({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return s({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&s({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":s({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Nc.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),Fc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=l(n,jc),f=s({},n,{edge:r,color:a,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return _n({root:["root",n&&"disabled","default"!==r&&`color${vo(r)}`,o&&`edge${vo(o)}`,`size${vo(i)}`]},Ac,t)})(f);return(0,st.jsx)(Lc,s({className:Bn(m.root,i),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Bc=Fc,Wc=dl((0,st.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),_c=dl((0,st.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Dc=dl((0,st.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Hc=dl((0,st.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Vc=dl((0,st.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),qc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Kc=mr(ys,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${vo(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?$e:Pe,r="light"===e.palette.mode?Pe:$e,o=t.color||t.severity;return s({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&s({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),Uc=mr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Gc=mr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Xc=mr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Yc={success:(0,st.jsx)(Wc,{fontSize:"inherit"}),warning:(0,st.jsx)(_c,{fontSize:"inherit"}),error:(0,st.jsx)(Dc,{fontSize:"inherit"}),info:(0,st.jsx)(Hc,{fontSize:"inherit"})},Zc=r.forwardRef((function(e,t){var n,r,o,i,a,c;const u=vr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Yc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=l(u,qc),$=s({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return _n({root:["root",`${t}${vo(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},zc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Bc,T=null!=(o=null!=(i=E.closeIcon)?i:g.CloseIcon)?o:Vc,O=null!=(a=k.closeButton)?a:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,st.jsxs)(Kc,s({role:S,elevation:0,ownerState:$,className:Bn(P.root,f),ref:t},R,{children:[!1!==v?(0,st.jsx)(Uc,{ownerState:$,className:P.icon,children:v||y[w]||Yc[w]}):null,(0,st.jsx)(Gc,{ownerState:$,className:P.message,children:p}),null!=d?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:(0,st.jsx)(M,s({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,st.jsx)(T,s({fontSize:"small"},z))}))}):null]}))})),Jc=Zc;function Qc({esubData:e}){const[t,n]=(0,i.useState)(!1),[o,a]=(0,i.useState)(""),[s,l]=(0,i.useState)(""),c=e.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=e.options.messages,R=e.preview,$=!(!t&&!o),P="1"==c.name_field,M="1"==c.last_name_field,T=uc(oc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(e,t,n="text")=>("esubEmail"===e&&({sm:2,xs:12}.sm=5),(0,r.createElement)(T,{item:!0,className:e,xs:"auto"},(0,r.createElement)(Rl,{required:!0,id:e+"Input",name:e,type:n,...p?{label:t}:{placeholder:t},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(cc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,r.createElement)(Hl,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,r.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,r.createElement)(Rl,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,r.createElement)(gc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,r.createElement)(cc,{sx:{}},(0,r.createElement)(cc,{component:"form",onSubmit:async t=>{if(t.preventDefault(),R)return!1;n(!0),a(""),l(!1);const r=new FormData(t.currentTarget),o={list:d,name:r.get("esubName"),last_name:r.get("esubLastName"),email:r.get("esubEmail"),double_opt_in:y,origin_url:window.location.href};if(r.get("esubSubject"))return a("spam"),n(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",e.rest_nonce,o).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));n(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,r.createElement)(oc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,r.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,r.createElement)(Mo,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,r.createElement)(cc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:t||o?"block":"none"}},t&&(0,r.createElement)(Oc,{sx:{marginBottom:2}}),o&&"created"===o&&!0===s&&(0,r.createElement)(Jc,{severity:"warning"},C),o&&"created"===o&&!s&&(0,r.createElement)(Jc,{severity:"success"},w),o&&"exists"===o&&(0,r.createElement)(Jc,{severity:"warning"},S),o&&"spam"===o&&(0,r.createElement)(Jc,{severity:"error"},k),o&&"error"===o&&(0,r.createElement)(Jc,{severity:"error"},E)))))}function eu({emotionRoot:e,data:t}){const[n,o]=(0,i.useState)(t||{});if(n.preview){const e=n.options.form.id,t=(0,i.useCallback)((t=>{const{name:r,type:i,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=r.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...n};t.options.form[e]="checkbox"===i?s:a,o(t)}}),[n]);(0,i.useEffect)((()=>{const r=document.querySelector(`#${e} form`),i=r.querySelectorAll('input[type="checkbox"]'),a=r.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return r.addEventListener("input",s),i.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),r.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const r=window.getComputedStyle(t).backgroundColor,i=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...n};a.options.form[i]=r,o(a)}}),0)}})),()=>{r.removeEventListener("input",s),i.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),r.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=dn({key:"css",prepend:!0,container:e});if(!n.allowed){const{form:e}=n.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=n.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=rt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,r.createElement)(Pn,{value:a},(0,r.createElement)(Ln,{theme:b},(0,r.createElement)(Qc,{esubData:n})))}const tu=devnet_esub_script;let nu=Object.keys(tu.options.forms);function ru(e,t,n){if(!e)return;const o=e.querySelector(".esub-form");if(!o||o.shadowRoot)return;t.options.form=t.options.forms[n],t.options.form.id=n;const s=o.attachShadow({mode:"open"}),l=document.createElement("style");t.allowed&&(l.textContent=t.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),a.s(c).render((0,r.createElement)(i.StrictMode,null,(0,r.createElement)(eu,{emotionRoot:l,data:t})))}tu.allowed||(nu=["devnet_esub_form"]),nu.forEach((e=>{const t=JSON.parse(JSON.stringify(tu)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){ru(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{ru(n,t,e)}))}}))},679:(e,t,n)=>{var r=n(296),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=l(t),h=l(n),g=0;g<a.length;++g){var b=a[g];if(!(i[b]||r&&r[b]||h&&h[b]||s&&s[b])){var v=p(n,b);try{c(t,b,v)}catch(e){}}}}return t}},103:(e,t)=>{var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case h:case l:return e;default:return t}}case o:return t}}}function w(e){return S(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return w(e)||S(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===p},t.isFragment=function(e){return S(e)===i},t.isLazy=function(e){return S(e)===g},t.isMemo=function(e){return S(e)===h},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===s},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===s||e===a||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===y||e.$$typeof===x||e.$$typeof===b)},t.typeOf=S},296:(e,t,n)=>{e.exports=n(103)},745:(e,t,n)=>{var r=n(850);t.s=r.createRoot,r.hydrateRoot},921:(e,t)=>{var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case s:case a:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case c:case d:case h:case m:case l:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference")},864:(e,t,n)=>{n(921)},251:(e,t,n)=>{var r=n(196),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:s.current}}t.jsx=c,t.jsxs=c},893:(e,t,n)=>{e.exports=n(251)},196:e=>{e.exports=window.React},850:e=>{e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{n(260);document.querySelectorAll(".esub-preview-button").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault();const t="preview--"+this.getAttribute("data-id");document.getElementById(t).parentNode.classList.toggle("show")}))}));document.querySelectorAll(".esub-preview-close").forEach((function(e){e.addEventListener("click",(function(e){const t=this.closest(".esub-preview-wrap");t&&t.classList.remove("show")}))}));document.querySelectorAll(".esub-preview-bg-color-box").forEach((function(e){e.addEventListener("click",(function(e){const t=window.getComputedStyle(this).getPropertyValue("background-color"),n=this.closest(".esub-preview-wrap");n&&(n.style.backgroundColor=t)}))}))})()})();
     101    `),Rc))),Tc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=l(n,vc),m=s({},n,{color:o,disableShrink:i,size:a,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return _n({root:["root",n,`color${vo(r)}`],svg:["svg"],circle:["circle",`circle${vo(n)}`,o&&"circleDisableShrink"]},bc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((Ec-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,st.jsx)($c,s({className:Bn(h.root,r),style:s({width:a,height:a},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,st.jsx)(Pc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,st.jsx)(Mc,{className:h.circle,style:g,ownerState:m,cx:Ec,cy:Ec,r:(Ec-u)/2,fill:"none",strokeWidth:u})})}))})),Oc=Tc;function zc(e){return Yr("MuiAlert",e)}const Ic=Zr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function Ac(e){return Yr("MuiIconButton",e)}const Nc=Zr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),jc=["edge","children","className","color","disabled","disableFocusRipple","size"],Lc=mr(bo,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${vo(n.color)}`],n.edge&&t[`edge${vo(n.edge)}`],t[`size${vo(n.size)}`]]}})((({theme:e,ownerState:t})=>s({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return s({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&s({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":s({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Nc.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),Fc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=l(n,jc),f=s({},n,{edge:r,color:a,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return _n({root:["root",n&&"disabled","default"!==r&&`color${vo(r)}`,o&&`edge${vo(o)}`,`size${vo(i)}`]},Ac,t)})(f);return(0,st.jsx)(Lc,s({className:Bn(m.root,i),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Bc=Fc,Wc=dl((0,st.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),_c=dl((0,st.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Dc=dl((0,st.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Hc=dl((0,st.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Vc=dl((0,st.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),qc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Kc=mr(ys,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${vo(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?$e:Pe,r="light"===e.palette.mode?Pe:$e,o=t.color||t.severity;return s({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&s({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),Uc=mr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Gc=mr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Xc=mr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Yc={success:(0,st.jsx)(Wc,{fontSize:"inherit"}),warning:(0,st.jsx)(_c,{fontSize:"inherit"}),error:(0,st.jsx)(Dc,{fontSize:"inherit"}),info:(0,st.jsx)(Hc,{fontSize:"inherit"})},Zc=r.forwardRef((function(e,t){var n,r,o,i,a,c;const u=vr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Yc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=l(u,qc),$=s({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return _n({root:["root",`${t}${vo(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},zc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Bc,T=null!=(o=null!=(i=E.closeIcon)?i:g.CloseIcon)?o:Vc,O=null!=(a=k.closeButton)?a:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,st.jsxs)(Kc,s({role:S,elevation:0,ownerState:$,className:Bn(P.root,f),ref:t},R,{children:[!1!==v?(0,st.jsx)(Uc,{ownerState:$,className:P.icon,children:v||y[w]||Yc[w]}):null,(0,st.jsx)(Gc,{ownerState:$,className:P.message,children:p}),null!=d?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:(0,st.jsx)(M,s({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,st.jsx)(T,s({fontSize:"small"},z))}))}):null]}))})),Jc=Zc;function Qc({esubData:e}){const[t,n]=(0,i.useState)(!1),[o,a]=(0,i.useState)(""),[s,l]=(0,i.useState)(""),c=e.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=e.options.messages,R=e.preview,$=!(!t&&!o),P="1"==c.name_field,M="1"==c.last_name_field,T=uc(oc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(e,t,n="text")=>("esubEmail"===e&&({sm:2,xs:12}.sm=5),(0,r.createElement)(T,{item:!0,className:e,xs:"auto"},(0,r.createElement)(Rl,{required:!0,id:e+"Input",name:e,type:n,...p?{label:t}:{placeholder:t},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(cc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,r.createElement)(Hl,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,r.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,r.createElement)(Rl,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,r.createElement)(gc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,r.createElement)(cc,{sx:{}},(0,r.createElement)(cc,{component:"form",onSubmit:async t=>{if(t.preventDefault(),R)return!1;n(!0),a(""),l(!1);const r=new FormData(t.currentTarget),o={list:d,name:r.get("esubName"),last_name:r.get("esubLastName"),email:r.get("esubEmail"),double_opt_in:y,origin_url:window.location.href,form_id:u};if(r.get("esubSubject"))return a("spam"),n(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",e.rest_nonce,o).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));n(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,r.createElement)(oc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,r.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,r.createElement)(Mo,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,r.createElement)(cc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:t||o?"block":"none"}},t&&(0,r.createElement)(Oc,{sx:{marginBottom:2}}),o&&"created"===o&&!0===s&&(0,r.createElement)(Jc,{severity:"warning"},C),o&&"created"===o&&!s&&(0,r.createElement)(Jc,{severity:"success"},w),o&&"exists"===o&&(0,r.createElement)(Jc,{severity:"warning"},S),o&&"spam"===o&&(0,r.createElement)(Jc,{severity:"error"},k),o&&"error"===o&&(0,r.createElement)(Jc,{severity:"error"},E)))))}function eu({emotionRoot:e,data:t}){const[n,o]=(0,i.useState)(t||{});if(n.preview){const e=n.options.form.id,t=(0,i.useCallback)((t=>{const{name:r,type:i,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=r.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...n};t.options.form[e]="checkbox"===i?s:a,o(t)}}),[n]);(0,i.useEffect)((()=>{const r=document.querySelector(`#${e} form`),i=r.querySelectorAll('input[type="checkbox"]'),a=r.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return r.addEventListener("input",s),i.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),r.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const r=window.getComputedStyle(t).backgroundColor,i=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...n};a.options.form[i]=r,o(a)}}),0)}})),()=>{r.removeEventListener("input",s),i.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),r.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=dn({key:"css",prepend:!0,container:e});if(!n.allowed){const{form:e}=n.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=n.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=rt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,r.createElement)(Pn,{value:a},(0,r.createElement)(Ln,{theme:b},(0,r.createElement)(Qc,{esubData:n})))}const tu=devnet_esub_script;let nu=Object.keys(tu.options.forms);function ru(e,t,n){if(!e)return;const o=e.querySelector(".esub-form");if(!o||o.shadowRoot)return;t.options.form=t.options.forms[n],t.options.form.id=n;const s=o.attachShadow({mode:"open"}),l=document.createElement("style");t.allowed&&(l.textContent=t.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),a.s(c).render((0,r.createElement)(i.StrictMode,null,(0,r.createElement)(eu,{emotionRoot:l,data:t})))}tu.allowed||(nu=["devnet_esub_form"]),nu.forEach((e=>{const t=JSON.parse(JSON.stringify(tu)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){ru(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{ru(n,t,e)}))}}))},679:(e,t,n)=>{var r=n(296),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=l(t),h=l(n),g=0;g<a.length;++g){var b=a[g];if(!(i[b]||r&&r[b]||h&&h[b]||s&&s[b])){var v=p(n,b);try{c(t,b,v)}catch(e){}}}}return t}},103:(e,t)=>{var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case h:case l:return e;default:return t}}case o:return t}}}function w(e){return S(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return w(e)||S(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===p},t.isFragment=function(e){return S(e)===i},t.isLazy=function(e){return S(e)===g},t.isMemo=function(e){return S(e)===h},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===s},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===s||e===a||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===y||e.$$typeof===x||e.$$typeof===b)},t.typeOf=S},296:(e,t,n)=>{e.exports=n(103)},745:(e,t,n)=>{var r=n(850);t.s=r.createRoot,r.hydrateRoot},921:(e,t)=>{var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case s:case a:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case c:case d:case h:case m:case l:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference")},864:(e,t,n)=>{n(921)},251:(e,t,n)=>{var r=n(196),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:s.current}}t.jsx=c,t.jsxs=c},893:(e,t,n)=>{e.exports=n(251)},196:e=>{e.exports=window.React},850:e=>{e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{n(260);document.querySelectorAll(".esub-preview-button").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault();const t="preview--"+this.getAttribute("data-id");document.getElementById(t).parentNode.classList.toggle("show")}))}));document.querySelectorAll(".esub-preview-close").forEach((function(e){e.addEventListener("click",(function(e){const t=this.closest(".esub-preview-wrap");t&&t.classList.remove("show")}))}));document.querySelectorAll(".esub-preview-bg-color-box").forEach((function(e){e.addEventListener("click",(function(e){const t=window.getComputedStyle(this).getPropertyValue("background-color"),n=this.closest(".esub-preview-wrap");n&&(n.style.backgroundColor=t)}))}))})()})();
  • easy-subscribe/tags/1.5.1/assets/build/public.asset.php

    r3288202 r3365593  
    1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => '4c12d06a4807999af9f5');
     1<?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'ca393b8b241fe74ab885');
  • easy-subscribe/tags/1.5.1/assets/build/public.js

    r3288202 r3365593  
    9999    `),kc))),Rc=pr("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),$c=pr("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${go(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((({ownerState:e,theme:t})=>i({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})),(({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&Dr(xc||(xc=Sc`
    100100      animation: ${0} 1.4s ease-in-out infinite;
    101     `),Ec))),Pc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:s=!1,size:l=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=a(n,gc),m=i({},n,{color:o,disableShrink:s,size:l,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Bn({root:["root",n,`color${go(r)}`],svg:["svg"],circle:["circle",`circle${go(n)}`,o&&"circleDisableShrink"]},hc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((wc-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,it.jsx)(Cc,i({className:Ln(h.root,r),style:i({width:l,height:l},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,it.jsx)(Rc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,it.jsx)($c,{className:h.circle,style:g,ownerState:m,cx:wc,cy:wc,r:(wc-u)/2,fill:"none",strokeWidth:u})})}))})),Mc=Pc;function Tc(e){return Gr("MuiAlert",e)}const Oc=Xr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function zc(e){return Gr("MuiIconButton",e)}const Ic=Xr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Ac=["edge","children","className","color","disabled","disableFocusRipple","size"],Nc=pr(ho,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${go(n.color)}`],n.edge&&t[`edge${go(n.edge)}`],t[`size${go(n.size)}`]]}})((({theme:e,ownerState:t})=>i({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return i({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&i({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":i({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Ic.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),jc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:s,color:l="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=a(n,Ac),f=i({},n,{edge:r,color:l,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return Bn({root:["root",n&&"disabled","default"!==r&&`color${go(r)}`,o&&`edge${go(o)}`,`size${go(i)}`]},zc,t)})(f);return(0,it.jsx)(Nc,i({className:Ln(m.root,s),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Lc=jc,Fc=cl((0,it.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Bc=cl((0,it.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Wc=cl((0,it.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),_c=cl((0,it.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Dc=cl((0,it.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Hc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Vc=pr(bs,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${go(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?Ce:Re,r="light"===e.palette.mode?Re:Ce,o=t.color||t.severity;return i({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&i({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),qc=pr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Kc=pr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Uc=pr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Gc={success:(0,it.jsx)(Fc,{fontSize:"inherit"}),warning:(0,it.jsx)(Bc,{fontSize:"inherit"}),error:(0,it.jsx)(Wc,{fontSize:"inherit"}),info:(0,it.jsx)(_c,{fontSize:"inherit"})},Xc=e.forwardRef((function(e,t){var n,r,o,s,l,c;const u=gr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Gc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=a(u,Hc),$=i({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return Bn({root:["root",`${t}${go(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},Tc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Lc,T=null!=(o=null!=(s=E.closeIcon)?s:g.CloseIcon)?o:Dc,O=null!=(l=k.closeButton)?l:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,it.jsxs)(Vc,i({role:S,elevation:0,ownerState:$,className:Ln(P.root,f),ref:t},R,{children:[!1!==v?(0,it.jsx)(qc,{ownerState:$,className:P.icon,children:v||y[w]||Gc[w]}):null,(0,it.jsx)(Kc,{ownerState:$,className:P.message,children:p}),null!=d?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:(0,it.jsx)(M,i({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,it.jsx)(T,i({fontSize:"small"},z))}))}):null]}))})),Yc=Xc;function Zc({esubData:t}){const[n,o]=(0,r.useState)(!1),[i,a]=(0,r.useState)(""),[s,l]=(0,r.useState)(""),c=t.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=t.options.messages,R=t.preview,$=!(!n&&!i),P="1"==c.name_field,M="1"==c.last_name_field,T=lc(nc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(t,n,r="text")=>("esubEmail"===t&&({sm:2,xs:12}.sm=5),(0,e.createElement)(T,{item:!0,className:t,xs:"auto"},(0,e.createElement)(El,{required:!0,id:t+"Input",name:t,type:r,...p?{label:n}:{placeholder:n},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(sc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,e.createElement)(_l,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,e.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,e.createElement)(El,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,e.createElement)(mc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,e.createElement)(sc,{sx:{}},(0,e.createElement)(sc,{component:"form",onSubmit:async e=>{if(e.preventDefault(),R)return!1;o(!0),a(""),l(!1);const n=new FormData(e.currentTarget),r={list:d,name:n.get("esubName"),last_name:n.get("esubLastName"),email:n.get("esubEmail"),double_opt_in:y,origin_url:window.location.href};if(n.get("esubSubject"))return a("spam"),o(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",t.rest_nonce,r).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));o(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,e.createElement)(nc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,e.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,e.createElement)($o,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,e.createElement)(sc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:n||i?"block":"none"}},n&&(0,e.createElement)(Mc,{sx:{marginBottom:2}}),i&&"created"===i&&!0===s&&(0,e.createElement)(Yc,{severity:"warning"},C),i&&"created"===i&&!s&&(0,e.createElement)(Yc,{severity:"success"},w),i&&"exists"===i&&(0,e.createElement)(Yc,{severity:"warning"},S),i&&"spam"===i&&(0,e.createElement)(Yc,{severity:"error"},k),i&&"error"===i&&(0,e.createElement)(Yc,{severity:"error"},E)))))}function Jc({emotionRoot:t,data:n}){const[o,i]=(0,r.useState)(n||{});if(o.preview){const e=o.options.form.id,t=(0,r.useCallback)((t=>{const{name:n,type:r,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=n.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...o};t.options.form[e]="checkbox"===r?s:a,i(t)}}),[o]);(0,r.useEffect)((()=>{const n=document.querySelector(`#${e} form`),r=n.querySelectorAll('input[type="checkbox"]'),a=n.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return n.addEventListener("input",s),r.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),n.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const n=window.getComputedStyle(t).backgroundColor,r=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...o};a.options.form[r]=n,i(a)}}),0)}})),()=>{n.removeEventListener("input",s),r.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),n.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=cn({key:"css",prepend:!0,container:t});if(!o.allowed){const{form:e}=o.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=o.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=tt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,e.createElement)(Rn,{value:a},(0,e.createElement)(Nn,{theme:b},(0,e.createElement)(Zc,{esubData:o})))}const Qc=devnet_esub_script;let eu=Object.keys(Qc.options.forms);function tu(t,n,i){if(!t)return;const a=t.querySelector(".esub-form");if(!a||a.shadowRoot)return;n.options.form=n.options.forms[i],n.options.form.id=i;const s=a.attachShadow({mode:"open"}),l=document.createElement("style");n.allowed&&(l.textContent=n.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),o.s(c).render((0,e.createElement)(r.StrictMode,null,(0,e.createElement)(Jc,{emotionRoot:l,data:n})))}Qc.allowed||(eu=["devnet_esub_form"]),eu.forEach((e=>{const t=JSON.parse(JSON.stringify(Qc)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){tu(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{tu(n,t,e)}))}}))})()})();
     101    `),Ec))),Pc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:s=!1,size:l=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=a(n,gc),m=i({},n,{color:o,disableShrink:s,size:l,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Bn({root:["root",n,`color${go(r)}`],svg:["svg"],circle:["circle",`circle${go(n)}`,o&&"circleDisableShrink"]},hc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((wc-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,it.jsx)(Cc,i({className:Ln(h.root,r),style:i({width:l,height:l},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,it.jsx)(Rc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,it.jsx)($c,{className:h.circle,style:g,ownerState:m,cx:wc,cy:wc,r:(wc-u)/2,fill:"none",strokeWidth:u})})}))})),Mc=Pc;function Tc(e){return Gr("MuiAlert",e)}const Oc=Xr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function zc(e){return Gr("MuiIconButton",e)}const Ic=Xr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Ac=["edge","children","className","color","disabled","disableFocusRipple","size"],Nc=pr(ho,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${go(n.color)}`],n.edge&&t[`edge${go(n.edge)}`],t[`size${go(n.size)}`]]}})((({theme:e,ownerState:t})=>i({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return i({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&i({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":i({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Ic.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),jc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:s,color:l="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=a(n,Ac),f=i({},n,{edge:r,color:l,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return Bn({root:["root",n&&"disabled","default"!==r&&`color${go(r)}`,o&&`edge${go(o)}`,`size${go(i)}`]},zc,t)})(f);return(0,it.jsx)(Nc,i({className:Ln(m.root,s),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Lc=jc,Fc=cl((0,it.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Bc=cl((0,it.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Wc=cl((0,it.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),_c=cl((0,it.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Dc=cl((0,it.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Hc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Vc=pr(bs,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${go(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?Ce:Re,r="light"===e.palette.mode?Re:Ce,o=t.color||t.severity;return i({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&i({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),qc=pr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Kc=pr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Uc=pr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Gc={success:(0,it.jsx)(Fc,{fontSize:"inherit"}),warning:(0,it.jsx)(Bc,{fontSize:"inherit"}),error:(0,it.jsx)(Wc,{fontSize:"inherit"}),info:(0,it.jsx)(_c,{fontSize:"inherit"})},Xc=e.forwardRef((function(e,t){var n,r,o,s,l,c;const u=gr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Gc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=a(u,Hc),$=i({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return Bn({root:["root",`${t}${go(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},Tc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Lc,T=null!=(o=null!=(s=E.closeIcon)?s:g.CloseIcon)?o:Dc,O=null!=(l=k.closeButton)?l:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,it.jsxs)(Vc,i({role:S,elevation:0,ownerState:$,className:Ln(P.root,f),ref:t},R,{children:[!1!==v?(0,it.jsx)(qc,{ownerState:$,className:P.icon,children:v||y[w]||Gc[w]}):null,(0,it.jsx)(Kc,{ownerState:$,className:P.message,children:p}),null!=d?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:(0,it.jsx)(M,i({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,it.jsx)(T,i({fontSize:"small"},z))}))}):null]}))})),Yc=Xc;function Zc({esubData:t}){const[n,o]=(0,r.useState)(!1),[i,a]=(0,r.useState)(""),[s,l]=(0,r.useState)(""),c=t.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=t.options.messages,R=t.preview,$=!(!n&&!i),P="1"==c.name_field,M="1"==c.last_name_field,T=lc(nc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(t,n,r="text")=>("esubEmail"===t&&({sm:2,xs:12}.sm=5),(0,e.createElement)(T,{item:!0,className:t,xs:"auto"},(0,e.createElement)(El,{required:!0,id:t+"Input",name:t,type:r,...p?{label:n}:{placeholder:n},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(sc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,e.createElement)(_l,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,e.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,e.createElement)(El,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,e.createElement)(mc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,e.createElement)(sc,{sx:{}},(0,e.createElement)(sc,{component:"form",onSubmit:async e=>{if(e.preventDefault(),R)return!1;o(!0),a(""),l(!1);const n=new FormData(e.currentTarget),r={list:d,name:n.get("esubName"),last_name:n.get("esubLastName"),email:n.get("esubEmail"),double_opt_in:y,origin_url:window.location.href,form_id:u};if(n.get("esubSubject"))return a("spam"),o(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",t.rest_nonce,r).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));o(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,e.createElement)(nc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,e.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,e.createElement)($o,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,e.createElement)(sc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:n||i?"block":"none"}},n&&(0,e.createElement)(Mc,{sx:{marginBottom:2}}),i&&"created"===i&&!0===s&&(0,e.createElement)(Yc,{severity:"warning"},C),i&&"created"===i&&!s&&(0,e.createElement)(Yc,{severity:"success"},w),i&&"exists"===i&&(0,e.createElement)(Yc,{severity:"warning"},S),i&&"spam"===i&&(0,e.createElement)(Yc,{severity:"error"},k),i&&"error"===i&&(0,e.createElement)(Yc,{severity:"error"},E)))))}function Jc({emotionRoot:t,data:n}){const[o,i]=(0,r.useState)(n||{});if(o.preview){const e=o.options.form.id,t=(0,r.useCallback)((t=>{const{name:n,type:r,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=n.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...o};t.options.form[e]="checkbox"===r?s:a,i(t)}}),[o]);(0,r.useEffect)((()=>{const n=document.querySelector(`#${e} form`),r=n.querySelectorAll('input[type="checkbox"]'),a=n.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return n.addEventListener("input",s),r.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),n.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const n=window.getComputedStyle(t).backgroundColor,r=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...o};a.options.form[r]=n,i(a)}}),0)}})),()=>{n.removeEventListener("input",s),r.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),n.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=cn({key:"css",prepend:!0,container:t});if(!o.allowed){const{form:e}=o.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=o.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=tt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,e.createElement)(Rn,{value:a},(0,e.createElement)(Nn,{theme:b},(0,e.createElement)(Zc,{esubData:o})))}const Qc=devnet_esub_script;let eu=Object.keys(Qc.options.forms);function tu(t,n,i){if(!t)return;const a=t.querySelector(".esub-form");if(!a||a.shadowRoot)return;n.options.form=n.options.forms[i],n.options.form.id=i;const s=a.attachShadow({mode:"open"}),l=document.createElement("style");n.allowed&&(l.textContent=n.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),o.s(c).render((0,e.createElement)(r.StrictMode,null,(0,e.createElement)(Jc,{emotionRoot:l,data:n})))}Qc.allowed||(eu=["devnet_esub_form"]),eu.forEach((e=>{const t=JSON.parse(JSON.stringify(Qc)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){tu(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{tu(n,t,e)}))}}))})()})();
  • easy-subscribe/tags/1.5.1/easy-subscribe.php

    r3333420 r3365593  
    44 * Plugin Name:       Easy Subscribe
    55 * Description:       Easy way to integrate the form and collect subscribers.
    6  * Version:           1.5.0
     6 * Version:           1.5.1
    77 * Author:            Devnet
    88 * Author URI:        https://devnet.hr
     
    2828            if ( !isset( $devnet_esub_fs ) ) {
    2929                // Include Freemius SDK.
    30                 require_once dirname( __FILE__ ) . '/fs/freemius/start.php';
     30                require_once __DIR__ . '/vendor/freemius/wordpress-sdk/start.php';
    3131                $devnet_esub_fs = fs_dynamic_init( [
    3232                    'id'             => '14904',
     
    8585
    8686    }
     87    if ( !function_exists( 'devnet_esub_fs_custom_icon' ) ) {
     88        function devnet_esub_fs_custom_icon() {
     89            return dirname( __FILE__ ) . '/assets/images/logo.png';
     90        }
     91
     92    }
    8793    /*
    8894     * Run Freemius actions and filters.
     
    96102        );
    97103        devnet_esub_fs()->add_action( 'after_uninstall', 'devnet_esub_fs_uninstall_cleanup' );
     104        devnet_esub_fs()->add_filter( 'plugin_icon', 'devnet_esub_fs_custom_icon' );
    98105    }
    99106    function devnet_esub_options() {
     
    134141    }
    135142
    136     define( 'DEVNET_ESUB_VERSION', '1.5.0' );
     143    define( 'DEVNET_ESUB_VERSION', '1.5.1' );
    137144    define( 'DEVNET_ESUB_DB_VERSION', 3 );
    138145    define( 'DEVNET_ESUB_NAME', 'Easy Subscribe' );
  • easy-subscribe/tags/1.5.1/includes/activator.php

    r3333420 r3365593  
    5959              custom_data TEXT NULL,
    6060              notification_date datetime NULL,
    61               date_created datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     61              date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    6262              PRIMARY KEY  (id),
    6363              INDEX (email),
  • easy-subscribe/tags/1.5.1/includes/helper.php

    r3333420 r3365593  
    5353        $date_created      = $data['date_created'] ?? current_time('mysql');
    5454        $origin_url        = $data['origin_url'] ?? '';
     55        $form_id          = $data['form_id'] ?? '';
    5556        $double_opt_in  = filter_var($data['double_opt_in'] ?? false, FILTER_VALIDATE_BOOLEAN);
    5657        $status         = $double_opt_in ? 'unconfirmed' : '';
  • easy-subscribe/trunk/README.txt

    r3333420 r3365593  
    44Requires PHP: 7.4
    55Requires at least: 6.4
    6 Stable tag: 1.5.0
     6Stable tag: 1.5.1
    77Tested up to: 6.8
    88License: GPLv2 or later
     
    121121== Changelog ==
    122122
     123= 1.5.1 =
     124
     125*2025-09-22*
     126
     127* Fix: Ensure database tables are created properly on plugin activation
     128* Update: Freemius SDK updated to the latest version
     129
     130
    123131= 1.5.0 =
    124132
  • easy-subscribe/trunk/admin/admin.php

    r3333420 r3365593  
    258258            'double_opt_in' => $request->get_param( 'double_opt_in' ),
    259259            'origin_url'    => $request->get_param( 'origin_url' ),
     260            'form_id'       => $request->get_param( 'form_id' ),
    260261        ];
    261262        // Return data as JSON
     
    337338                    'type'              => 'string',
    338339                    'sanitize_callback' => 'sanitize_url',
     340                    'validate_callback' => 'rest_validate_request_arg',
     341                    'required'          => false,
     342                ],
     343                'form_id'       => [
     344                    'type'              => 'string',
     345                    'sanitize_callback' => 'sanitize_text_field',
    339346                    'validate_callback' => 'rest_validate_request_arg',
    340347                    'required'          => false,
  • easy-subscribe/trunk/assets/build/preview.asset.php

    r3288202 r3365593  
    1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'd71d095da75acacdd5c9');
     1<?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => '5903b0a0e4a0b307ebfb');
  • easy-subscribe/trunk/assets/build/preview.js

    r3288202 r3365593  
    9999    `),Cc))),Pc=mr("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),Mc=mr("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${vo(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((({ownerState:e,theme:t})=>s({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})),(({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&Vr(wc||(wc=kc`
    100100      animation: ${0} 1.4s ease-in-out infinite;
    101     `),Rc))),Tc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=l(n,vc),m=s({},n,{color:o,disableShrink:i,size:a,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return _n({root:["root",n,`color${vo(r)}`],svg:["svg"],circle:["circle",`circle${vo(n)}`,o&&"circleDisableShrink"]},bc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((Ec-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,st.jsx)($c,s({className:Bn(h.root,r),style:s({width:a,height:a},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,st.jsx)(Pc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,st.jsx)(Mc,{className:h.circle,style:g,ownerState:m,cx:Ec,cy:Ec,r:(Ec-u)/2,fill:"none",strokeWidth:u})})}))})),Oc=Tc;function zc(e){return Yr("MuiAlert",e)}const Ic=Zr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function Ac(e){return Yr("MuiIconButton",e)}const Nc=Zr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),jc=["edge","children","className","color","disabled","disableFocusRipple","size"],Lc=mr(bo,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${vo(n.color)}`],n.edge&&t[`edge${vo(n.edge)}`],t[`size${vo(n.size)}`]]}})((({theme:e,ownerState:t})=>s({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return s({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&s({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":s({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Nc.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),Fc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=l(n,jc),f=s({},n,{edge:r,color:a,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return _n({root:["root",n&&"disabled","default"!==r&&`color${vo(r)}`,o&&`edge${vo(o)}`,`size${vo(i)}`]},Ac,t)})(f);return(0,st.jsx)(Lc,s({className:Bn(m.root,i),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Bc=Fc,Wc=dl((0,st.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),_c=dl((0,st.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Dc=dl((0,st.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Hc=dl((0,st.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Vc=dl((0,st.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),qc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Kc=mr(ys,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${vo(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?$e:Pe,r="light"===e.palette.mode?Pe:$e,o=t.color||t.severity;return s({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&s({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),Uc=mr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Gc=mr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Xc=mr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Yc={success:(0,st.jsx)(Wc,{fontSize:"inherit"}),warning:(0,st.jsx)(_c,{fontSize:"inherit"}),error:(0,st.jsx)(Dc,{fontSize:"inherit"}),info:(0,st.jsx)(Hc,{fontSize:"inherit"})},Zc=r.forwardRef((function(e,t){var n,r,o,i,a,c;const u=vr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Yc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=l(u,qc),$=s({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return _n({root:["root",`${t}${vo(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},zc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Bc,T=null!=(o=null!=(i=E.closeIcon)?i:g.CloseIcon)?o:Vc,O=null!=(a=k.closeButton)?a:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,st.jsxs)(Kc,s({role:S,elevation:0,ownerState:$,className:Bn(P.root,f),ref:t},R,{children:[!1!==v?(0,st.jsx)(Uc,{ownerState:$,className:P.icon,children:v||y[w]||Yc[w]}):null,(0,st.jsx)(Gc,{ownerState:$,className:P.message,children:p}),null!=d?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:(0,st.jsx)(M,s({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,st.jsx)(T,s({fontSize:"small"},z))}))}):null]}))})),Jc=Zc;function Qc({esubData:e}){const[t,n]=(0,i.useState)(!1),[o,a]=(0,i.useState)(""),[s,l]=(0,i.useState)(""),c=e.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=e.options.messages,R=e.preview,$=!(!t&&!o),P="1"==c.name_field,M="1"==c.last_name_field,T=uc(oc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(e,t,n="text")=>("esubEmail"===e&&({sm:2,xs:12}.sm=5),(0,r.createElement)(T,{item:!0,className:e,xs:"auto"},(0,r.createElement)(Rl,{required:!0,id:e+"Input",name:e,type:n,...p?{label:t}:{placeholder:t},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(cc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,r.createElement)(Hl,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,r.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,r.createElement)(Rl,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,r.createElement)(gc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,r.createElement)(cc,{sx:{}},(0,r.createElement)(cc,{component:"form",onSubmit:async t=>{if(t.preventDefault(),R)return!1;n(!0),a(""),l(!1);const r=new FormData(t.currentTarget),o={list:d,name:r.get("esubName"),last_name:r.get("esubLastName"),email:r.get("esubEmail"),double_opt_in:y,origin_url:window.location.href};if(r.get("esubSubject"))return a("spam"),n(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",e.rest_nonce,o).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));n(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,r.createElement)(oc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,r.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,r.createElement)(Mo,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,r.createElement)(cc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:t||o?"block":"none"}},t&&(0,r.createElement)(Oc,{sx:{marginBottom:2}}),o&&"created"===o&&!0===s&&(0,r.createElement)(Jc,{severity:"warning"},C),o&&"created"===o&&!s&&(0,r.createElement)(Jc,{severity:"success"},w),o&&"exists"===o&&(0,r.createElement)(Jc,{severity:"warning"},S),o&&"spam"===o&&(0,r.createElement)(Jc,{severity:"error"},k),o&&"error"===o&&(0,r.createElement)(Jc,{severity:"error"},E)))))}function eu({emotionRoot:e,data:t}){const[n,o]=(0,i.useState)(t||{});if(n.preview){const e=n.options.form.id,t=(0,i.useCallback)((t=>{const{name:r,type:i,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=r.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...n};t.options.form[e]="checkbox"===i?s:a,o(t)}}),[n]);(0,i.useEffect)((()=>{const r=document.querySelector(`#${e} form`),i=r.querySelectorAll('input[type="checkbox"]'),a=r.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return r.addEventListener("input",s),i.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),r.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const r=window.getComputedStyle(t).backgroundColor,i=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...n};a.options.form[i]=r,o(a)}}),0)}})),()=>{r.removeEventListener("input",s),i.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),r.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=dn({key:"css",prepend:!0,container:e});if(!n.allowed){const{form:e}=n.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=n.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=rt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,r.createElement)(Pn,{value:a},(0,r.createElement)(Ln,{theme:b},(0,r.createElement)(Qc,{esubData:n})))}const tu=devnet_esub_script;let nu=Object.keys(tu.options.forms);function ru(e,t,n){if(!e)return;const o=e.querySelector(".esub-form");if(!o||o.shadowRoot)return;t.options.form=t.options.forms[n],t.options.form.id=n;const s=o.attachShadow({mode:"open"}),l=document.createElement("style");t.allowed&&(l.textContent=t.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),a.s(c).render((0,r.createElement)(i.StrictMode,null,(0,r.createElement)(eu,{emotionRoot:l,data:t})))}tu.allowed||(nu=["devnet_esub_form"]),nu.forEach((e=>{const t=JSON.parse(JSON.stringify(tu)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){ru(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{ru(n,t,e)}))}}))},679:(e,t,n)=>{var r=n(296),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=l(t),h=l(n),g=0;g<a.length;++g){var b=a[g];if(!(i[b]||r&&r[b]||h&&h[b]||s&&s[b])){var v=p(n,b);try{c(t,b,v)}catch(e){}}}}return t}},103:(e,t)=>{var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case h:case l:return e;default:return t}}case o:return t}}}function w(e){return S(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return w(e)||S(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===p},t.isFragment=function(e){return S(e)===i},t.isLazy=function(e){return S(e)===g},t.isMemo=function(e){return S(e)===h},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===s},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===s||e===a||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===y||e.$$typeof===x||e.$$typeof===b)},t.typeOf=S},296:(e,t,n)=>{e.exports=n(103)},745:(e,t,n)=>{var r=n(850);t.s=r.createRoot,r.hydrateRoot},921:(e,t)=>{var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case s:case a:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case c:case d:case h:case m:case l:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference")},864:(e,t,n)=>{n(921)},251:(e,t,n)=>{var r=n(196),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:s.current}}t.jsx=c,t.jsxs=c},893:(e,t,n)=>{e.exports=n(251)},196:e=>{e.exports=window.React},850:e=>{e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{n(260);document.querySelectorAll(".esub-preview-button").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault();const t="preview--"+this.getAttribute("data-id");document.getElementById(t).parentNode.classList.toggle("show")}))}));document.querySelectorAll(".esub-preview-close").forEach((function(e){e.addEventListener("click",(function(e){const t=this.closest(".esub-preview-wrap");t&&t.classList.remove("show")}))}));document.querySelectorAll(".esub-preview-bg-color-box").forEach((function(e){e.addEventListener("click",(function(e){const t=window.getComputedStyle(this).getPropertyValue("background-color"),n=this.closest(".esub-preview-wrap");n&&(n.style.backgroundColor=t)}))}))})()})();
     101    `),Rc))),Tc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=l(n,vc),m=s({},n,{color:o,disableShrink:i,size:a,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return _n({root:["root",n,`color${vo(r)}`],svg:["svg"],circle:["circle",`circle${vo(n)}`,o&&"circleDisableShrink"]},bc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((Ec-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,st.jsx)($c,s({className:Bn(h.root,r),style:s({width:a,height:a},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,st.jsx)(Pc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,st.jsx)(Mc,{className:h.circle,style:g,ownerState:m,cx:Ec,cy:Ec,r:(Ec-u)/2,fill:"none",strokeWidth:u})})}))})),Oc=Tc;function zc(e){return Yr("MuiAlert",e)}const Ic=Zr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function Ac(e){return Yr("MuiIconButton",e)}const Nc=Zr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),jc=["edge","children","className","color","disabled","disableFocusRipple","size"],Lc=mr(bo,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${vo(n.color)}`],n.edge&&t[`edge${vo(n.edge)}`],t[`size${vo(n.size)}`]]}})((({theme:e,ownerState:t})=>s({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return s({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&s({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":s({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Nc.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),Fc=r.forwardRef((function(e,t){const n=vr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=l(n,jc),f=s({},n,{edge:r,color:a,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return _n({root:["root",n&&"disabled","default"!==r&&`color${vo(r)}`,o&&`edge${vo(o)}`,`size${vo(i)}`]},Ac,t)})(f);return(0,st.jsx)(Lc,s({className:Bn(m.root,i),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Bc=Fc,Wc=dl((0,st.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),_c=dl((0,st.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Dc=dl((0,st.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Hc=dl((0,st.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Vc=dl((0,st.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),qc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Kc=mr(ys,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${vo(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?$e:Pe,r="light"===e.palette.mode?Pe:$e,o=t.color||t.severity;return s({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Ic.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&s({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),Uc=mr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Gc=mr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Xc=mr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Yc={success:(0,st.jsx)(Wc,{fontSize:"inherit"}),warning:(0,st.jsx)(_c,{fontSize:"inherit"}),error:(0,st.jsx)(Dc,{fontSize:"inherit"}),info:(0,st.jsx)(Hc,{fontSize:"inherit"})},Zc=r.forwardRef((function(e,t){var n,r,o,i,a,c;const u=vr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Yc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=l(u,qc),$=s({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return _n({root:["root",`${t}${vo(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},zc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Bc,T=null!=(o=null!=(i=E.closeIcon)?i:g.CloseIcon)?o:Vc,O=null!=(a=k.closeButton)?a:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,st.jsxs)(Kc,s({role:S,elevation:0,ownerState:$,className:Bn(P.root,f),ref:t},R,{children:[!1!==v?(0,st.jsx)(Uc,{ownerState:$,className:P.icon,children:v||y[w]||Yc[w]}):null,(0,st.jsx)(Gc,{ownerState:$,className:P.message,children:p}),null!=d?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,st.jsx)(Xc,{ownerState:$,className:P.action,children:(0,st.jsx)(M,s({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,st.jsx)(T,s({fontSize:"small"},z))}))}):null]}))})),Jc=Zc;function Qc({esubData:e}){const[t,n]=(0,i.useState)(!1),[o,a]=(0,i.useState)(""),[s,l]=(0,i.useState)(""),c=e.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=e.options.messages,R=e.preview,$=!(!t&&!o),P="1"==c.name_field,M="1"==c.last_name_field,T=uc(oc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(e,t,n="text")=>("esubEmail"===e&&({sm:2,xs:12}.sm=5),(0,r.createElement)(T,{item:!0,className:e,xs:"auto"},(0,r.createElement)(Rl,{required:!0,id:e+"Input",name:e,type:n,...p?{label:t}:{placeholder:t},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(cc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,r.createElement)(Hl,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,r.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,r.createElement)(Rl,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,r.createElement)(gc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,r.createElement)(cc,{sx:{}},(0,r.createElement)(cc,{component:"form",onSubmit:async t=>{if(t.preventDefault(),R)return!1;n(!0),a(""),l(!1);const r=new FormData(t.currentTarget),o={list:d,name:r.get("esubName"),last_name:r.get("esubLastName"),email:r.get("esubEmail"),double_opt_in:y,origin_url:window.location.href,form_id:u};if(r.get("esubSubject"))return a("spam"),n(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",e.rest_nonce,o).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));n(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,r.createElement)(oc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,r.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,r.createElement)(Mo,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,r.createElement)(cc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:t||o?"block":"none"}},t&&(0,r.createElement)(Oc,{sx:{marginBottom:2}}),o&&"created"===o&&!0===s&&(0,r.createElement)(Jc,{severity:"warning"},C),o&&"created"===o&&!s&&(0,r.createElement)(Jc,{severity:"success"},w),o&&"exists"===o&&(0,r.createElement)(Jc,{severity:"warning"},S),o&&"spam"===o&&(0,r.createElement)(Jc,{severity:"error"},k),o&&"error"===o&&(0,r.createElement)(Jc,{severity:"error"},E)))))}function eu({emotionRoot:e,data:t}){const[n,o]=(0,i.useState)(t||{});if(n.preview){const e=n.options.form.id,t=(0,i.useCallback)((t=>{const{name:r,type:i,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=r.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...n};t.options.form[e]="checkbox"===i?s:a,o(t)}}),[n]);(0,i.useEffect)((()=>{const r=document.querySelector(`#${e} form`),i=r.querySelectorAll('input[type="checkbox"]'),a=r.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return r.addEventListener("input",s),i.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),r.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const r=window.getComputedStyle(t).backgroundColor,i=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...n};a.options.form[i]=r,o(a)}}),0)}})),()=>{r.removeEventListener("input",s),i.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),r.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=dn({key:"css",prepend:!0,container:e});if(!n.allowed){const{form:e}=n.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=n.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=rt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,r.createElement)(Pn,{value:a},(0,r.createElement)(Ln,{theme:b},(0,r.createElement)(Qc,{esubData:n})))}const tu=devnet_esub_script;let nu=Object.keys(tu.options.forms);function ru(e,t,n){if(!e)return;const o=e.querySelector(".esub-form");if(!o||o.shadowRoot)return;t.options.form=t.options.forms[n],t.options.form.id=n;const s=o.attachShadow({mode:"open"}),l=document.createElement("style");t.allowed&&(l.textContent=t.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),a.s(c).render((0,r.createElement)(i.StrictMode,null,(0,r.createElement)(eu,{emotionRoot:l,data:t})))}tu.allowed||(nu=["devnet_esub_form"]),nu.forEach((e=>{const t=JSON.parse(JSON.stringify(tu)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){ru(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{ru(n,t,e)}))}}))},679:(e,t,n)=>{var r=n(296),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=l(t),h=l(n),g=0;g<a.length;++g){var b=a[g];if(!(i[b]||r&&r[b]||h&&h[b]||s&&s[b])){var v=p(n,b);try{c(t,b,v)}catch(e){}}}}return t}},103:(e,t)=>{var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case h:case l:return e;default:return t}}case o:return t}}}function w(e){return S(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return w(e)||S(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===p},t.isFragment=function(e){return S(e)===i},t.isLazy=function(e){return S(e)===g},t.isMemo=function(e){return S(e)===h},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===s},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===s||e===a||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===y||e.$$typeof===x||e.$$typeof===b)},t.typeOf=S},296:(e,t,n)=>{e.exports=n(103)},745:(e,t,n)=>{var r=n(850);t.s=r.createRoot,r.hydrateRoot},921:(e,t)=>{var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case s:case a:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case c:case d:case h:case m:case l:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference")},864:(e,t,n)=>{n(921)},251:(e,t,n)=>{var r=n(196),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:s.current}}t.jsx=c,t.jsxs=c},893:(e,t,n)=>{e.exports=n(251)},196:e=>{e.exports=window.React},850:e=>{e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{n(260);document.querySelectorAll(".esub-preview-button").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault();const t="preview--"+this.getAttribute("data-id");document.getElementById(t).parentNode.classList.toggle("show")}))}));document.querySelectorAll(".esub-preview-close").forEach((function(e){e.addEventListener("click",(function(e){const t=this.closest(".esub-preview-wrap");t&&t.classList.remove("show")}))}));document.querySelectorAll(".esub-preview-bg-color-box").forEach((function(e){e.addEventListener("click",(function(e){const t=window.getComputedStyle(this).getPropertyValue("background-color"),n=this.closest(".esub-preview-wrap");n&&(n.style.backgroundColor=t)}))}))})()})();
  • easy-subscribe/trunk/assets/build/public.asset.php

    r3288202 r3365593  
    1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => '4c12d06a4807999af9f5');
     1<?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'ca393b8b241fe74ab885');
  • easy-subscribe/trunk/assets/build/public.js

    r3288202 r3365593  
    9999    `),kc))),Rc=pr("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),$c=pr("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${go(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((({ownerState:e,theme:t})=>i({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})),(({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&Dr(xc||(xc=Sc`
    100100      animation: ${0} 1.4s ease-in-out infinite;
    101     `),Ec))),Pc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:s=!1,size:l=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=a(n,gc),m=i({},n,{color:o,disableShrink:s,size:l,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Bn({root:["root",n,`color${go(r)}`],svg:["svg"],circle:["circle",`circle${go(n)}`,o&&"circleDisableShrink"]},hc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((wc-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,it.jsx)(Cc,i({className:Ln(h.root,r),style:i({width:l,height:l},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,it.jsx)(Rc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,it.jsx)($c,{className:h.circle,style:g,ownerState:m,cx:wc,cy:wc,r:(wc-u)/2,fill:"none",strokeWidth:u})})}))})),Mc=Pc;function Tc(e){return Gr("MuiAlert",e)}const Oc=Xr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function zc(e){return Gr("MuiIconButton",e)}const Ic=Xr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Ac=["edge","children","className","color","disabled","disableFocusRipple","size"],Nc=pr(ho,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${go(n.color)}`],n.edge&&t[`edge${go(n.edge)}`],t[`size${go(n.size)}`]]}})((({theme:e,ownerState:t})=>i({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return i({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&i({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":i({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Ic.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),jc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:s,color:l="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=a(n,Ac),f=i({},n,{edge:r,color:l,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return Bn({root:["root",n&&"disabled","default"!==r&&`color${go(r)}`,o&&`edge${go(o)}`,`size${go(i)}`]},zc,t)})(f);return(0,it.jsx)(Nc,i({className:Ln(m.root,s),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Lc=jc,Fc=cl((0,it.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Bc=cl((0,it.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Wc=cl((0,it.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),_c=cl((0,it.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Dc=cl((0,it.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Hc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Vc=pr(bs,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${go(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?Ce:Re,r="light"===e.palette.mode?Re:Ce,o=t.color||t.severity;return i({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&i({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),qc=pr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Kc=pr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Uc=pr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Gc={success:(0,it.jsx)(Fc,{fontSize:"inherit"}),warning:(0,it.jsx)(Bc,{fontSize:"inherit"}),error:(0,it.jsx)(Wc,{fontSize:"inherit"}),info:(0,it.jsx)(_c,{fontSize:"inherit"})},Xc=e.forwardRef((function(e,t){var n,r,o,s,l,c;const u=gr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Gc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=a(u,Hc),$=i({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return Bn({root:["root",`${t}${go(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},Tc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Lc,T=null!=(o=null!=(s=E.closeIcon)?s:g.CloseIcon)?o:Dc,O=null!=(l=k.closeButton)?l:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,it.jsxs)(Vc,i({role:S,elevation:0,ownerState:$,className:Ln(P.root,f),ref:t},R,{children:[!1!==v?(0,it.jsx)(qc,{ownerState:$,className:P.icon,children:v||y[w]||Gc[w]}):null,(0,it.jsx)(Kc,{ownerState:$,className:P.message,children:p}),null!=d?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:(0,it.jsx)(M,i({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,it.jsx)(T,i({fontSize:"small"},z))}))}):null]}))})),Yc=Xc;function Zc({esubData:t}){const[n,o]=(0,r.useState)(!1),[i,a]=(0,r.useState)(""),[s,l]=(0,r.useState)(""),c=t.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=t.options.messages,R=t.preview,$=!(!n&&!i),P="1"==c.name_field,M="1"==c.last_name_field,T=lc(nc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(t,n,r="text")=>("esubEmail"===t&&({sm:2,xs:12}.sm=5),(0,e.createElement)(T,{item:!0,className:t,xs:"auto"},(0,e.createElement)(El,{required:!0,id:t+"Input",name:t,type:r,...p?{label:n}:{placeholder:n},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(sc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,e.createElement)(_l,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,e.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,e.createElement)(El,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,e.createElement)(mc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,e.createElement)(sc,{sx:{}},(0,e.createElement)(sc,{component:"form",onSubmit:async e=>{if(e.preventDefault(),R)return!1;o(!0),a(""),l(!1);const n=new FormData(e.currentTarget),r={list:d,name:n.get("esubName"),last_name:n.get("esubLastName"),email:n.get("esubEmail"),double_opt_in:y,origin_url:window.location.href};if(n.get("esubSubject"))return a("spam"),o(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",t.rest_nonce,r).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));o(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,e.createElement)(nc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,e.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,e.createElement)($o,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,e.createElement)(sc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:n||i?"block":"none"}},n&&(0,e.createElement)(Mc,{sx:{marginBottom:2}}),i&&"created"===i&&!0===s&&(0,e.createElement)(Yc,{severity:"warning"},C),i&&"created"===i&&!s&&(0,e.createElement)(Yc,{severity:"success"},w),i&&"exists"===i&&(0,e.createElement)(Yc,{severity:"warning"},S),i&&"spam"===i&&(0,e.createElement)(Yc,{severity:"error"},k),i&&"error"===i&&(0,e.createElement)(Yc,{severity:"error"},E)))))}function Jc({emotionRoot:t,data:n}){const[o,i]=(0,r.useState)(n||{});if(o.preview){const e=o.options.form.id,t=(0,r.useCallback)((t=>{const{name:n,type:r,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=n.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...o};t.options.form[e]="checkbox"===r?s:a,i(t)}}),[o]);(0,r.useEffect)((()=>{const n=document.querySelector(`#${e} form`),r=n.querySelectorAll('input[type="checkbox"]'),a=n.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return n.addEventListener("input",s),r.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),n.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const n=window.getComputedStyle(t).backgroundColor,r=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...o};a.options.form[r]=n,i(a)}}),0)}})),()=>{n.removeEventListener("input",s),r.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),n.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=cn({key:"css",prepend:!0,container:t});if(!o.allowed){const{form:e}=o.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=o.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=tt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,e.createElement)(Rn,{value:a},(0,e.createElement)(Nn,{theme:b},(0,e.createElement)(Zc,{esubData:o})))}const Qc=devnet_esub_script;let eu=Object.keys(Qc.options.forms);function tu(t,n,i){if(!t)return;const a=t.querySelector(".esub-form");if(!a||a.shadowRoot)return;n.options.form=n.options.forms[i],n.options.form.id=i;const s=a.attachShadow({mode:"open"}),l=document.createElement("style");n.allowed&&(l.textContent=n.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),o.s(c).render((0,e.createElement)(r.StrictMode,null,(0,e.createElement)(Jc,{emotionRoot:l,data:n})))}Qc.allowed||(eu=["devnet_esub_form"]),eu.forEach((e=>{const t=JSON.parse(JSON.stringify(Qc)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){tu(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{tu(n,t,e)}))}}))})()})();
     101    `),Ec))),Pc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:s=!1,size:l=40,style:c,thickness:u=3.6,value:d=0,variant:p="indeterminate"}=n,f=a(n,gc),m=i({},n,{color:o,disableShrink:s,size:l,thickness:u,value:d,variant:p}),h=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Bn({root:["root",n,`color${go(r)}`],svg:["svg"],circle:["circle",`circle${go(n)}`,o&&"circleDisableShrink"]},hc,t)})(m),g={},b={},v={};if("determinate"===p){const e=2*Math.PI*((wc-u)/2);g.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*e).toFixed(3)}px`,b.transform="rotate(-90deg)"}return(0,it.jsx)(Cc,i({className:Ln(h.root,r),style:i({width:l,height:l},b,c),ownerState:m,ref:t,role:"progressbar"},v,f,{children:(0,it.jsx)(Rc,{className:h.svg,ownerState:m,viewBox:"22 22 44 44",children:(0,it.jsx)($c,{className:h.circle,style:g,ownerState:m,cx:wc,cy:wc,r:(wc-u)/2,fill:"none",strokeWidth:u})})}))})),Mc=Pc;function Tc(e){return Gr("MuiAlert",e)}const Oc=Xr("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function zc(e){return Gr("MuiIconButton",e)}const Ic=Xr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Ac=["edge","children","className","color","disabled","disableFocusRipple","size"],Nc=pr(ho,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${go(n.color)}`],n.edge&&t[`edge${go(n.edge)}`],t[`size${go(n.size)}`]]}})((({theme:e,ownerState:t})=>i({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})),(({theme:e,ownerState:t})=>{var n;const r=null==(n=(e.vars||e).palette)?void 0:n[t.color];return i({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&i({color:null==r?void 0:r.main},!t.disableRipple&&{"&:hover":i({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ee(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Ic.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})})),jc=e.forwardRef((function(e,t){const n=gr({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:s,color:l="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium"}=n,p=a(n,Ac),f=i({},n,{edge:r,color:l,disabled:c,disableFocusRipple:u,size:d}),m=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e;return Bn({root:["root",n&&"disabled","default"!==r&&`color${go(r)}`,o&&`edge${go(o)}`,`size${go(i)}`]},zc,t)})(f);return(0,it.jsx)(Nc,i({className:Ln(m.root,s),centerRipple:!0,focusRipple:!u,disabled:c,ref:t,ownerState:f},p,{children:o}))})),Lc=jc,Fc=cl((0,it.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Bc=cl((0,it.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Wc=cl((0,it.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),_c=cl((0,it.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Dc=cl((0,it.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Hc=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Vc=pr(bs,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${go(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?Ce:Re,r="light"===e.palette.mode?Re:Ce,o=t.color||t.severity;return i({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${o}StandardBg`]:r(e.palette[o].light,.9),[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${o}Color`]:n(e.palette[o].light,.6),border:`1px solid ${(e.vars||e).palette[o].light}`,[`& .${Oc.icon}`]:e.vars?{color:e.vars.palette.Alert[`${o}IconColor`]}:{color:e.palette[o].main}},o&&"filled"===t.variant&&i({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${o}FilledColor`],backgroundColor:e.vars.palette.Alert[`${o}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),qc=pr("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Kc=pr("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Uc=pr("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Gc={success:(0,it.jsx)(Fc,{fontSize:"inherit"}),warning:(0,it.jsx)(Bc,{fontSize:"inherit"}),error:(0,it.jsx)(Wc,{fontSize:"inherit"}),info:(0,it.jsx)(_c,{fontSize:"inherit"})},Xc=e.forwardRef((function(e,t){var n,r,o,s,l,c;const u=gr({props:e,name:"MuiAlert"}),{action:d,children:p,className:f,closeText:m="Close",color:h,components:g={},componentsProps:b={},icon:v,iconMapping:y=Gc,onClose:x,role:S="alert",severity:w="success",slotProps:k={},slots:E={},variant:C="standard"}=u,R=a(u,Hc),$=i({},u,{color:h,severity:w,variant:C}),P=(e=>{const{variant:t,color:n,severity:r,classes:o}=e;return Bn({root:["root",`${t}${go(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},Tc,o)})($),M=null!=(n=null!=(r=E.closeButton)?r:g.CloseButton)?n:Lc,T=null!=(o=null!=(s=E.closeIcon)?s:g.CloseIcon)?o:Dc,O=null!=(l=k.closeButton)?l:b.closeButton,z=null!=(c=k.closeIcon)?c:b.closeIcon;return(0,it.jsxs)(Vc,i({role:S,elevation:0,ownerState:$,className:Ln(P.root,f),ref:t},R,{children:[!1!==v?(0,it.jsx)(qc,{ownerState:$,className:P.icon,children:v||y[w]||Gc[w]}):null,(0,it.jsx)(Kc,{ownerState:$,className:P.message,children:p}),null!=d?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:d}):null,null==d&&x?(0,it.jsx)(Uc,{ownerState:$,className:P.action,children:(0,it.jsx)(M,i({size:"small","aria-label":m,title:m,color:"inherit",onClick:x},O,{children:(0,it.jsx)(T,i({fontSize:"small"},z))}))}):null]}))})),Yc=Xc;function Zc({esubData:t}){const[n,o]=(0,r.useState)(!1),[i,a]=(0,r.useState)(""),[s,l]=(0,r.useState)(""),c=t.options.form,{id:u,list:d,style:p,confirmation:f,confirmation_url:m,field_size:h,text_color:g,form_width:b,form_alignment:v,double_opt_in:y}=c,x=p||"outlined",{exists:S,success:w,spam:k,error:E,pending_confirmation:C}=t.options.messages,R=t.preview,$=!(!n&&!i),P="1"==c.name_field,M="1"==c.last_name_field,T=lc(nc)(function(e){const t=e.layout;let n=+e.button_width;n=n?`${n}px`:"100%";const r=e.button_alignment,o="1"==e.name_field,i="1"==e.last_name_field,a=o&&i,s="1"==e.custom_breakpoint,l=s?e.breakpoint_1+"px":"795px",c=s?e.breakpoint_2+"px":"565px",u=s?e.breakpoint_3+"px":"415px";let d="0 auto";"left"===r?d="0 auto 0 0":"right"===r&&(d="0 0 0 auto");const p=`\n        flex-basis: 100% !important;\n        max-width: 100% !important;\n        padding-left: 0 !important;\n        padding-right: 0 !important;\n\n        :is(.esubSubmit) {\n            width: ${n};\n            flex-basis: auto !important;\n            margin: ${d};\n        }\n    `;let f="\n\t\t:first-of-type {\n\t\t\tpadding-left: 0;\n\t\t}\n\n\t\t:is(.esubEmail),\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tflex: 1;\n\t\t}\n\n\t\t:is(.esubName),\n\t\t:is(.esubLastName) {\n\t\t\tmax-width: 25%;\n\t\t}\n\n\t\t:is(.esubSubmit) {\n\t\t\talign-self: flex-end;\n\t\t}\n\t";return o&&!i||i&&!o?f+=`\t\t\n\t\t@container esub (max-width: ${c}) {\n\t\t\t${p}\n\t\t}\n\t`:a||i||(f+=`\n\t\t\t@container esub (max-width: ${u}) {\n\t\t\t\t${p}\n\t\t\t}\n\t\t`),a&&("combination"!==t&&(f+=`@container esub (max-width: ${l}) {`),f+=`\t\t\n\t\t\t:is(.esubName),\n\t\t\t:is(.esubLastName) {\n\t\t\t\tflex-basis: 50%;\n\t\t\t\tmax-width: 50%;\n\t\t\t\t:first-of-type {\n\t\t\t\t\tpadding-left: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t:is(.esubEmail) {\n\t\t\t\tflex-basis: 100%;\n\t\t\t\tmax-width: 100%;\n\t\t\t\tpadding-left: 0 !important;\n\t\t\t\tpadding-right: 0 !important;\n\t\t\t}\t\n\n            :is(.esubSubmit) {\n                width: ${n};\n                flex-basis: auto;\n                max-width: 100%;\n                padding-left: 0 !important;\n                padding-right: 0 !important;\n                margin: ${d};\n            }\n\t\n\t\t`,"combination"!==t&&(f+="}")),"vertical"===t&&(f=p),f}(c)),O=(t,n,r="text")=>("esubEmail"===t&&({sm:2,xs:12}.sm=5),(0,e.createElement)(T,{item:!0,className:t,xs:"auto"},(0,e.createElement)(El,{required:!0,id:t+"Input",name:t,type:r,...p?{label:n}:{placeholder:n},size:h,variant:x,disabled:$,fullWidth:!0,InputProps:{style:{color:g}},InputLabelProps:{sx:{color:g,opacity:g?.6:""}}}))),z=P?O("esubName",c.name_field_label):"",I=M?O("esubLastName",c.last_name_field_label):"",A="1"==c.gdpr_field?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(sc,{className:"esubGdpr",sx:{display:"flex",aligntems:"flex-start"}},(0,e.createElement)(_l,{name:"esubGdpr",value:"1",color:"primary",size:h,disabled:$,required:!0,sx:{padding:"12px",marginLeft:"-12px",height:"fit-content"}}),(0,e.createElement)("p",{style:{maxHeight:"75px",overflow:"auto",margin:0,marginTop:"15px",color:g}},c.gdpr_text))):"",N="1"==c.honeypot?(0,e.createElement)(El,{type:"hidden",id:"esubSubjectInput",name:"esubSubject",sx:{display:"none"}}):"";let j={};return"left"===v?j={marginLeft:0,marginRight:"auto"}:"right"===v&&(j={marginLeft:"auto",marginRight:0}),(0,e.createElement)(mc,{component:"main",disableGutters:!0,style:{maxWidth:+b>0?+b:"100%",...j}},(0,e.createElement)(sc,{sx:{}},(0,e.createElement)(sc,{component:"form",onSubmit:async e=>{if(e.preventDefault(),R)return!1;o(!0),a(""),l(!1);const n=new FormData(e.currentTarget),r={list:d,name:n.get("esubName"),last_name:n.get("esubLastName"),email:n.get("esubEmail"),double_opt_in:y,origin_url:window.location.href,form_id:u};if(n.get("esubSubject"))return a("spam"),o(!1),!1;await(async(e,t,n)=>{try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t},body:JSON.stringify(n)});return await r.json()}catch(e){console.error(e)}})("/wp-json/easy-subscribe/v1/subscribe",t.rest_nonce,r).then((e=>{a(e.response),l(e.pending_confirmation),"created"===e.response&&"url"===f&&m&&(window.location.href=m)}));o(!1)},sx:{position:"relative",paddingBottom:"15px"}},(0,e.createElement)(nc,{container:!0,spacing:2,sx:{opacity:$?"0.5":"1",margin:0,width:"100%"},style:{container:"esub / inline-size"}},z,I,O("esubEmail",c.email_field_label,"email"),(0,e.createElement)(T,{item:!0,className:"esubSubmit",xs:"auto"},(0,e.createElement)($o,{type:"submit",variant:"contained",size:h,disabled:$,fullWidth:!0},c.button_label)),A,N),(0,e.createElement)(sc,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:n||i?"block":"none"}},n&&(0,e.createElement)(Mc,{sx:{marginBottom:2}}),i&&"created"===i&&!0===s&&(0,e.createElement)(Yc,{severity:"warning"},C),i&&"created"===i&&!s&&(0,e.createElement)(Yc,{severity:"success"},w),i&&"exists"===i&&(0,e.createElement)(Yc,{severity:"warning"},S),i&&"spam"===i&&(0,e.createElement)(Yc,{severity:"error"},k),i&&"error"===i&&(0,e.createElement)(Yc,{severity:"error"},E)))))}function Jc({emotionRoot:t,data:n}){const[o,i]=(0,r.useState)(n||{});if(o.preview){const e=o.options.form.id,t=(0,r.useCallback)((t=>{const{name:n,type:r,value:a,checked:s,id:l}=t.target;if(l==="preview--"+e)return;const c=n.match(/\[([^\]]+)\]/);if(c){const e=c[1],t={...o};t.options.form[e]="checkbox"===r?s:a,i(t)}}),[o]);(0,r.useEffect)((()=>{const n=document.querySelector(`#${e} form`),r=n.querySelectorAll('input[type="checkbox"]'),a=n.querySelectorAll("select"),s=function(e,t){let n;return function(){const r=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(r,o)}),t)}}(t,300);return n.addEventListener("input",s),r.forEach((e=>{e.addEventListener("change",s)})),a.forEach((e=>{e.addEventListener("change",s)})),n.addEventListener("mouseup",(e=>{const t=e.target.closest(".iris-picker");if(t){const e=t.closest(".wp-picker-container");setTimeout((function(){const t=e.querySelector(".color-alpha");if(t){const n=window.getComputedStyle(t).backgroundColor,r=e.querySelector("input.wp-color-picker-field").getAttribute("name").match(/\[([^\]]+)\]/)[1],a={...o};a.options.form[r]=n,i(a)}}),0)}})),()=>{n.removeEventListener("input",s),r.forEach((e=>{e.removeEventListener("change",s)})),a.forEach((e=>{e.removeEventListener("change",s)})),n.removeEventListener("mouseup",(()=>{}))}}),[t])}const a=cn({key:"css",prepend:!0,container:t});if(!o.allowed){const{form:e}=o.options;e.list_name="subscribers",e.confirmation="message",e.last_name_field=!1,e.button_width="",e.button_alignment="",e.form_width="",e.form_alignment="",e.field_bg_color="",e.text_color=""}const{style:s,primary_color:l,lighten_fields:c,field_size:u,text_color:d,field_bg_color:p}=o.options.form;let f=p,m=null,h=40,g="14px, 20px";"small"===u?(g="14px, 9px","standard"===s&&(g="0, 24px")):"medium"===u?(m="1.1rem",h=56,g=`14px, ${h}%`,"standard"===s&&(g="0, 31px")):"large"===u&&(m="1.3rem",h=72,g=`14px, ${h}%`,"standard"===s&&(g="0, 40px")),"standard"===s&&(f="transparent");const b=tt({components:{MuiButton:{styleOverrides:{root:{fontSize:m,height:h}}},MuiInputBase:{styleOverrides:{root:{fontSize:m,height:h,backgroundColor:f+"!important"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:m,zIndex:1,"&:not(.MuiInputLabel-shrink)":{transform:`translate(${g}) scale(1);`}}}}},palette:{mode:"1"==c?"dark":"light",primary:{main:l}},typography:{}});return(0,e.createElement)(Rn,{value:a},(0,e.createElement)(Nn,{theme:b},(0,e.createElement)(Zc,{esubData:o})))}const Qc=devnet_esub_script;let eu=Object.keys(Qc.options.forms);function tu(t,n,i){if(!t)return;const a=t.querySelector(".esub-form");if(!a||a.shadowRoot)return;n.options.form=n.options.forms[i],n.options.form.id=i;const s=a.attachShadow({mode:"open"}),l=document.createElement("style");n.allowed&&(l.textContent=n.options.form.custom_css);const c=document.createElement("div");s.appendChild(l),s.appendChild(c),o.s(c).render((0,e.createElement)(r.StrictMode,null,(0,e.createElement)(Jc,{emotionRoot:l,data:n})))}Qc.allowed||(eu=["devnet_esub_form"]),eu.forEach((e=>{const t=JSON.parse(JSON.stringify(Qc)),n=e.split("_"),r=n.length>1?n[n.length-1]:e,o=`#preview--${e}`;let i="easy-subscribe";if(i="form"!==r?`${i}-${r}`:i,t.preview){tu(document.querySelector(o),t,e)}else{document.querySelectorAll(`.easy-subscribe[data-wrapper-id="${i}"]`).forEach((n=>{tu(n,t,e)}))}}))})()})();
  • easy-subscribe/trunk/easy-subscribe.php

    r3333420 r3365593  
    44 * Plugin Name:       Easy Subscribe
    55 * Description:       Easy way to integrate the form and collect subscribers.
    6  * Version:           1.5.0
     6 * Version:           1.5.1
    77 * Author:            Devnet
    88 * Author URI:        https://devnet.hr
     
    2828            if ( !isset( $devnet_esub_fs ) ) {
    2929                // Include Freemius SDK.
    30                 require_once dirname( __FILE__ ) . '/fs/freemius/start.php';
     30                require_once __DIR__ . '/vendor/freemius/wordpress-sdk/start.php';
    3131                $devnet_esub_fs = fs_dynamic_init( [
    3232                    'id'             => '14904',
     
    8585
    8686    }
     87    if ( !function_exists( 'devnet_esub_fs_custom_icon' ) ) {
     88        function devnet_esub_fs_custom_icon() {
     89            return dirname( __FILE__ ) . '/assets/images/logo.png';
     90        }
     91
     92    }
    8793    /*
    8894     * Run Freemius actions and filters.
     
    96102        );
    97103        devnet_esub_fs()->add_action( 'after_uninstall', 'devnet_esub_fs_uninstall_cleanup' );
     104        devnet_esub_fs()->add_filter( 'plugin_icon', 'devnet_esub_fs_custom_icon' );
    98105    }
    99106    function devnet_esub_options() {
     
    134141    }
    135142
    136     define( 'DEVNET_ESUB_VERSION', '1.5.0' );
     143    define( 'DEVNET_ESUB_VERSION', '1.5.1' );
    137144    define( 'DEVNET_ESUB_DB_VERSION', 3 );
    138145    define( 'DEVNET_ESUB_NAME', 'Easy Subscribe' );
  • easy-subscribe/trunk/includes/activator.php

    r3333420 r3365593  
    5959              custom_data TEXT NULL,
    6060              notification_date datetime NULL,
    61               date_created datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     61              date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    6262              PRIMARY KEY  (id),
    6363              INDEX (email),
  • easy-subscribe/trunk/includes/helper.php

    r3333420 r3365593  
    5353        $date_created      = $data['date_created'] ?? current_time('mysql');
    5454        $origin_url        = $data['origin_url'] ?? '';
     55        $form_id          = $data['form_id'] ?? '';
    5556        $double_opt_in  = filter_var($data['double_opt_in'] ?? false, FILTER_VALIDATE_BOOLEAN);
    5657        $status         = $double_opt_in ? 'unconfirmed' : '';
Note: See TracChangeset for help on using the changeset viewer.