Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress - Version 1.10.2

Version Description

Download this release

Release Info

Developer cartflowswp
Plugin Icon Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress
Version 1.10.2
Comparing to
See all releases

Code changes from version 1.10.1 to 1.10.2

admin-core/assets/build/editor-app.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'd234c05d2afe0ceb6c943a07f36be6fc');
1
+ <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '7dfee7265e8154627ce7cb253cffb0ff');
admin-core/assets/build/editor-app.js CHANGED
@@ -15,4 +15,4 @@
15
  /* translators: %d is replaced with the count */
16
  (0,le.__)("Variation-%d","cartflows"),r))}return t}(),!y&&g!==a&&"checkout"!==l&&(0,e.createElement)("span",{className:"wcf-no-product-badge"},(0,le.__)("No Product Assigned","cartflows")),y&&g===a&&(0,e.createElement)("span",{className:"wcf-global-checkout-error-badge"},(0,le.__)("Global Checkout - Remove selected checkout product","cartflows")),!y&&g===a&&(0,e.createElement)("span",{className:"wcf-global-checkout-badge"},(0,le.__)("Store Checkout","cartflows")),function(){let t="";return!r||"upsell"!==l&&"downsell"!==l||(t=m&&f?(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"wcf-flow-badge wcf-conditional-badge wcf-yes-next-badge"},m),(0,e.createElement)("span",{className:"wcf-flow-badge wcf-conditional-badge wcf-no-next-badge"},f)):(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"wcf-flow-badge wcf-invalid-sequence-badge"},(0,le.__)("Invalid Position","cartflows")))),h&&(t=(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"wcf-flow-badge wcf-invalid-sequence-badge"},(0,le.__)("Invalid Step","cartflows")))),t}())),(0,e.createElement)("div",{className:"wcf-step__col-tags"},(0,e.createElement)("span",{className:`wcf-flow-badge ${N}`},"thankyou"===l?"Thank You":l)),(0,e.createElement)("div",{className:"wcf-step__col-actions"},(0,e.createElement)("div",{className:"wcf-step__actions",ref:_},b&&(0,e.createElement)(Ie,{id:g,control_id:i,onClickEvents:{clone:function(e){if(e.preventDefault(),!r)return null;if(confirm((0,le.__)("Do you want to clone this step? Are you sure?","cartflows"))){v(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.clone_step_nonce;const r=new window.FormData;"cartflows_clone_ab_test_step"===t&&(n=cartflows_admin.wcf_clone_ab_test_step_nonce,r.append("control_id",i)),r.append("action",t),r.append("security",n),r.append("step_id",g),r.append("post_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{window.location.reload(),v(!1)}))}},delete:function(e){if(e.preventDefault(),confirm((0,le.__)("Do you want to delete this step? Are you sure?","cartflows"))){v(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.delete_step_nonce;const r=new window.FormData;"cartflows_delete_ab_test_step"===t&&(n=cartflows_admin.wcf_delete_ab_test_step_nonce,r.append("control_id",i)),r.append("action",t),r.append("security",n),r.append("step_id",g),r.append("post_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{window.location.reload(),v(!1)}))}},abtest:function(e){if(e.preventDefault(),!r)return null;v(!0);const t=new window.FormData;t.append("action","cartflows_create_ab_test_variation"),t.append("security",cartflows_admin.wcf_create_ab_test_variation_nonce),t.append("step_id",g),t.append("flow_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{window.location.reload(),v(!1)}))},winner:function(e){if(e.preventDefault(),confirm((0,le.__)("Do you want to declare this step as winner? Are you sure?","cartflows"))){v(!0);const e=new window.FormData;e.append("action","cartflows_declare_ab_test_winner"),e.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),e.append("step_id",g),e.append("flow_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),v(!1)}))}},archived:function(e){if(e.preventDefault(),confirm((0,le.__)("Do you want to archived this step? Are you sure?","cartflows"))){v(!0);const e=new window.FormData;e.append("action","cartflows_archive_ab_test_step"),e.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),e.append("step_id",g),e.append("post_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),v(!1)}))}}},is_cf_pro:r,actions:d}),(0,e.createElement)("div",{className:"wcf-step__action-btns"},(0,e.createElement)("div",{className:"wcf-step__basic-action-btns"},u.map((t=>{var n;return(0,e.createElement)("a",{href:null==t?void 0:t.link,className:`wcf-step__action-btn ${null!==(n=t.class)&&void 0!==n?n:""}`,title:null==t?void 0:t.text,target:"View"===(null==t?void 0:t.text)?"_blank":"",rel:"noreferrer",key:null==t?void 0:t.link},(0,e.createElement)("span",{className:null==t?void 0:t.icon_class}),(0,e.createElement)("span",{className:"wcf-step__action-btn-text"},null==t?void 0:t.text))}))),(0,e.createElement)("div",{className:"wcf-step__action-menu",onClick:function(e){e.preventDefault(),b?E(e):(M(!0),document.addEventListener("mousedown",E))}},(0,e.createElement)("span",{className:"dashicons dashicons-ellipsis"}))))))},Tv=function(t){const[{is_cf_pro:n,global_checkout:r,flow_id:a}]=he(),{id:o,title:i,type:s,actions:c,menu_actions:l,ajaxcall:d,offer_yes_next_step:p,offer_no_next_step:f,invalid:m}=t,h=o,g=!!m;console.log(g),["checkout","thankyou"].includes(s)&&(delete l.clone,g||delete l.delete),g&&(delete l.clone,delete l.abtest);let y=!1,w=!1,v=[],b=[],M=0;n&&(y=!!t["ab-test-ui"]&&t["ab-test-ui"],w=!!t["ab-test-start"]&&t["ab-test-start"],v=t["ab-test-variations"]?t["ab-test-variations"]:[],b=t["ab-test-archived-variations"]?t["ab-test-archived-variations"]:[],M=v.length,M<2&&(y=!1));let _="";y&&(_+=" wcf-ab-test"),n||"upsell"!==s&&"downsell"!==s||(_+=" invalid-step"),g&&(_+=" invalid-step wcf-store-checkout");const E={is_cf_pro:n,global_checkout:r,flow_id:a,ab_test_ui:y,control_id:h,step_id:o,type:s,title:i,actions:Object.values(c),menu_actions:Object.values(l),has_product_assigned:t.is_product_assigned,offer_yes_next_step:p,offer_no_next_step:f,ab_test_archived_variations:b,invalidStep:g};return(0,e.createElement)("div",{className:"wcf-step-wrap "+_,id:o,onDragEnd:d},y&&(0,e.createElement)(Ec,{flow_id:a,control_id:h,step_id:o,abvariations:v,ab_test_start:w}),function(){let t="";if(E.step_id=o,y&&M>1){let n=0;t=v.map((t=>(h!==t.id&&++n,E.step_id=t.id,E.title=t.title,E.actions=Object.values(t.actions),E.menu_actions=Object.values(t.menu_actions),E.has_product_assigned=t.is_product_assigned,E.var_badge_count=n,(0,e.createElement)(Sv,u({},E,{key:t.id})))))}else t=(0,e.createElement)(Sv,E);return t}(),function(){if(y&&b.length>0){const t={flow_id:a,control_id:h,archived_variations:b};return(0,e.createElement)(Dc,t)}}())},kv=function(){const[{flow_id:t,steps:n,emptySteps:r},a]=he();let o=!1,i=!1;const s=[],c=[];console.log(n),n.length>0&&n.map(((e,t)=>{if("checkout"===e.type){if(!cartflows_admin.old_global_checkout)return o=t,"";if(e.id===parseInt(cartflows_admin.old_global_checkout))return o=t,"";s.push(e)}else"landing"===e.type?s.push(e):c.push(e);return""})),c.length>0&&(i=!0);let l=!0;n.length>0&&(l=!1);const d=()=>{const e=t,r=[];n.map((e=>(r.push(e.id),"")));const o=new window.FormData;o.append("action","cartflows_reorder_flow_steps"),o.append("security",cartflows_admin.reorder_flow_steps_nonce),o.append("step_ids",r),o.append("post_id",e),ye()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then((e=>{a({type:"SET_STORE_STEPS",steps:e.steps})}))};return(0,e.createElement)("div",{className:"wcf-steps-page-wrapper"},(0,e.createElement)(jv,null),(0,e.createElement)("div",{className:"wcf-list-steps"},r&&function(){if(0===n.length)return(0,e.createElement)("div",{className:"wcf-no-step-notice"},(0,e.createElement)("span",null," ",(0,le.__)("No Steps Added.","cartflows")))}(),!r&&l&&(0,e.createElement)(Tc,null),!r&&!l&&(0,e.createElement)(e.Fragment,null,s.map((t=>(0,e.createElement)(Tv,u({},t,{key:t.id,invalid:!0})))),(0,e.createElement)(Tv,u({},n[o],{key:n[o].id})),i&&(0,e.createElement)(be.ReactSortable,{list:c,setList:e=>a({type:"SET_STORE_STEPS",steps:e}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content",preventOnFilter:!1},c.map((t=>"checkout"!==t.type?(0,e.createElement)(Tv,u({},t,{ajaxcall:d,key:t.id})):(0,e.createElement)(e.Fragment,null)))))),(0,e.createElement)("div",{className:"wcf-step-footer"},(0,e.createElement)(te,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&action=wcf-store-checkout&flow_id=${t}&tab=steps&sub-tab=library`},className:"wcf-button wcf-button--primary wcf-create-step"},(0,e.createElement)("span",{className:"dashicons dashicons-plus"}),(0,e.createElement)("span",{className:"wcf-create-step--text"},(0,le.__)("Add New Step","cartflows")))))},Ov=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getselectedStep:t,getcurrentFlowSteps:n,getCFProStatus:r,getWooCommerceStatus:a}=e("wcf/importer");return{selectedStep:t(),currentFlowSteps:n(),cf_pro_status:r(),woocommerce_status:a()}})))((t=>{let{selectedStep:n,currentFlowSteps:r,cf_pro_status:a,woocommerce_status:o}=t;return""===n?"":!(r?r.filter((e=>n===e.type)):[]).length&&"upsell"!==n&&"downsell"!==n||"active"===a?"landing"!==n&&"active"!==o?"inactive"===o?(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Activate WooCommerce for adding more steps and other features.")):(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Install and activate WooCommerce for adding more steps and other features.")):"":"inactive"===a?(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Activate CartFlows Pro for adding more steps and other features.")):(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Upgrade to CartFlows Pro for adding more steps and other features.",(0,e.createElement)("a",{target:"_blank",href:cartflows_admin.cf_domain_url,rel:"noreferrer"},"Click here to upgrade")))})),Av=()=>(0,e.createElement)("div",{className:"wcf-create-step__notice-wrap"},(0,e.createElement)(Ov,null)),Cv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getStoreStepTypes:t}=e("wcf/importer");return{stepTypes:t()}})),(0,Gw.withDispatch)((e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}})))((t=>{let{stepTypes:n,setSelectedStep:r}=t;return(0,e.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option"},(0,e.createElement)("select",{onChange:e=>{console.log(e.target.value),r(e.target.value)}},(0,e.createElement)("option",{value:"",className:"",key:"all"},"Select Step Type"),Object.keys(n).map((t=>(0,e.createElement)("option",{className:t,value:t,key:t},n[t])))))})),Lv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:a,getcurrentFlowSteps:o,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:c,getLicenseStatus:l}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:a(),currentFlowSteps:o(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:c(),license_status:l()}})))((n=>{let{currentStep:r,stepName:a,currentFlowId:o,currentFlowSteps:i,cf_pro_status:s,woocommerce_status:c,stepTypes:l,license_status:u,setInputFieldVisibility:d}=n;const p=r.type||"",f=r.title||l[p]||"",[m,h]=(0,t.useState)("Import Step"),[g,y]=(0,t.useState)(!1),[w,v]=(0,t.useState)({cta:"",error_msg:""}),{cta:b,error_msg:M}=w,[_,E]=(0,t.useState)(!1),N=function(){E(!0),document.addEventListener("click",D)},D=function(){E(!1),document.removeEventListener("click",D)};if(b)return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:b}}),(0,e.createElement)("a",{className:"wcf-error-message--toggle",onClick:function(e){e.preventDefault(),_?D():N()}},"Show Error info"),_&&(0,e.createElement)("div",{className:"wcf-error--info",dangerouslySetInnerHTML:{__html:M}}));if(console.log(o),""===r.type)return(0,e.createElement)("button",{className:"button disabled"},m);if("pro"===r.template_type&&"active"!==s)return d("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});const x=i?i.filter((e=>p===e.type)):[];if(console.log("selectedExistSteps.length",x.length),1<=x.length&&"active"!==s)return d("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});if("upsell"===p||"downsell"===p){if(d("hidden"),"active"!==s)return"inactive"===s?(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."}):(0,e.createElement)(dv,{title:`"${f}" step exist! Upgrade to Pro`});if("Activated"!==u)return d("hidden"),(0,e.createElement)(pv,{title:`Activate License and ${m}`})}return"landing"!==p&&"active"!==c?(d("hidden"),"inactive"===c?(0,e.createElement)(lv,{title:`Activate WooCommerce to Import ${f}`,description:(0,le.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,e.createElement)(uv,null)):(d(""),(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:e=>{"submit"===e.target.type&&(e.preventDefault(),((e,t,n,r,a,o,i)=>{if(console.log(e,t,n),o)return;n("Importing Step.."),a(!0);const s=new window.FormData;s.append("action","cartflows_import_step"),s.append("security",cartflows_admin.import_step_nonce),s.append("remote_flow_id",e.template_ID),s.append("flow_id",t),s.append("step",JSON.stringify(e)),s.append("step_name",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then((e=>{console.log(e),e.success?(a(!1),n("Imported! Redirecting..."),setTimeout((()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&action=wcf-store-checkout&flow_id=${t}`}),3e3)):"call_to_action"in e.data&&i({cta:e.data.call_to_action,error_msg:e.data.message})}))})(r,o,h,a,y,g,v))}},m))})),zv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}})))((n=>{let{currentFlowId:r,selectedStep:a,selectedStepTitle:o,stepName:i}=n;const[s,c]=(0,t.useState)({isProcessing:!1,buttonText:"Create Step"}),{isProcessing:l,buttonText:u}=s;return(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:e=>{e.preventDefault(),l||(c({isProcessing:!0,buttonText:"Creating Step.."}),((e,t,n,r,a)=>{console.log(e,t,n);const o=new window.FormData;o.append("action","cartflows_create_step"),o.append("flow_id",e),o.append("step_type",t),o.append("step_title",n),o.append("security",cartflows_admin.create_step_nonce),o.append("step_name",a),console.log("Creating step.."),console.log("creating"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then((t=>{console.log(t),r({isProcessing:!1,buttonText:"Step Created! Redirecting Flow Edit"}),t.success?setTimeout((()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&action=wcf-store-checkout&flow_id=${e}`}),3e3):r({isProcessing:!1,buttonText:"Failed to Create Step!"})}))})(r,a,o,c,i))}},l?(0,e.createElement)(iv,null):""," ",u)})),Pv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:a,getCFProStatus:o,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:a(),cf_pro_status:o(),woocommerce_status:i(),license_status:s()}})))((t=>{let{selectedStep:n,currentFlowSteps:r,cf_pro_status:a,woocommerce_status:o,license_status:i,stepName:s,setInputFieldVisibility:c}=t;if(""===n)return(0,e.createElement)("button",{className:"wcf-button wcf-button--primary disabled"},(0,le.__)("Create Step","cartflows"));if(1<=(r?r.filter((e=>n===e.type)):[]).length&&"active"!==a)return c("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});if("upsell"===n||"downsell"===n){if("active"!==a)return c("hidden"),"not-installed"===a?(0,e.createElement)(dv,null):(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});if("Activated"!==i)return c("hidden"),(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,e.createElement)("div",{className:"wcf-flow-import__message"},(0,e.createElement)("p",null,(0,le.__)("Activate license for adding more flows and other features.","cartflows"))),(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)(pv,null)))}return"landing"!==n&&"active"!==o?(c("hidden"),"inactive"===o?(0,e.createElement)(lv,{description:(0,le.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,e.createElement)(uv,null)):(c(""),(0,e.createElement)(zv,{stepName:s}))})),Uv=t=>{let{stepName:n,setInputFieldVisibility:r}=t;return(0,e.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,e.createElement)(Pv,{stepName:n,setInputFieldVisibility:r}))};const Yv=n=>{let{item:r,type:a,stepName:o,setInputFieldVisibility:i}=n;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-step__footer"},"ready-templates"===a&&(0,e.createElement)(Lv,{currentStep:r,stepName:o,setInputFieldVisibility:i}),"create-your-own"===a&&(0,e.createElement)(Uv,{stepName:o,setInputFieldVisibility:i})))},Rv=n=>{let{setVisibility:r,item:a,type:o,stepName:i,setStepName:s,inputFieldVisibility:c,setInputFieldVisibility:l}=n;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-step__header"},(0,e.createElement)("div",{className:"wcf-name-your-step__title"},(0,e.createElement)("span",{className:"wcf-name-your-step-popup__title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),(0,le.__)("Name Your Step","cartflows"))),(0,e.createElement)("div",{className:"wcf-name-your-step__menu",title:"Hide this",onClick:()=>{r("hide")}},(0,e.createElement)("span",{className:"dashicons dashicons-no"}))),(0,e.createElement)("div",{className:"wcf-name-your-step__body"},(0,e.createElement)("div",{className:"wcf-name-your-step__text-field-wrap"},(0,e.createElement)("div",{className:"wcf-text-field"},(0,e.createElement)("input",{type:"text",className:`input-field ${c}`,value:i,onChange:e=>s(e.target.value),placeholder:(0,le.__)("Enter Step Name","cartflows")}))),(0,e.createElement)(Yv,{setVisibility:r,type:o,stepName:i,setStepName:s,item:a,setInputFieldVisibility:l})))};var Qv=n=>{let{visibility:r,setVisibility:o,item:i,type:s,stepName:c,setStepName:l}=n;const[u,d]=(0,t.useState)("");return(0,a.createPortal)((0,e.createElement)("div",{className:`wcf-name-your-step ${r}`},(0,e.createElement)("div",{className:"wcf-name-your-step__overlay",onClick:()=>{o("hide")}}),(0,e.createElement)("div",{className:"wcf-name-your-step__inner"},(0,e.createElement)(Rv,{setVisibility:o,type:s,stepName:c,setStepName:l,item:i,inputFieldVisibility:u,setInputFieldVisibility:d}))),document.getElementById("wcf-json-importer"))},Fv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}})))((n=>{let{selectedStep:r}=n;const[a,o]=(0,t.useState)("hide"),[i,s]=(0,t.useState)("");return(0,e.createElement)("div",{className:"wcf-step-library__item wcf-step-library__item--scratch"},(0,e.createElement)("h3",null,(0,le.__)("Select Step Type","cartflows")),(0,e.createElement)("div",{className:"wcf-step-library__item--scratch__select"},(0,e.createElement)(Av,null),(0,e.createElement)(Cv,null),(0,e.createElement)(Qv,{visibility:a,setVisibility:o,type:"create-your-own",stepName:i,setStepName:s}),(0,e.createElement)("button",{className:"wcf-button wcf-button--primary "+(""===r?"disabled":""),onClick:()=>{o("hide"===a?"show":"hide")}},"Create Step"),(0,e.createElement)("div",{className:"wcf-learn-how"},(0,e.createElement)("a",{href:`${cartflows_admin.cf_domain_url}/docs/cartflows-step-types/`,target:"_blank",rel:"noreferrer"},"Learn How",(0,e.createElement)("i",{className:"dashicons dashicons-external"})))))})),Bv=function(n){let{item:r,currentStep:a,setCurrentStep:o}=n;const i=a;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"#",className:"step-type-filter-item "+(r[0]===i?"current":""),onClick:()=>{o(r[0])}},r[1])))};const qv=t=>{const{setVisibility:n,errorMessage:r,title:a}=t,o=a||(0,le.__)("Error","cartflows");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow__header"},(0,e.createElement)("div",{className:"wcf-name-your-flow__title"},(0,e.createElement)("h2",{className:"wcf-name-your-flow-popup__title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),o)),(0,e.createElement)("div",{className:"wcf-name-your-flow__menu",title:"Hide this",onClick:()=>n("hide")},(0,e.createElement)("span",{className:"dashicons dashicons-no"}))),(0,e.createElement)("div",{className:"wcf-name-your-flow__body"},(0,e.createElement)("div",{className:"wcf-name-your-flow__footer"},r)))};var Vv,Hv,Gv,Zv,Wv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}})))((t=>{let{visibility:n,setVisibility:r,errorMessage:o,title:i}=t;return(0,a.createPortal)((0,e.createElement)("div",{className:`wcf-name-your-flow ${n}`},(0,e.createElement)("div",{className:"wcf-name-your-flow__overlay",onClick:()=>r("hide")}),(0,e.createElement)("div",{className:"wcf-name-your-flow__inner"},(0,e.createElement)(qv,{setVisibility:r,errorMessage:o,title:i}))),document.getElementById("wcf-json-importer"))})),$v=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:a,getcurrentFlowSteps:o,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:c,getLicenseStatus:l}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:a(),currentFlowSteps:o(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:c(),license_status:l()}})))((n=>{let{currentStep:r,stepName:a,currentFlowId:o,currentFlowSteps:i,cf_pro_status:s,woocommerce_status:c,stepTypes:l,license_status:u,setInputFieldVisibility:d,step_id:p}=n;const f=r.type||"",m=r.title||l[f]||"",[h,g]=(0,t.useState)("Choose"),[y,w]=(0,t.useState)(!1),[v,b]=(0,t.useState)("hide"),[M,_]=(0,t.useState)("");if(""===r.type)return(0,e.createElement)("button",{className:"button disabled"},h);if("pro"===r.template_type&&"active"!==s)return d("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});const E=i?i.filter((e=>f===e.type)):[];if(console.log("selectedExistSteps.length",E.length),"upsell"===f||"downsell"===f){if(d("hidden"),"active"!==s)return"inactive"===s?(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."}):(0,e.createElement)(dv,{title:`"${m}" step exist! Upgrade to Pro`});if("Activated"!==u)return d("hidden"),(0,e.createElement)(pv,{title:`Activate License and ${h}`})}return"landing"!==f&&"active"!==c?(d("hidden"),"inactive"===c?(0,e.createElement)(lv,{title:`Activate WooCommerce to Import ${m}`,description:(0,le.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,e.createElement)(uv,null)):(d(""),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:e=>{"submit"===e.target.type&&(e.preventDefault(),((e,t,n,r,a,o,i,s,c)=>{if(o)return;n("Changing Template.."),a(!0);const l=new window.FormData;l.append("action","cartflows_update_step"),l.append("security",cartflows_admin.update_step_nonce),l.append("remote_flow_id",e.template_ID),l.append("flow_id",t),l.append("step_id",i),l.append("step",JSON.stringify(e)),l.append("step_name",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:l}).then((e=>{console.log(e),e.success?(a(!1),n("Changed! Redirecting..."),setTimeout((()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&action=wcf-store-checkout&flow_id=${t}`}),3e3)):"call_to_action"in e.data&&(n("Choose"),c(e.data.call_to_action),s("show"))}))})(r,o,g,a,w,y,p,b,_))}},h),(0,e.createElement)(Wv,{visibility:v,setVisibility:b,errorMessage:M})))})),Xv=function(n){let{item:r,mode:a,step_id:o}=n;void 0===a&&(a="");const[i,s]=(0,t.useState)("hide"),[c,l]=(0,t.useState)("");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-item"},"pro"===r.template_type?(0,e.createElement)("span",{className:`wcf-item__type wcf-item__type--${r.template_type}`},r.template_type):"",(0,e.createElement)("div",{className:"wcf-item__inner "},(0,e.createElement)("span",{className:"wcf-step-preview-wrap"},(0,e.createElement)("a",{className:"wcf-step-preview",href:r.link,target:"_blank",rel:"noreferrer"},"Preview",(0,e.createElement)("i",{className:"dashicons dashicons-external"}))),(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("img",{className:"wcf-item__thumbnail-image",src:r.featured_image_url,alt:(0,le.__)("Step thumbnail image","cartflows")}))),(0,e.createElement)("span",{className:"wcf-item__view"},"default"===a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Qv,{visibility:i,setVisibility:s,type:"ready-templates",stepName:c,setStepName:l,item:r}),(0,e.createElement)("span",{className:"wcf-item__btn",onClick:()=>{s("hide"===i?"show":"hide")}},(0,le.__)("Import","cartflows"))),"dynamic"===a&&(0,e.createElement)($v,{currentStep:r,stepName:"StepName",setInputFieldVisibility:s,step_id:o})),(0,e.createElement)("div",{className:"wcf-item__heading-wrap"},(0,e.createElement)("div",{className:"wcf-item__heading"},r.title)))))},Kv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getStoreStepTypes:t,getAllStepTemplates:n}=e("wcf/importer");return{step_types:t(),all_step_templates:n()}})))((function(n){let{required_step_type:r,step_types:a,all_step_templates:o,currentStepId:i}=n,s="dynamic";void 0===r&&(r=a,s="default");let c=0;void 0!==i&&(c=i);const l=Object.entries(r),[u,d]=(0,t.useState)(l[0][0]);(0,t.useEffect)((()=>{const e=Object.entries(r);d(e[0][0])}),[r]);const p=[];return o.forEach((e=>{u===e.type&&p.push(e)})),(0,e.createElement)(t.Fragment,null,"default"===s&&(0,e.createElement)("div",{className:"wcf-remote-filters"},(0,e.createElement)("div",{className:"wcf-categories"},(0,e.createElement)("ul",{className:"step-type-filter-links filter-links"},l.map((t=>(0,e.createElement)(Bv,{item:t,currentStep:u,setCurrentStep:d,key:t[0]})))))),(0,e.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row"},p.map((t=>(0,e.createElement)(Xv,{item:t,key:t.id,mode:s,step_id:c})))))})),Jv=function(){const[n,r]=(0,t.useState)("ready-templates"),[{page_builder:a}]=he();return(0,e.createElement)("div",{className:`wcf-step-library wcf-step-library-${a}`},(0,e.createElement)("div",{className:"wcf-step-library__header"},"other"!==a&&(0,e.createElement)("div",{className:"wcf-step-library__step-actions"},(0,e.createElement)("h3",null,(0,le.__)("Steps Library","cartflows")),(0,e.createElement)("div",{className:"wcf-tab-wrapper"},(0,e.createElement)("div",{className:"wcf-get-started-steps"},(0,e.createElement)("ul",{className:"filter-links "},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"#",className:"get-started-step-item "+("ready-templates"===n?"current":""),onClick:()=>{r("ready-templates")}},(0,le.__)("Ready Templates","cartflows"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"#",className:"get-started-step-item "+("create-your-own"===n?"current":""),onClick:()=>{r("create-your-own")}},(0,le.__)("Create Your Own","cartflows")))))))),(0,e.createElement)("div",{className:"wcf-step-library__body"},(0,e.createElement)("div",{className:"wcf-remote-content"},"other"!==a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-ready-templates "+("ready-templates"===n?"current":"")},(0,e.createElement)(Kv,null)),(0,e.createElement)("div",{className:"wcf-start-from-scratch "+("create-your-own"===n?"current":"")},(0,e.createElement)(Fv,null))),"other"===a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-start-from-scratch current"},(0,e.createElement)(Fv,null))))))},eb=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}})))((t=>{let{default_page_builder:n}=t;const[{flow_id:r}]=he();return"steps"===new URLSearchParams(Z().search).get("tab")?(0,e.createElement)(Jv,null):(0,e.createElement)("div",{className:"wcf-flow-library wcf-flex"},"other"!==n?(0,e.createElement)(te,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&action=wcf-edit-flow&flow_id=${r}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,e.createElement)(Fv,null))})),tb=function(){const t=new URLSearchParams(Z().search),n=t.get("tab"),r=t.get("sub-tab");return(0,e.createElement)(e.Fragment,null,function(){let t=(0,e.createElement)("h1",null,"Just test");if("library"===r)return(0,e.createElement)(eb,null);switch(n){case"settings":t=(0,e.createElement)(Pc,null);break;case"analytics":t=(0,e.createElement)(Ac,null);break;case"library":t=(0,e.createElement)(eb,null);break;case"canvas":t=(0,e.createElement)(Vw,null);break;default:t=(0,e.createElement)(kv,null)}return t}())},nb=function(n){const{type:r}=n,[{flow_id:a,title:o,steps:i,global_checkout:s},c]=he(),[l,u]=(0,t.useState)(!1),[d,p]=(0,t.useState)(""),f=!!Number.isInteger(s),m=Number.isInteger(s)?"disable":"enable",h={disable:(0,le.__)("Disable Store Checkout","cartflows"),enable:(0,le.__)("Enable Store Checkout","cartflows")},[g,y]=(0,t.useState)(f),[w,v]=(0,t.useState)(!1),[b,M]=(0,t.useState)(m),_=(0,t.createRef)();let E="";if("storeCheckout"===r)for(let e=0;e<i.length;e++)if("checkout"===i[e].type){E=i[e].id;break}const N=function(e){e.preventDefault(),u(!0)},D=function(e){e.preventDefault(),p("wcf-saving");const t=_.current.value,n=new window.FormData;n.append("action","cartflows_update_flow_title"),n.append("security",cartflows_admin.update_flow_title_nonce),n.append("flow_id",a),n.append("new_flow_title",t),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{c({type:"SET_FLOW_TITLE",title:t}),p(""),u(!1)}))},x=function(e){e.preventDefault(),u(!1)};return!1===o?"":(0,e.createElement)("div",{className:"wcf-edit-flow__title-wrap"},(0,e.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable"},function(){let t=o;""===o&&(t=(0,le.__)("(no title)","cartflows"));let n=De(t,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),a=(0,le.__)("Edit Flow Name","cartflows");"storeCheckout"===r&&(a=(0,le.__)("Edit Store Chekout Name","cartflows"));let i=(0,e.createElement)("a",{href:"#",className:"wcf-flows-header__title--edit",title:a,onClick:N},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}));return l&&(n=(0,e.createElement)(uc,{attr:{ref:_},id:"new-flow-title",value:o,autocomplete:"off",class:"new-flow-title"}),i=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:`wcf-button--small wcf-button--primary ${d}`,href:"#",onClick:D},(0,le.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button--small wcf-button--secondary",href:"#",onClick:x},(0,le.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-flows-header__title--text",title:t},n),(0,e.createElement)("span",{className:"wcf-flows-header__title--buttons"},i))}()),"storeCheckout"===r&&(0,e.createElement)("div",{className:"wcf-store-checkout_status--container"},!w&&(0,e.createElement)("span",{className:"wcf_store_checkout_status_label"},h[b]),w&&(0,e.createElement)("span",{className:"wcf-icon dashicons dashicons-update wcf-spinner is-active"}),(0,e.createElement)("div",{className:"wcf_store_checkout__status"},(0,e.createElement)("button",{type:"button",className:"wcf-switch",title:h[b],"data-wcf-order-bump-switch":g,"data-checkout-id":E,onClick:()=>{const e=new window.FormData;v(!0),e.append("action","cartflows_update_store_checkout_status"),e.append("security",cartflows_admin.update_store_checkout_status_nonce),e.append("checkout_id",E),e.append("enable_store_checkout",!g),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{e.success&&(y(!g),v(!1),c({type:"SET_GLOBAL_CHECKOUT",global_checkout:e.data.checkout_id}),M("enable"===b?"disable":"enable"))}))}}))),"flow"===r&&(0,e.createElement)("div",{className:"wcf-flows-header--breadcrums"},(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"}," ",(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&path=flows`,className:"wcf-breadcrum--nav-item__link"},(0,le.__)("Flows","cartflows"))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},""===o?(0,le.__)("(no title)","cartflows"):De(o,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))},rb=function(n){const{type:r}=n,[{flow_id:a,steps:o,is_cf_pro:i},s]=he();we();const c=cartflows_admin.woocommerce_status;return(0,t.useEffect)((()=>{let e=!0;return(async()=>{ye()({path:`/cartflows/v1/admin/flow-data/${a}`}).then((t=>{e&&s({type:"SET_FLOW_DATA",data:t})}))})(),()=>{e=!1}}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"editor-wrap__header"},function(){const t=o;if("active"===c&&i&&t.length>0){var n,r;let a=!1;t.map((e=>("upsell"!==e.type&&"downsell"!==e.type||(a=!0),"")));const o=null===(n=cartflows_admin)||void 0===n?void 0:n.supported_payment_gateways,i=null===(r=cartflows_admin)||void 0===r?void 0:r.available_payment_gateways;let s=[];if(a&&o&&i&&(Object.keys(i).map((e=>{if(!o.hasOwnProperty(e)){const t=i[e];s.push(t.method_title)}return""})),s.length>0))return s=s.join(", "),(0,e.createElement)("div",{className:"wcf-payment-gateway-notice"},(0,e.createElement)("div",{className:"wcf-payment-gateway-notice-text"},(0,le.__)("CartFlows Upsell/Downsell offer does not support the ","cartflows"),(0,e.createElement)("span",{className:"wcf-gateway-notice-style"},s),(0,le.__)(" payment gateway. Please find the supported payment gateways ","cartflows"),(0,e.createElement)("a",{href:"https://cartflows.com/docs/supported-payment-gateways-by-cartflows/",target:"_blank",rel:"noreferrer"},(0,le.__)("here.","cartflows"))))}}(),(0,e.createElement)(nb,{type:r})),(0,e.createElement)("div",{className:"editor-wrap__content"},"flow"===r&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(ve,null),(0,e.createElement)(xv,null)),"storeCheckout"===r&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Iv,null),(0,e.createElement)(tb,null))))},ab=function(){var t;const n=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search).get("flow_id");return de.flow_id=n,(0,e.createElement)(e.Fragment,null,(0,e.createElement)(me,{reducer:pe,initialState:de},(0,e.createElement)(rb,{type:"flow"})))};const ob={flow_id:0,step_id:0,is_cf_pro:!(null===(Vv=cartflows_admin)||void 0===Vv||!Vv.is_pro)&&cartflows_admin.is_pro,page_slug:null!==(Hv=cartflows_admin)&&void 0!==Hv&&Hv.home_slug?cartflows_admin.home_slug:"cartflows",admin_url:"test_url",page_builder:null!==(Gv=cartflows_admin)&&void 0!==Gv&&Gv.page_builder?cartflows_admin.page_builder:"other",page_builder_name:null!==(Zv=cartflows_admin)&&void 0!==Zv&&Zv.page_builder_name?cartflows_admin.page_builder_name:"",flow_title:"",title:!1,nav_tabs:{},step_data:{},view_url:"#",edit_url:"#",edit_builder_url:"#",settings_data:{},step_title:"",step_slug:"",design_settings:null,options:null,page_settings:null,billing_fields:null,shipping_fields:null,ob_id:null,current_ob:null};var ib=(e,t)=>{switch(t.type){case"SET_STEP_DATA":return t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.slug,{...e,title:t.data.title,flow_title:t.data.flow_title,view_url:t.data.view,edit_url:t.data.edit?t.data.edit.replace(/&amp;/g,"&"):"",edit_builder_url:t.data.page_builder_edit?t.data.page_builder_edit.replace(/&amp;/g,"&"):"",step_data:t.data,settings_data:t.data.settings_data,design_settings:t.data.design_settings,page_settings:t.data.page_settings,custom_fields:t.data.custom_fields,billing_fields:t.data.billing_fields,shipping_fields:t.data.shipping_fields,options:t.data.options,step_title:t.data.title,step_slug:t.data.slug};case"SET_OPTION":const n=e.options;return n[t.name]=t.value,{...e,options:n};case"SET_STEP_TITLE":return e.options.post_title=t.title,{...e,title:t.title};case"SET_OB_TITLE":const r=e.options[t.name].findIndex((e=>e.id===t.ob_id));return e.options[t.name][r].title=t.title,e.current_ob.title=t.title,{...e};case"SET_OB_STATUS":const a=e.options[t.name].findIndex((e=>e.id===t.ob_id));return e.options[t.name][a].status=t.newStatus,{...e};case"SET_STEP_VIEW_URL":return{...e,view_url:t.step_view_url};case"SET_FIELDS":return"billing"===t.field_type?{...e,billing_fields:t.fields}:{...e,shipping_fields:t.fields};case"SET_OB_OPTION":const o=e.current_ob;return o[t.name]=t.value,{...e,current_ob:o};case"UPDATE_OPTIONS":return{...e,options:t.options};case"ADD_CHECKOUT_PRODUCT":const i=e.options[t.field_name];return i&&(i.push(t.product_data),e.options[t.field_name]=i),{...e};case"REMOVE_CHECKOUT_PRODUCT":const s=t.unique_id,c=e.options[t.field_name];return s&&c&&(e.options[t.field_name]=c.filter((function(e){return e.unique_id!==s}))),{...e};case"UPDATE_CHECKOUT_PRODUCTS":return e.options[t.field_name]=t.products,{...e};case"UPDATE_ORDER_BUMP":return e.options[t.name]=t.order_bumps,{...e};case"REMOVE_ORDER_BUMP":const l=t.ob_id,u=e.options[t.name];return e.options[t.name]=u.filter((function(e){return e.id!==l})),{...e};case"SET_CURRENT_OB":return{...e,ob_id:t.ob_id,current_ob:t.current_ob};case"ADD_NEW_OB_GROUP":const d=e.current_ob[t.name];return d&&(d.push(t.newGroup),e.current_ob[t.name]=d),{...e};case"ADD_NEW_GROUP":const p=e.options[t.name];return p&&(p.push(t.newGroup),e.options[t.name]=p),{...e};case"ADD_NEW_OB_RULE":const f=e.current_ob[t.name],m=t.group_id;if(f&&m){for(const e of f)if(m===e.group_id){e.rules.push(t.newRule);break}e.current_ob[t.name]=f}return{...e};case"ADD_NEW_RULE":const h=e.options[t.name],g=t.group_id;if(h&&g){for(const e of h)if(g===e.group_id){e.rules.push(t.newRule);break}e.options[t.name]=h}return{...e};case"REMOVE_OB_RULE":const y=e.current_ob[t.name];for(let e=0;e<y.length;e++)if(t.group_id===y[e].group_id){const n=y[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){y[e].rules.splice(r,1);break}0===y[e].rules.length&&y.splice(e,1)}return e.current_ob[t.name]=y,{...e};case"REMOVE_RULE":const w=e.options[t.name];for(let e=0;e<w.length;e++)if(t.group_id===w[e].group_id){const n=w[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){w[e].rules.splice(r,1);break}0===w[e].rules.length&&w.splice(e,1)}return e.options[t.name]=w,{...e};case"RESET_OB_RULE_VALUE":const v=e.current_ob[t.name];for(const e of v)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.current_ob[t.name]=v,{...e};case"RESET_RULE_VALUE":const b=e.options[t.name];for(const e of b)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.options[t.name]=b,{...e};case"SET_RULES_GROUPS":return e.options[t.fieldName]=t.groups,{...e};case"SET_OB_RULES_GROUPS":return e.current_ob[t.fieldName]=t.groups,{...e};case"SET_OB":return e.options[t.fieldName]=t.obs,{...e};default:return e}},sb=function(t){var n;const{action:r,editAction:a}=t,[{page_slug:o,flow_id:i,step_id:s,step_data:c}]=he();let l=!0,u=[];if(null!=c&&c.tabs){const e=c.tabs;l=!1,u=[];const t=Object.values(e).sort((function(e,t){return e.priority-t.priority}));Object.keys(t).map((e=>{const n=t[e],r={name:n.title,id:n.id};return u.push(r),""}))}const d=new URLSearchParams(null===(n=Z())||void 0===n?void 0:n.search),p=d.get("page")?d.get("page"):o,f=d.get("tab")?d.get("tab"):"design";return(0,e.createElement)("div",{className:"wcf-edit-step--nav"},(0,e.createElement)(te,{key:`?page=${o}&action=${r}&flow_id=${i}`,to:{pathname:"admin.php",search:`?page=${o}&action=${r}&flow_id=${i}`},className:"wcf-edit-step--nav__back-to-flow"},(0,e.createElement)("button",{className:"wcf-edit-step--nav__back-to-flow--button"},(0,e.createElement)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,e.createElement)("span",{className:"wcf-back-button"},(0,le.__)("Back","cartflows")))),!l&&u.map((t=>(0,e.createElement)(te,{key:t.tab,to:{pathname:"admin.php",search:`?page=${o}&action=${a}&flow_id=${i}&step_id=${s}${""!==t.id&&"&tab="+t.id}`},className:"wcf-edit-step--nav__tab "+(p===o&&f===t.id?" wcf-edit-step--nav__tab--active":"")},t.name))))},cb=function(t){const{settings_data:n,nav_enable_header:r=!1,nav_header_data:a={nav_show_settings:!0}}=t,[{step_data:o,flow_id:i,step_id:c,options:l},u]=he(),[{},d]=s(),p=Z(),f=""!==p.hash?p.hash.replace("#",""):"";let m="";void 0!==n.settings&&(m=Object.values(n.settings).sort((function(e,t){return e.priority-t.priority})));const{nav_show_settings:h=!0}=a;return(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",i),t.append("step_id",c),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{d({status:"SAVED"}),u({type:"SET_STEP_VIEW_URL",step_view_url:e.step_view_url})}))}},r&&(0,e.createElement)("div",{className:"wcf-vertical-nav__header-wrap"},(0,e.createElement)("div",{className:"wcf-vertical-nav__header"},(0,e.createElement)("span",{className:"wcf-vertical-nav__header-title"},a.nav_settings_title),(0,e.createElement)("span",{className:"wcf-vertical-nav__header-button"},(0,e.createElement)(ze,null))),(0,e.createElement)("div",{className:"wcf-vertical-nav__header-content"},(0,e.createElement)(ke,a.nav_settings_field))),(0,e.createElement)("div",{className:"wcf-settings"},h&&(0,e.createElement)("div",{className:"wcf-vertical-nav"},(0,e.createElement)("div",{className:"wcf-vertical-nav__menu"},m&&Object.keys(m).map(((t,n)=>{const r=m[t];if(void 0!==r.title&&r.fields){const t=r.slug;return(0,e.createElement)(Cc,{title:r.title,slug:t,activeTab:""===f&&0===n?t:f,isActive:xe.isActiveControl(r,l),key:t})}return""}))),(0,e.createElement)("div",{className:"wcf-vertical-nav__content"},m&&Object.keys(m).map(((t,n)=>{const a=m[t];if(void 0!==a.title){const t=void 0!==a.slug?a.slug:"";return(0,e.createElement)(Lc,{slug:t,settings:a,activeTab:""===f&&0===n?t:f,stepdata:o,show_submit_button:!r,key:t})}return""}))))))},lb=function(){return(0,e.createElement)("div",{className:"wcf-design-page is-placeholder"},(0,e.createElement)("div",{className:"wcf-design-page__content"},(0,e.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,e.createElement)("div",{className:"wcf-design-page__customize"},(0,e.createElement)("div",{className:"wcf-design-page__button"}),(0,e.createElement)("div",{className:"wcf-design-page__button"})),(0,e.createElement)("div",{className:"wcf-design-page__text"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--60"})),(0,e.createElement)("div",{className:"wcf-design-page__WPeditor"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--80"}))),(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)("div",{className:"title"}),(0,e.createElement)("div",{className:"wcf-field wcf-checkbox-field"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("div",{className:"wcf-settings"},(0,e.createElement)("form",null,(0,e.createElement)("div",{className:"wcf-vertical-nav"},(0,e.createElement)("div",{className:"wcf-vertical-nav__menu"},Array(5).fill().map((t=>(0,e.createElement)("div",{className:"wcf-settings-nav__tab",key:t},(0,e.createElement)(Sc,{height:"45px"}))))),(0,e.createElement)("div",{className:"wcf-vertical-nav__content"},(0,e.createElement)(Ic,{fontSize:"35px",width:"225px"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"65%"}),(0,e.createElement)(jc,null),(0,e.createElement)(Ic,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"45%"}),(0,e.createElement)(jc,null),(0,e.createElement)(Ic,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"45%"})))))))},ub=function(){const[{step_id:n,view_url:r,edit_builder_url:a,design_settings:o,page_builder:i,page_builder_name:s,options:c,title:l}]=he();let u="";return(0,t.useEffect)((()=>{let e=!0;return()=>{e=!1}}),[]),"yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==i&&(u="disabled"),""===n?(0,e.createElement)(lb,null):(0,e.createElement)("div",{className:"wcf-design-page"},(0,e.createElement)("div",{className:"wcf-design-page__content"},(0,e.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},function(){let t=l;return""===l&&(t=(0,le.__)("(no title)","cartflows")),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-design-header__title--text"},(0,_e.decode)(t)))}()),(0,e.createElement)("div",{className:"wcf-design-page__customize"},function(){if("yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==i)return(0,e.createElement)("p",{className:"wcf-design-page__text"},(0,le.__)("It seems that the page builder you selected is inactive. If you prefer another page builder tool, you can ","cartflows"),(0,e.createElement)("a",{href:`?page=${cartflows_admin.home_slug}&path=settings`,target:"_blank",rel:"noreferrer"},(0,le.__)("select it here.","cartflows")))}(),(0,e.createElement)("a",{className:`wcf-design-page__button--edit wcf-button wcf-button--primary ${u}`,href:a,target:"__blank"},(0,le.__)("Edit Design","cartflows")),(0,e.createElement)("a",{className:"wcf-design-page__button--preview wcf-button wcf-button--secondary",href:r,target:"__blank"},(0,le.__)("View","cartflows"))),(0,e.createElement)("p",{className:"wcf-design-page__text"},function(){let e="";switch(s){case"Elementor":e=(0,le.__)("You are using a Elementor page builder, so all design options are available in the Elementor Widgets.","cartflows");break;case"Beaver Builder":e=(0,le.__)("You are using a Beaver Builder page builder, so all design options are available in the Beaver Builder Modules.","cartflows");break;case"Gutenberg":e=(0,le.__)("You are using a Gutenberg, so all design options are available in the Gutenberg Blocks.","cartflows");break;case"Divi":case"Other":e=(0,le.__)("","cartflows")}return e}()),(0,e.createElement)("a",{className:"wcf-design-page__WPeditor",href:Ne(n)},(0,le.__)("Go to WordPress Editor","cartflows"))),o&&(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)(cb,{settings_data:o,nav_enable_header:!0,nav_header_data:{nav_show_settings:"yes"===c["wcf-enable-design-settings"],nav_settings_title:(0,le.__)("Design Settings","cartflows"),nav_settings_field:{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:c["wcf-enable-design-settings"],label:(0,le.__)("Enable Design Settings","cartflows"),desc:(0,le.__)("If you are using shortcodes, enable this design settings.","cartflows")}}})))},db=function(){return(0,e.createElement)("div",{className:"wcf-settings-nav"},(0,e.createElement)("div",{className:"wcf-settings-nav__tabs"},Array(5).fill().map((t=>(0,e.createElement)("div",{className:"wcf-settings-nav__tab",key:t},(0,e.createElement)(Sc,{height:"45px"}))))),(0,e.createElement)("div",{className:"wcf-settings-nav__content"},(0,e.createElement)(Ic,{fontSize:"35px",width:"225px"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"65%"}),(0,e.createElement)(jc,null),(0,e.createElement)(Ic,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"45%"})))},pb=function(){const[{step_data:t,settings_data:n}]=he();let r=!0;void 0!==t.id&&(r=!1);const a=n;return r?(0,e.createElement)(db,null):(0,e.createElement)("div",{className:"wcf-settings-page"},(0,e.createElement)(cb,{settings_data:a}))},fb=function(){return(0,e.createElement)("div",{className:"wcf-checkout-products is-placeholder"},(0,e.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,e.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,e.createElement)("div",{className:"wcf-checkout-product-selection-field"},(0,e.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new"},(0,e.createElement)("div",{className:"wcf-checkout-products__button"}),(0,e.createElement)("div",{className:"wcf-checkout-products__button"})))))))))),(0,e.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,e.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,e.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field"},(0,e.createElement)("div",{className:"title"}))))))))))),(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-products__button"})))},mb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options wcf-offer-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=(e=>{let t="";const n=e.name;if(n&&n.includes("[")){const e=n.split("["),a=[];for(let t=1;t<e.length;t++)a.push(e[t].split("]")[0]);const o=n.substr(0,n.indexOf("[")),i=r[o],s=r["wcf-offer-product"];if((null==s||""===s||s.length<=0)&&("wcf-offer-product[original_price]"===n||"wcf-offer-product[sell_price]"===n))return(0,le.__)("No product Selected","cartflows");const c=Array.isArray(s)?parseFloat(s[0].original_price):parseFloat(s.original_price);if("wcf-offer-product[sell_price]"===n&&c){const e=r["wcf-offer-discount"],t=parseFloat(r["wcf-offer-discount-value"]);let n=c;return"discount_percent"===e?t>0&&(n=(c-c*t/100).toFixed(2)):"discount_price"===e&&t>0&&(n=(c-t).toFixed(2)),n}t=i[a[0]]}else t=r[e.name]?r[e.name]:"";return t})(a),c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))))},hb=function(){const[{flow_id:t,step_id:n,settings_data:r,page_settings:a}]=he(),[{},o]=s(),i=a;return void 0===r.settings?(0,e.createElement)(fb,null):(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const r=new window.FormData(e.target);r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",t),r.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{o({status:"SAVED"})}))}},(0,e.createElement)("div",{className:"wcf-products"},(0,e.createElement)("div",{className:"wcf-products--selection wcf-products__section"},(0,e.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,e.createElement)(mb,{settings:i.settings.product})))),(0,e.createElement)("div",null,(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},gb=function(n){const{addOB:r,closePopupCB:a}=n,[o,i]=(0,t.useState)(),[s,c]=(0,t.useState)((0,le.__)("Add Order Bump","cartflows")),[l,u]=(0,t.useState)(),[d,p]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"wcf-add-ob-popup-overlay",id:"wcf-add-ob-popup-overlay",onClick:function(e){"wcf-add-ob-popup-overlay"===e.target.id&&(a(),p(!1))}},(0,e.createElement)("div",{className:"wcf-add-ob-popup-content"},(0,e.createElement)("div",{className:"wcf-add-ob-header"},(0,e.createElement)("div",{className:"wcf-add-ob-header__title"},(0,e.createElement)("div",{className:"wcf-popup-header-title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),(0,le.__)("Add Order Bump","cartflows"))),(0,e.createElement)("div",{className:"wcf-popup-header-action",title:"Hide this",onClick:a},(0,e.createElement)("span",{className:"dashicons dashicons-no"}))),(0,e.createElement)("div",{className:"wcf-content-wrap"},(0,e.createElement)("div",{className:"wcf-add-ob-content"},(0,e.createElement)(Ce,{name:"",value:o,placeholder:(0,le.__)("Enter the order bump title…","cartflows"),onChangeCB:i,desc:l}),(0,e.createElement)("span",{className:"wcf-select-product__button"},(0,e.createElement)("a",{href:"#",className:"wcf-button wcf-button--primary",onClick:function(e){e.preventDefault(),p(!0),o?(c((0,le.__)("Adding…","cartflows")),d||r(o)):u((0,le.__)("Order bump title should not be empty…","cartflows"))}},s))))))},yb=function(n){const{flow_id:r,step_id:a,data:o,callback:i}=n,[{},s]=he(),[c,l]=(0,t.useState)(o.status),[u,d]=(0,t.useState)(!1),[p,f]=(0,t.useState)({button_text:(0,le.__)("Delete","cartflows"),is_processing:!1}),{button_text:m,is_processing:h}=p,[g,y]=(0,t.useState)({clone_button_text:(0,le.__)("Clone","cartflows"),is_cloning:!1}),{clone_button_text:w,is_cloning:v}=g;return(0,t.useEffect)((()=>{l(c)}),[c]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump",onDragEnd:i},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)(te,{to:{pathname:"admin.php",search:`?page=cartflows&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps&ob_id=${o.id}`},title:o.title},De(o.title,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length)),""===o.product&&(0,e.createElement)("span",{className:"wcf-flow-badge wcf-no-next-badge"},(0,le.__)("No product assigned","cartflows")))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("button",{type:"button",className:"wcf-ob-status wcf-switch wcf-toggle-order-bump-status switch-grid","data-wcf-order-bump-switch":c,onClick:function(e){d(!0);const t=e.target.getAttribute("data-ob_id"),n=new window.FormData;n.append("action","cartflows_pro_update_order_bump_status"),n.append("security",cartflows_admin.update_order_bump_status_nonce),n.append("ob_id",t),n.append("post_id",r),n.append("step_id",a),n.append("ob_status",!c),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{s({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!c,ob_id:t}),l(!c),d(!1)}))},"data-ob_id":o.id}),u&&(0,e.createElement)("span",{className:"wcf-icon dashicons dashicons-update wcf-spinner is-active"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)(te,{key:"edit-order-bump",to:{pathname:"admin.php",search:`?page=cartflows&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps&ob_id=${o.id}`},title:(0,le.__)("Edit Order Bump","cartflows")},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}),(0,e.createElement)("span",null,(0,le.__)("Edit","cartflows"))),(0,e.createElement)("a",{className:"wcf-clone-bump-button "+(v?"wcf-cloning":""),id:o.id,onClick:e=>{e.preventDefault();const t=new window.FormData,n=e.target.closest(".wcf-clone-bump-button").getAttribute("id");t.append("action","cartflows_pro_clone_order_bump"),t.append("security",cartflows_admin.clone_order_bump_nonce),t.append("ob_id",n),t.append("step_id",a),y({clone_button_text:(0,le.__)("Cloning…","cartflows"),is_cloning:!0}),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{e.success&&(y({clone_button_text:(0,le.__)("Clone","cartflows"),is_cloning:!1}),s({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}))}))},title:(0,le.__)("Clone Order Bump","cartflows")},(0,e.createElement)("span",{className:"dashicons dashicons-admin-page"}),(0,e.createElement)("span",null,w)),(0,e.createElement)("a",{className:h?"wcf-remove-order-bump-button wcf-removing":"wcf-remove-order-bump-button",id:o.id,onClick:function(e){if(e.preventDefault(),!window.confirm((0,le.__)("Do you really want to delete this order bump permanently?","cartflows")))return;const t=e.target.closest(".wcf-remove-order-bump-button").getAttribute("id"),n=new window.FormData;n.append("action","cartflows_pro_delete_order_bump"),n.append("security",cartflows_admin.delete_order_bump_nonce),n.append("ob_id",t),n.append("post_id",r),n.append("step_id",a),f({button_text:(0,le.__)("Deleting…","cartflows"),is_processing:!0}),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{e.success&&(f({button_text:(0,le.__)("Delete","cartflows"),is_processing:!1}),s({type:"REMOVE_ORDER_BUMP",name:"wcf-order-bumps",ob_id:t}))}))},title:(0,le.__)("Delete Order Bump","cartflows")},(0,e.createElement)("span",{className:"dashicons dashicons-trash"}),(0,e.createElement)("span",null,m))))))},wb=function(){return(0,e.createElement)("div",{className:"wcf-multiple-order-bumps is-placeholder"},(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,e.createElement)("span",{className:"wcf-add-new-order-bump wcf-button--primary"})),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,e.createElement)("div",{className:"wcf-column wcf-column--title"},"Title"),(0,e.createElement)("div",{className:"wcf-column wcf-column--status"},"Status"),(0,e.createElement)("div",{className:"wcf-column wcf-column--actions"},"Actions")),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__content"},(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump"},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)("span",{title:"ob"}))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("span",{className:"wcf-ob-status"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)("span",{title:"Edit Order Bump"}))))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump"},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)("span",{title:"ob"}))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("span",{className:"wcf-ob-status"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)("span",{title:"Edit Order Bump"})))))))},vb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options wcf-ob-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=(e=>{let t="";const n=e.name;if(n&&n.includes("[")){const e=n.split("["),a=[];for(let t=1;t<e.length;t++)a.push(e[t].split("]")[0]);const o=n.substr(0,n.indexOf("[")),i=r[o],s=r["wcf-order-bump-product"];if(!(""!==s&&null!==s||"wcf-order-bump-product[original_price]"!==n&&"wcf-order-bump-product[sell_price]"!==n))return(0,le.__)("No product Selected","cartflows");const c=Array.isArray(s)?parseFloat(s[0].original_price):parseFloat(s.original_price);if("wcf-order-bump-product[sell_price]"===n&&c){const e=r["wcf-order-bump-discount"],t=parseFloat(r["wcf-order-bump-discount-value"]);let n=c;return"discount_percent"===e?t>0&&(n=(c-c*t/100).toFixed(2)):"discount_price"===e?t>0&&(n=(c-t).toFixed(2)):"coupon"===e&&(n=(0,le.__)("Coupon will apply on checkout page","cartflows")),n}t=i[a[0]]}else t=r[e.name]?r[e.name]:"";return t})(a),c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))))},bb=function(){return(0,e.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section is-placeholder"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"checkbox-title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-offer__button"})))))},Mb=function(){const[{flow_id:t,step_id:n,settings_data:r,page_settings:a}]=he(),[{},o]=s();if(!cartflows_admin.is_pro)return(0,e.createElement)(yc,{feature:"Order Bump"});const i=a;return void 0===r.settings?(0,e.createElement)(bb,null):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const r=new window.FormData(e.target);r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",t),r.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{o({status:"SAVED"})}))}},(0,e.createElement)("div",{className:"wcf-order-bump-settings wcf-checkout__section"},(0,e.createElement)(vb,{settings:i.settings["order-bump"]})),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))))},_b=function(){const[{options:n,step_id:r,flow_id:a,page_settings:o},i]=he(),[s,c]=(0,t.useState)(!1);if(!cartflows_admin.is_pro)return(0,e.createElement)(yc,{feature:"Order Bumps"});if(null===n||"undefined"===o)return(0,e.createElement)(wb,null);if(null===n["wcf-order-bumps"]||void 0===n["wcf-order-bumps"])return(0,e.createElement)(Mb,null);const l=o,u=n["wcf-order-bumps"],d=Object.keys(u).length,p=o.settings["multiple-order-bump-design"],f=function(){c(!1)},m=()=>{const e=n["wcf-order-bumps"],t=[];Object.keys(e).map((n=>(t.push(e[n].id),"")));const a=new window.FormData;a.append("action","cartflows_pro_reorder_order_bumps"),a.append("security",cartflows_admin.reorder_order_bumps_nonce),a.append("step_id",r),a.append("sorted_obs",t),ye()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((()=>{}))};return(0,e.createElement)("div",{className:"wcf-multiple-order-bumps"},(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,e.createElement)("a",{className:"wcf-add-new-order-bump wcf-button wcf-button--primary",onClick:function(){c(!0)}},(0,e.createElement)("span",{className:"dashicons dashicons-plus"}),(0,e.createElement)("span",null,(0,le.__)("Add Order Bump","cartflows")))),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,e.createElement)("div",{className:"wcf-column wcf-column--title"},(0,le.__)("Title","cartflows")),(0,e.createElement)("div",{className:"wcf-column wcf-column--status"},(0,le.__)("Status","cartflows")),(0,e.createElement)("div",{className:"wcf-column wcf-column--actions"},(0,le.__)("Actions","cartflows"))),0===d&&(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__no-content"},(0,e.createElement)("p",null,(0,le.__)("No Order Bumps Found","cartflows"))),d>0&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__content"},u&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(be.ReactSortable,{list:u,setList:e=>i({type:"SET_OB",obs:e,fieldName:"wcf-order-bumps",step_id:r,flow_id:a}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bump",filter:".wcf-order-bump__action, .wcf_order_bump__status, .wcf-order-bump__data-title a",preventOnFilter:!1},u.map((t=>(0,e.createElement)(yb,{key:t.id,flow_id:a,step_id:r,data:t,title:t.title,settings:l.settings["multiple-order-bump"],design_settings:p,callback:m}))))))),s&&(0,e.createElement)(gb,{name:!0,closePopupCB:f,addOB:function(e){if(e){const t={title:e,id:Math.random().toString(36).substring(2,5)},n=new window.FormData;n.append("action","cartflows_pro_add_order_bump"),n.append("security",cartflows_admin.add_order_bump_nonce),n.append("ob_id",t.id),n.append("post_id",a),n.append("step_id",r),n.append("title",e),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{e.success&&(f(),i({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}))}))}}}))},Eb=function(){const[{options:n}]=he(),[r,a]=(0,t.useState)("");return(0,t.useEffect)((()=>{const e=document.getElementById("wcf-checkout-offer-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",(()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")}));return()=>{window.removeEventListener("scroll",n)}}),[]),(0,e.createElement)("div",{id:"wcf-checkout-offer-preview-wrapper",className:"fullscreen"===r?"wcf-checkout-offer-preview-wrapper fullscreen":"wcf-checkout-offer-preview-wrapper"},(0,e.createElement)(gc,{label:(0,le.__)("Checkout Offer Popup Preview","cartflows")}),""===r&&(0,e.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-button wcf-button wcf-button--secondary",onClick:()=>{a("fullscreen"),document.getElementById("wcf-co-options-wrapper").classList.add("full-screen"),document.body.classList.add("wcf-co-full-screen-preview")}},(0,le.__)("View in Full Screen","cartflows")),"fullscreen"===r&&(0,e.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-exit-button wcf-button wcf-button--secondary",onClick:()=>{a(""),document.getElementById("wcf-co-options-wrapper").classList.remove("full-screen"),document.body.classList.remove("wcf-co-full-screen-preview")}},(0,le.__)("Exit Full Screen","cartflows")),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-wrapper wcf-pre-checkout-full-width",style:{background:n["wcf-pre-checkout-offer-bg-color"]}},(0,e.createElement)("div",{id:"wcf-pre-checkout-offer-modal",style:{backgroundColor:n["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"wcf-content-main-wrapper"},(0,e.createElement)("div",{className:"wcf-lightbox-content",style:{backgroundColor:n["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"wcf-content-modal-progress-bar"},(0,e.createElement)("div",{className:"wcf-progress-bar-nav",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},(0,e.createElement)("div",{className:"wcf-pre-checkout-progress"},(0,e.createElement)("div",{className:"wcf-nav-bar-step active"},(0,e.createElement)("div",{className:"wcf-nav-bar-title",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},(0,le.__)("Order Submitted","cartflows")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line"},(0,e.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}},(0,e.createElement)("span",{className:"before"})),(0,e.createElement)("span",{className:"order-after",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}}))),(0,e.createElement)("div",{className:"wcf-nav-bar-step active inprogress"},(0,e.createElement)("div",{className:"wcf-nav-bar-title",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},(0,le.__)("Special Offer","cartflows-pro")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line"},(0,e.createElement)("span",{className:"before",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}}),(0,e.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}},(0,e.createElement)("span",{className:"before"})),(0,e.createElement)("span",{className:"after"}))),(0,e.createElement)("div",{className:"wcf-nav-bar-step"},(0,e.createElement)("div",{className:"wcf-nav-bar-title"},(0,le.__)("Order Receipt","cartflows-pro")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line"},(0,e.createElement)("span",{className:"before"}),(0,e.createElement)("div",{className:"wcf-progress-nav-step"})))))),(0,e.createElement)("div",{className:"wcf-content-main-head"},(0,e.createElement)("div",{className:"wcf-content-modal-title"},(0,e.createElement)("h1",{style:{color:n["wcf-pre-checkout-offer-title-color"]}},n["wcf-pre-checkout-offer-popup-title"])),(0,e.createElement)("div",{className:"wcf-content-modal-sub-title"},(0,e.createElement)("span",{style:{color:n["wcf-pre-checkout-offer-subtitle-color"]}},n["wcf-pre-checkout-offer-popup-sub-title"]))),(0,e.createElement)("div",{id:"wcf-pre-checkout-offer-content",className:"woocommerce",style:{backgroundColor:n["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-img"},(0,e.createElement)("img",{src:cartflows_admin.image_placeholder,alt:"Checkout Offer Product"})),(0,e.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-offer-product-details"},(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-product-title"},(0,e.createElement)("h1",{style:{color:n["wcf-pre-checkout-offer-title-color"]}},n["wcf-pre-checkout-offer-product-title"])),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-price",style:{color:n["wcf-pre-checkout-offer-desc-color"],fontWeight:500}},cartflows_admin.woo_currency," XX"),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-desc"},(0,e.createElement)("span",{style:{color:n["wcf-pre-checkout-offer-desc-color"],lineHeight:"0"}},n["wcf-pre-checkout-offer-desc"])),(0,e.createElement)("input",{type:"hidden",value:"add",className:"wcf-pre-checkout-offer-action"})),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-actions"},(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-add-cart-btn"},(0,e.createElement)("button",{className:"wcf-pre-checkout-offer-btn button alt",style:{backgroundColor:n["wcf-pre-checkout-offer-button-color"],borderColor:n["wcf-pre-checkout-offer-button-color"]}},n["wcf-pre-checkout-offer-popup-btn-text"])),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-skip-btn"},(0,e.createElement)("a",{className:"wcf-pre-checkout-skip",href:"#",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},n["wcf-pre-checkout-offer-popup-skip-btn-text"])))))))))},Nb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options wcf-co-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("div",{className:"wcf-co-options-wrapper",id:"wcf-co-options-wrapper"},(0,e.createElement)("table",{className:"wcf-co-settings"},(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=(e=>{let t="";const n=e.name;if(n&&n.includes("[")){const e=n.split("["),a=[];for(let t=1;t<e.length;t++)a.push(e[t].split("]")[0]);const o=n.substr(0,n.indexOf("[")),i=r[o];if("wcf-pre-checkout-offer-product[original_price]"===n||"wcf-pre-checkout-offer-product[sell_price]"===n){const e=r["wcf-pre-checkout-offer-product"];if(""===e||null==e||e.length<=0)return(0,le.__)("No product Selected","cartflows");const t=Array.isArray(e)?parseFloat(e[0].original_price):parseFloat(e.original_price);if("wcf-pre-checkout-offer-product[original_price]"===n)return t;if("wcf-pre-checkout-offer-product[sell_price]"===n&&t){const e=r["wcf-pre-checkout-offer-discount"],n=parseFloat(r["wcf-pre-checkout-offer-discount-value"]);let a=t;return"discount_percent"===e?n>0&&(a=(t-t*n/100).toFixed(2)):"discount_price"===e&&n>0&&(a=(t-n).toFixed(2)),a}}t=i[a[0]]}else t=r[e.name]?r[e.name]:"";return t})(a),c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,placeholder:a.placeholder,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:s}));break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc});break;case"sub-heading":i=(0,e.createElement)(Mc,{subClass:a.subClass,label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),"yes"===r["wcf-pre-checkout-offer"]&&(0,e.createElement)("div",{className:"wcf-co-preview"},(0,e.createElement)(Eb,null))))},Db=function(){const[{flow_id:t,step_id:n,settings_data:r,page_settings:a}]=he(),[{},o]=s(),i=a;return cartflows_admin.is_pro?void 0===r.settings?(0,e.createElement)(bb,null):(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const r=new window.FormData(e.target);r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",t),r.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((e=>{o({status:"SAVED"}),console.log(e)}))}},(0,e.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section"},(0,e.createElement)(Nb,{settings:i.settings["checkout-offer"]})),(0,e.createElement)("div",{className:"wcf-checkout-offer-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))):(0,e.createElement)(yc,{feature:"Checkout Offer"})},xb=function(){return(0,e.createElement)("div",{className:"wcf-checkout-rules-page"},(0,e.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,e.createElement)(Ic,{width:"65%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_wrapper"},(0,e.createElement)("div",{className:"wcf-checkout-rules--text"},(0,e.createElement)(Ic,{width:"10%"}),(0,e.createElement)(Sc,{width:"25%",height:"35px"}),(0,e.createElement)(Ic,{width:"20%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules"},Array(3).fill().map(((t,n)=>(0,e.createElement)("div",{className:"wcf-checkout-rule",key:t},(0,e.createElement)("div",{className:"wcf-checkout-rule--select-box"},(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"})),2!==n&&(0,e.createElement)("div",{className:"wcf-checkout-rule__and"},(0,e.createElement)(Sc,{height:"25px",width:"5%"})))))),(0,e.createElement)(Sc,{height:"40px",width:"9%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--or"},(0,e.createElement)(Sc,{height:"35px",width:"5%"}),(0,e.createElement)(Sc,{height:"45px",width:"12%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,e.createElement)(Ic,{width:"10%"}),(0,e.createElement)(Sc,{width:"25%",height:"35px"}),(0,e.createElement)(Ic,{width:"20%"})))},Ib=function(t){let{rules:n,group_id:r,g_index:a,groups_length:o}=t;const[{page_settings:i},s]=he(),c=i.settings.rules,l=c.conditions,u=e=>{const t=e.target.getAttribute("rule_id");r&&t&&s({type:"REMOVE_RULE",name:"wcf-checkout-rules",rule_id:t,group_id:r})};return(0,e.createElement)(e.Fragment,null,n.map(((t,i)=>{const d=null==t?void 0:t.rule_id,p=n[i],f=c.field_data[p.condition];return(0,e.createElement)(e.Fragment,null,0!==i&&(0,e.createElement)("div",{className:"wcf-checkout-rules--group_rules__condition-label"},(0,e.createElement)("div",{className:"wcf--condition-label__and_group"},(0,e.createElement)("span",{className:"wcf--condition-label__and_group__text"},"AND"))),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_rules","data-rule-id":d,key:d},(0,e.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${a}][rules][${i}][rule_id]`,value:d}),(0,e.createElement)("div",{className:"wcf-checkout-rules--rule_fields"},(0,e.createElement)(Ae,{name:`wcf-checkout-rules[${a}][rules][${i}][condition]`,options:l,onSelect:()=>{s({type:"RESET_RULE_VALUE",name:"wcf-checkout-rules",group_id:r,rule_id:d})},value:p.condition}),(0,e.createElement)(Ae,{name:`wcf-checkout-rules[${a}][rules][${i}][operator]`,options:f.operator,value:(0,Te.ZP)(p.operator)}),function(t,n,r){const o=r.value;let i="";const s=`wcf-checkout-rules[${a}][rules][${n}][value]`;return t.map((t=>{switch(t.type){case"select2":i=(0,e.createElement)(ba,{name:`${s}[]`,value:o,placeholder:t.placeholder,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti});break;case"number":i=(0,e.createElement)(dc,{name:s,value:o,min:0,placeholder:t.placeholder,tooltip:t.tooltip});break;case"coupon":i="exist"===r.operator||"not_exist"===r.operator?(0,e.createElement)(Ae,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,e.createElement)(vc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti});break;case"product":i=(0,e.createElement)(wc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti})}return i}))}(f.fields,i,p)),(0,e.createElement)("div",{className:"wcf-checkout-rules--rule_actions"},function(t,n){return 1===t&&1===o?"":(0,e.createElement)("span",{className:"dashicons dashicons-trash and-close",onClick:u,group_id:r,rule_id:n})}(n.length,d))))})))},jb=function(){const[{step_data:t,flow_id:n,step_id:r,options:a},o]=he(),[{},i]=s();if(!cartflows_admin.is_pro)return(0,e.createElement)(yc,{feature:"Dynamic Offers"});if(null===a)return(0,e.createElement)(xb,null);const c=a["wcf-checkout-rules"];if(void 0===c)return(0,e.createElement)(hc,{content:(0,le.__)("Please Update the CartFlows Pro to the latest version to use the dynamic offers feature.","cartflows")});const l=()=>{const e={group_id:Math.random().toString(36).substring(2,5),rules:[{rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""}]};o({type:"ADD_NEW_GROUP",name:"wcf-checkout-rules",newGroup:e})},u=e=>{const t=e.target.getAttribute("group_id"),n={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};o({type:"ADD_NEW_RULE",name:"wcf-checkout-rules",newRule:n,group_id:t})},d=function(e){const t=e.target.getAttribute("data-group_id"),n=document.getElementById(`wcf-checkout-rules--group-${t}`);p(e,n)},p=function(e,t){t.classList.contains("hidden")?(t.classList.remove("hidden"),e.target.classList.remove("dashicons-arrow-down"),e.target.classList.add("dashicons-arrow-up")):(t.classList.add("hidden"),e.target.classList.add("dashicons-arrow-down"),e.target.classList.remove("dashicons-arrow-up"))};return console.log(c),(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",n),t.append("step_id",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{i({status:"SAVED"}),console.log(e)}))}},(0,e.createElement)("div",{className:"wcf-checkout-rules-page"},(0,e.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,e.createElement)(ke,{name:"wcf-checkout-rules-option",value:a["wcf-checkout-rules-option"],label:(0,le.__)("Enable Dynamic Offers","cartflows"),tooltip:(0,le.__)("By enabling this option, you can create the conditions for the next-step (dynamic offer) redirection.","cartflows")})),"yes"===a["wcf-checkout-rules-option"]&&c&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(be.ReactSortable,{list:c,setList:e=>o({type:"SET_RULES_GROUPS",groups:e,fieldName:"wcf-checkout-rules",step_id:r}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-checkout-rules--group",filter:".wcf-checkout-rules--rule_fields, .wcf-checkout-rules--rule_actions, .wcf-field.wcf-select-option, .wcf-checkout-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-checkout-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-checkout-rules--or_group_button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-checkout-rules--or_group_button")[0].setAttribute("style","display:inline-block")}},c.map(((n,r)=>{const a=n.group_id,o=n.rules;return(0,e.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper",key:a},(0,e.createElement)("div",{className:"wcf-checkout-rules--group","data-group-id":a},(0,e.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${r}][group_id]`,value:a}),(0,e.createElement)("div",{className:"wcf-checkout-rules--redirection-step"},(0,e.createElement)("div",{className:"wcf-checkout-rules--group_header__left"},(0,e.createElement)("span",{className:"wcf-checkout-rules__handle dashicons dashicons-menu"}),(0,e.createElement)(Ae,{name:`wcf-checkout-rules[${r}][step_id]`,value:n.step_id,placeholder:(0,le.__)("Search for step…","cartflows"),options:t.step_lists,label:(0,le.__)("Redirect to ","cartflows"),after:(0,le.__)("If the following conditions are true","cartflows")})),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_header"},(0,e.createElement)("span",{className:"wcf-checkout-rules--group_id"},(0,le.__)("ID - ","cartflows"),a),(0,e.createElement)("span",{className:"dashicons dashicons-arrow-down",onClick:d,"data-group_id":a}))),(0,e.createElement)("div",{id:`wcf-checkout-rules--group-${a}`,className:"hidden"},(0,e.createElement)("div",{className:"wcf-checkout-rules--group_rules--wrapper"},0!==o.length&&(0,e.createElement)(Ib,{rules:o,group_id:a,g_index:r,groups_length:c.length})),(0,e.createElement)("div",{className:"wcf-checkout-rules--add-rule__repeater"},(0,e.createElement)("div",{className:"wcf-button wcf-button--secondary ",group_id:a,onClick:u},(0,le.__)("Add Condition","cartflows"))))),(0,e.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper__footer"},(0,e.createElement)("div",{className:"wcf-checkout-rules--or-group"},(0,e.createElement)("span",{className:"wcf-checkout-rules--or_group__text"},(0,le.__)("OR","cartflows"))),parseInt(r)+1===c.length&&(0,e.createElement)("div",{className:"wcf-checkout-rules--or_group__button"},(0,e.createElement)("span",{className:"wcf-checkout-rules--or_group_button or-button wcf-button wcf-button--secondary",onClick:l},(0,le.__)("Add Dynamic Offer","cartflows")))))})))),"yes"===a["wcf-checkout-rules-option"]&&(0,e.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,e.createElement)(Ae,{name:"wcf-checkout-rules-default-step",value:a["wcf-checkout-rules-default-step"],placeholder:(0,le.__)("Search for default step…","cartflows"),options:t.step_lists,label:(0,le.__)("Redirect to","cartflows"),after:(0,le.__)("If all of the above conditions failed.","cartflows")}))),(0,e.createElement)("div",{className:"wcf-checkout-rules-save-settings"},(0,e.createElement)(ze,{className:"wcf-button wcf-button--primary"})))},Sb=function(n){const{innerField:r,innerFieldData:a,removecustomField:o,type:i}=n,[s,c]=(0,t.useState)((0,le.__)("Remove","cartflows")),[{options:l}]=he();return(0,e.createElement)("div",{className:"wcf-field-item__settings hidden",id:`wcf-field-setting-${r}`},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,a&&Object.keys(a.field_options).map((t=>{const n=a.field_options[t];let r="";const o=function(e){const t=e.name;let n="";if(t.includes("[")){const e=t.split("["),r=[];for(let t=1;t<e.length;t++)r.push(e[t].split("]")[0]);const a=t.substr(0,t.indexOf("["));n=l[a][r[0]][r[1]]}else n=l[e.name]?l[e.name]:e.value;return n}(n);switch(n.type){case"text":r=(0,e.createElement)(Ce,{class:n.class,name:n.name,value:o,label:n.label,placeholder:n.placeholder,readonly:n.readonly});break;case"checkbox":r=(0,e.createElement)(ke,{class:n.class,name:n.name,value:o,label:n.label,desc:n.desc,child_class:n.child_class});break;case"select":r=(0,e.createElement)(Ae,{class:n.class,name:n.name,value:o,label:n.label,options:n.options});break;case"doc":r=(0,e.createElement)(hc,{content:n.content})}return(0,e.createElement)("tr",{className:`wcf-cfe-field-${t}`,key:n.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,r)))})))),a.custom&&(0,e.createElement)("div",{className:"wcf-cpf-actions"},(0,e.createElement)("a",{className:"wcf-pro-custom-field-remove","data-key":r,"data-type":i,onClick:function(e){c((0,le.__)("Removing…","cartflows")),o(e)}},s)))},Tb=function(t){const[{billing_fields:n,shipping_fields:r},a]=he(),{step:o,type:i,removeCallback:s}=t;let c=[];c="billing"===i?n:r;const l=function(e){const t=e.target.getAttribute("data-name"),n=document.getElementById(`wcf-field-setting-${t}`);n.classList.contains("hidden")?n.classList.remove("hidden"):n.classList.add("hidden")},u=function(e){const t=e.target,n=t.getAttribute("for"),r=document.getElementById(n);t.classList.contains("dashicons-visibility")?(t.classList.remove("dashicons-visibility"),t.classList.add("dashicons-hidden"),t.closest(".wcf-field-item__bar").classList.add("wcf-field-item__disabled")):(t.classList.remove("dashicons-hidden"),t.classList.add("dashicons-visibility"),t.closest(".wcf-field-item__bar").classList.remove("wcf-field-item__disabled")),r.click()},d=function(e){s(e)};return(0,e.createElement)("div",null,(0,e.createElement)(be.ReactSortable,{list:c,setList:e=>a({type:"SET_FIELDS",field_type:i,fields:e}),direction:"vertical",animation:150,handle:".wcf-field-item"},c&&c.map((t=>{const n=t.key,r=t.enabled;return(0,e.createElement)("div",{key:n,className:"wcf-field-item","data-key":n},(0,e.createElement)("div",{className:"yes"===r?"wcf-field-item__bar ":"wcf-field-item__bar wcf-field-item__disabled"},(0,e.createElement)("div",{className:"wcf-field-item-handle"},(0,e.createElement)("span",{className:"yes"===r?"dashicons dashicons-visibility":"dashicons dashicons-hidden",htmlFor:"checkout"===o?`wcf_field_order_${i}[${n}][enabled]`:`wcf-optin-fields-${i}[${n}][enabled]`,onClick:u}),(0,e.createElement)("span",{className:"item-title"},(0,e.createElement)("span",{className:"wcf-field-item-title"},t.label?t.label:t.placeholder),"yes"===t.required&&(0,e.createElement)("span",null," *"),("billing_email"===n||"shipping_email"===n)&&(0,e.createElement)(bc,{text:(0,le.__)("Email field is not editable when using the Modern Checkout Style","cartflows"),position:"right"})),(0,e.createElement)("span",{className:"item-controls"},(0,e.createElement)("span",{className:"dashicons dashicons-menu"}),(0,e.createElement)("span",{className:"dashicons dashicons-arrow-down",onClick:l,"data-name":n})))),(0,e.createElement)(Sb,{innerField:n,innerFieldData:t,removecustomField:d,type:i}))}))))},kb=function(n){const{addNewField:r,step_type:a}=n,[o,i]=(0,t.useState)(!1),[s,c]=(0,t.useState)(!1),[l,u]=(0,t.useState)((0,le.__)("Add New Field","cartflows")),d=function(){i(!1),c(!1),h(!1),u((0,le.__)("Add New Field","cartflows"))},p=function(e){e.preventDefault(),i(!1)},f=function(e){e.preventDefault(),c(!0),u((0,le.__)("Adding…","cartflows")),s||r(e,d)},[m,h]=(0,t.useState)(!1),[g,y]=(0,t.useState)(!0),[w,v]=(0,t.useState)(!1),[b,M]=(0,t.useState)(!1),_=function(){h(!m)},E=function(){const e=document.getElementById("wcf-checkout-custom-fields[0][type]").value;v(!1),M(!1),y(!1),"text"===e||"textarea"===e?y(!0):"select"===e?M(!0):"checkbox"===e&&v(!0)};return(0,e.createElement)("div",{className:"wcf-custom-field-box"},(0,e.createElement)("p",null,(0,e.createElement)("button",{className:"wcf-add-custom-field wcf-button wcf-button--secondary",onClick:function(e){e.preventDefault(),i(!0)}},(0,le.__)("Add Custom Field","cartflows"))),o&&(0,e.createElement)("div",{className:"wcf-cfe-popup-overlay",onClick:function(e){"wcf-cfe-popup-overlay"===e.target.className&&(i(!1),c(!1))}},(0,e.createElement)("div",{className:"wcf-cfe-popup-content-wrapper"},function(){const t=[{value:"billing",label:(0,le.__)("Billing","cartflows")},{value:"shipping",label:(0,le.__)("Shipping","cartflows")}],n=[{value:"text",label:(0,le.__)("Text","cartflows")},{value:"textarea",label:(0,le.__)("TextArea","cartflows")},{value:"checkbox",label:(0,le.__)("Checkbox","cartflows")},{value:"select",label:(0,le.__)("Select","cartflows")},{value:"hidden",label:(0,le.__)("Hidden","cartflows")}],r=[{value:"33",label:(0,le.__)("33%","cartflows")},{value:"50",label:(0,le.__)("50%","cartflows")},{value:"100",label:(0,le.__)("100%","cartflows")}];return(0,e.createElement)("div",{className:"wcf-cfe-popup-content"},(0,e.createElement)("div",{className:"wcf-cpf-row-header"},(0,e.createElement)("div",{className:"wcf-popup-header-title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),(0,le.__)("Add Custom Field","cartflows")),(0,e.createElement)("div",{className:"wcf-popup-header-action"},(0,e.createElement)("span",{className:"wcf-close-popup dashicons dashicons-no-alt",onClick:p}))),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,"checkout"===a&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-add_to",name:"wcf-checkout-custom-fields[0][add_to]",options:t,label:(0,le.__)("Add To","cartflows")}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-type",id:"wcf-checkout-custom-fields[0][type]",name:"wcf-checkout-custom-fields[0][type]",options:n,label:(0,le.__)("Type","cartflows"),onSelect:E}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ce,{class:"wcf-cpf-label",name:"wcf-checkout-custom-fields[0][label]",label:(0,le.__)("Label","cartflows")}))),b&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Le,{class:"wcf-cpf-options",name:"wcf-checkout-custom-fields[0][options]",label:(0,le.__)("Options","cartflows"),placeholder:(0,le.__)("Enter your options separated by comma.","cartflows")}))),w&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-default",name:"wcf-checkout-custom-fields[0][default]",label:(0,le.__)("Default","cartflows"),options:[{value:"1",label:(0,le.__)("Checked","cartflows")},{value:"0",label:(0,le.__)("UnChecked","cartflows")}]}))),!w&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ce,{class:"wcf-cpf-default",name:"wcf-checkout-custom-fields[0][default]",label:(0,le.__)("Default","cartflows")}))),g&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ce,{class:"wcf-cpf-placeholder",name:"wcf-checkout-custom-fields[0][placeholder]",label:(0,le.__)("Placeholder","cartflows")}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-width",name:"wcf-checkout-custom-fields[0][width]",options:r,value:"100",label:(0,le.__)("Width","cartflows")}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{class:"wcf-cpf-required",name:"wcf-checkout-custom-fields[0][required]",label:(0,le.__)("Required","cartflows"),onClick:_}))),!m&&"optin"!==a&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{class:"wcf-cpf-optimized",name:"wcf-checkout-custom-fields[0][optimized]",label:(0,le.__)("Collapsible","cartflows")}))),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:f},l)))))}())))},Ob=function(){return(0,e.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section is-placeholder"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("form",null,(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})))),(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-custom-fields__button"})))),(0,e.createElement)(Ic,{fontSize:"35px",width:"400px"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"65%"}))},Ab=function(){const[{custom_fields:t,step_id:n,flow_id:r,options:a,billing_fields:o,shipping_fields:i},c]=he(),[{},l]=s();if(void 0===t)return(0,e.createElement)(Ob,null);const u=t.extra_fields,d=function(e){e.preventDefault();const t=new FormData,r=e.target.getAttribute("data-key"),a=e.target.getAttribute("data-type");t.append("action","cartflows_pro_delete_custom_field"),t.append("security",cartflows_admin.delete_custom_field_nonce),t.append("post_id",n),t.append("key",r),t.append("type",a),t.append("step","checkout"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{if(e.status){const e=o.filter((function(e){return e.key!==r}));c({type:"SET_FIELDS",field_type:"billing",fields:e});const t=i.filter((function(e){return e.key!==r}));c({type:"SET_FIELDS",field_type:"shipping",fields:t})}}))};return(0,e.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("h3",{className:"wcf-custom-field-editor__title"},(0,le.__)("Field Settings","cartflows")),(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",r),t.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{l({status:"SAVED"})}))}},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,u&&Object.keys(u.fields).map((t=>{const n=u.fields[t],r=a[n.name]?a[n.name]:"",o=xe.isActiveControl(n,a);return(0,e.createElement)("tr",{className:o?"":"wcf-hide",key:n.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{name:n.name,value:r,label:n.label,desc:n.desc,child_class:n.child_class})))})))),"yes"===a["wcf-custom-checkout-fields"]&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,e.createElement)("h3",null,(0,le.__)("Custom Field Editor","cartflows")),cartflows_admin.is_pro&&(0,e.createElement)("div",{className:"wcf-custom-field-editor-buttons"},(0,e.createElement)(kb,{addNewField:function(e,t){e.preventDefault();const r=document.getElementsByClassName("wcf-cpf-add_to")[0],s=document.getElementsByClassName("wcf-cpf-type")[0],l=document.getElementsByClassName("wcf-cpf-label")[0],u=document.getElementsByClassName("wcf-cpf-default")[0],d=document.getElementsByClassName("wcf-cpf-placeholder")[0],p=document.getElementsByClassName("wcf-cpf-options")[0],f=document.getElementsByClassName("wcf-cpf-width")[0],m=document.getElementsByClassName("wcf-cpf-required")[1],h=document.getElementsByClassName("wcf-cpf-optimized")[1];if(""===l.value)return alert((0,le.__)("Label is required field","cartflows")),"";const g=new FormData;g.append("add_to",r?r.value:""),g.append("type",s?s.value:""),g.append("label",l?l.value:""),g.append("default",u?u.value:""),g.append("placeholder",d?d.value:""),g.append("options",p?p.value:""),g.append("width",f?f.value:""),g.append("required",m?m.value:""),g.append("optimized",h?h.value:""),g.append("action","cartflows_pro_prepare_custom_field"),g.append("security",cartflows_admin.prepare_custom_field_nonce),g.append("post_id",n),g.append("save_field_name","wcf_field_order_"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:g}).then((e=>{if(e.success){const t=e.data,n=t.field_data;if("billing"===t.add_to){o.push(n);const e=a.wcf_field_order_billing;e[t.new_field.key]=t.new_field,c({type:"SET_OPTION",name:"wcf_field_order_billing",value:e}),c({type:"SET_FIELDS",field_type:"billing",fields:o})}if("shipping"===t.add_to){i.push(n);const e=a.wcf_field_order_shipping;e[t.new_field.key]=t.new_field,c({type:"SET_OPTION",name:"wcf_field_order_shipping",value:e}),c({type:"SET_FIELDS",field_type:"shipping",fields:i})}}t()}))},step_type:"checkout"}))),(0,e.createElement)("div",{className:"wcf-billings-fields-section"},(0,e.createElement)("h3",null,(0,le.__)("Billing Fields","cartflows")),(0,e.createElement)("ul",{id:"wcf-billing-fields",className:"billing-field-sortable wcf-field-row"},o&&(0,e.createElement)(Tb,{data:o,step:"checkout",type:"billing",removeCallback:d}))),(0,e.createElement)("div",{className:"wcf-shippings-fields-section"},(0,e.createElement)("h3",null,(0,le.__)("Shipping Fields","cartflows")),(0,e.createElement)("ul",{id:"wcf-shipping-fields",className:"shipping-field-sortable wcf-field-row"},i&&(0,e.createElement)(Tb,{data:i,step:"checkout",type:"shipping",removeCallback:d})))),(0,e.createElement)(ze,{class:"wcf-save-cusom-field-editor wcf-button wcf-button--primary"}))))},Cb=function(){return(0,e.createElement)("div",{className:"wcf-custom-field-editor is-placeholder"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("form",null,(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"checkbox-title"})))),(0,e.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,e.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("div",{className:"wcf-optin-fields"},(0,e.createElement)("div",{className:"title"}),(0,e.createElement)("div",{className:"title"}),(0,e.createElement)("div",{className:"title"}))),(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-optin-form-field__button"})))))},Lb=function(){const[{custom_fields:t,step_id:n,flow_id:r,options:a,billing_fields:o},i]=he(),[{},c]=s();if(void 0===t)return(0,e.createElement)(Cb,null);const l=t.extra_fields;return(0,e.createElement)("div",{className:"wcf-custom-field-editor"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("h3",{className:"wcf-custom-field-editor__title"},(0,le.__)("Field Editor","cartflows")),(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",r),t.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{c({status:"SAVED"}),console.log(e)}))}},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,l&&Object.keys(l.fields).map((t=>{const n=l.fields[t],r=a[n.name]?a[n.name]:"";return(0,e.createElement)("tr",{key:t},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{name:n.name,value:r,label:n.label,desc:n.desc})))})))),"yes"===a["wcf-optin-enable-custom-fields"]&&(0,e.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,e.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,e.createElement)("h3",null,(0,le.__)("Form Fields","cartflows")),cartflows_admin.is_pro&&(0,e.createElement)("div",{className:"wcf-custom-field-editor-buttons"},(0,e.createElement)(kb,{addNewField:function(e,t){e.preventDefault();const r=document.getElementsByClassName("wcf-cpf-type")[0],s=document.getElementsByClassName("wcf-cpf-label")[0],c=document.getElementsByClassName("wcf-cpf-default")[0],l=document.getElementsByClassName("wcf-cpf-placeholder")[0],u=document.getElementsByClassName("wcf-cpf-options")[0],d=document.getElementsByClassName("wcf-cpf-width")[0],p=document.getElementsByClassName("wcf-cpf-required")[1],f=document.getElementsByClassName("wcf-cpf-optimized")[1];if(""===s.value)return alert((0,le.__)("Label is required field","cartflows")),"";const m=new FormData;m.append("add_to","billing"),m.append("type",r?r.value:""),m.append("label",s?s.value:""),m.append("default",c?c.value:""),m.append("placeholder",l?l.value:""),m.append("options",u?u.value:""),m.append("width",d?d.value:""),m.append("required",p?p.value:""),m.append("optimized",f?f.value:""),m.append("action","cartflows_pro_prepare_custom_field"),m.append("security",cartflows_admin.prepare_custom_field_nonce),m.append("post_id",n),m.append("save_field_name","wcf-optin-fields-"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:m}).then((e=>{if(e.success){const t=e.data,n=t.field_data;if("billing"===t.add_to){o.push(n);const e=a["wcf-optin-fields-billing"];e[t.new_field.key]=t.new_field,i({type:"SET_OPTION",name:"wcf-optin-fields-billing",value:e}),i({type:"SET_FIELDS",field_type:"billing",fields:o})}}t()}))},step_type:"optin"}))),(0,e.createElement)("ul",{id:"wcf-optin-fields",className:"billing-field-sortable wcf-field-row"},(0,e.createElement)(Tb,{data:o,step:"optin",type:"billing",removeCallback:function(e){e.preventDefault();const t=new FormData,r=e.target.getAttribute("data-key"),a=e.target.getAttribute("data-type");t.append("action","cartflows_pro_delete_custom_field"),t.append("security",cartflows_admin.delete_custom_field_nonce),t.append("post_id",n),t.append("key",r),t.append("type",a),t.append("step","optin"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{if(console.log(e),e.status){const e=o.filter((function(e){return e.key!==r}));i({type:"SET_FIELDS",field_type:"billing",fields:e})}}))}}))),(0,e.createElement)(ze,{class:"wcf-save-cusom-field-editor wcf-button wcf-button--primary"}))))},zb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=r[a.name]?r[a.name]:"",c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:a.readonly?a.value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"product-repeater":i=(0,e.createElement)(Na,{id:a.name,name:a.name,value:s,label:a.label});break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"product-options":i=(0,e.createElement)(Da,{id:a.name,name:a.name,label:a.label,products:s});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))))},Pb=function(){const[{step_data:t,flow_id:n,step_id:r,settings_data:a,page_settings:o,is_cf_pro:i,options:c}]=he(),[{},l]=s(),u=o;if(void 0===a.settings)return(0,e.createElement)(fb,null);const d=c["wcf-checkout-products"];return(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);if(t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",n),t.append("step_id",r),"single-selection"===c["wcf-product-options"]){const e=t.get("wcf_default_add_to_cart");t.set(`wcf-product-options-data[${e}][add_to_cart]`,"yes")}ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{l({status:"SAVED"})}))}},(0,e.createElement)("div",{className:"wcf-checkout-products"},(0,e.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,e.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,e.createElement)(zb,{settings:u.settings.product}))),"checkout"===t.type&&(0,e.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,e.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,e.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,e.createElement)(zb,{settings:u.settings.coupon}))),function(t){return 0===t.length&&i?(0,e.createElement)("div",{className:"wcf-product-options-section"},(0,e.createElement)("h3",{className:"wcf-product-options__title"},(0,le.__)("Product Options","cartflows")),(0,e.createElement)("div",{className:"wcf-product-options-notice__text"},(0,le.__)("No Products Selected. Please add product/s first.","cartflows"))):(0,e.createElement)("div",{className:"wcf-checkout-products--options"},(0,e.createElement)("div",{className:"wcf-product-options-wrapper"},(0,e.createElement)(zb,{settings:u.settings["product-options"]})))}(d))),(0,e.createElement)("div",null,(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},Ub=function(){const t=new URLSearchParams(Z().search).get("tab");return(0,e.createElement)(e.Fragment,null,function(){var n,r;let a=(0,e.createElement)("h1",null,"404 Not Found");switch(t){case"design":default:a=(0,e.createElement)(ub,null);break;case"settings":a=(0,e.createElement)(pb,null);break;case"checkout_form_fields":a=(0,e.createElement)(Ab,null);break;case"checkout_products":a=(0,e.createElement)(Pb,null);break;case"products":a=(0,e.createElement)(hb,null);break;case"order_bumps":a="no"===(null===(n=cartflows_admin)||void 0===n?void 0:n.is_order_bump_migrated)||"processing"===(null===(r=cartflows_admin)||void 0===r?void 0:r.is_order_bump_migrated)?(0,e.createElement)(Mb,null):(0,e.createElement)(_b,null);break;case"checkout_offer":a=(0,e.createElement)(Db,null);break;case"optin_form_fields":a=(0,e.createElement)(Lb,null);break;case"dynamic-offers":a=(0,e.createElement)(jb,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper"},a))}())},Yb=function(){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&path=flows`,className:"wcf-breadcrum--nav-item__link"},(0,le.__)("Flows","cartflows"))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "))},Rb=function(n){const{type:r,action:a}=n,[{flow_id:o,flow_title:i,title:s,step_id:c,view_url:l},u]=he();(0,t.useEffect)((()=>{let e=!0;return()=>{e=!1}}),[]);const[d,p]=(0,t.useState)(!1),[f,m]=(0,t.useState)(""),h=(0,t.createRef)(),g=function(e){e.preventDefault(),p(!0)},y=function(e){e.preventDefault(),m("wcf-saving");const t=h.current.value,n=new window.FormData;n.append("action","cartflows_update_step_title"),n.append("security",cartflows_admin.update_step_title_nonce),n.append("step_id",c),n.append("new_step_title",t),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{u({type:"SET_STEP_TITLE",title:t}),m(""),p(!1)}))},w=function(e){e.preventDefault(),p(!1)};return!1===s?"":(0,e.createElement)("div",{className:"wcf-edit-step__title-wrap"},(0,e.createElement)("div",{className:"wcf-steps-header--title wcf-step__title--editable"},function(){let t=s;""===t&&(t=(0,le.__)("(no title)","cartflows"));let n=De(t,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),r=(0,e.createElement)("a",{href:"#",className:"wcf-steps-header__title--edit",title:(0,le.__)("Edit Step Name","cartflows"),onClick:g},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}));return d&&(n=(0,e.createElement)(uc,{attr:{ref:h},id:"new-step-title",value:t,autocomplete:"off",class:"new-step-title"}),r=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:`wcf-button--small wcf-button--primary ${f}`,href:"#",onClick:y},(0,le.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button--small wcf-button--secondary",href:"#",onClick:w},(0,le.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-steps-header__title--text",title:t},n),(0,e.createElement)("span",{className:"wcf-steps-header__title--buttons"},r))}(),!d&&(0,e.createElement)("span",{className:"wcf-steps-header__quick-view"},(0,e.createElement)("a",{href:l,className:"wcf-steps-header__quick-view--button",title:(0,le.__)("Quick View","cartflows"),target:"_blank",rel:"noreferrer"},(0,e.createElement)("span",{className:"dashicons dashicons-external"})))),(0,e.createElement)("div",{className:"wcf-steps-header--breadcrums"},"flow"===r&&(0,e.createElement)(Yb,null),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&action=${a}&flow_id=${o}`,className:"wcf-breadcrum--nav-item__link"},""===i?(0,le.__)("(no title)","cartflows"):De(i,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},""===s?(0,le.__)("(no title)","cartflows"):De(s,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))},Qb=function(){const[{step_id:n,step_data:r},a]=he(),[{unsavedChanges:o}]=s(),i=cartflows_admin.woocommerce_status;we(),(0,t.useEffect)((()=>{let e=!0;return(async()=>{ye()({path:`/cartflows/v1/admin/step-data/${n}`}).then((t=>{if(e){if(t.billing_fields){const e=Object.entries(t.billing_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.billing_fields=e}if(t.shipping_fields){const e=Object.entries(t.shipping_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.shipping_fields=e}a({type:"SET_STEP_DATA",data:t})}}))})(),()=>{e=!1}}),[]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Q,{when:o,message:"Are you sure you want to leave?"}),(0,e.createElement)("div",{className:"editor-wrap__header"},function(){if("active"!==i&&Object.keys(r).length>0&&"landing"!==r.type)return(0,e.createElement)("div",{className:"wcf-woo-notice"},(0,le.__)("This page requires WooCommerce plugin installed and activated!","cartflows"))}(),function(){if("active"===i&&r&&("upsell"===r.type||"downsell"===r.type)){var t,n;const r=null===(t=cartflows_admin)||void 0===t?void 0:t.supported_payment_gateways,a=null===(n=cartflows_admin)||void 0===n?void 0:n.available_payment_gateways;let o=[];if(r&&a&&(Object.keys(a).map((e=>{if(!r.hasOwnProperty(e)){const t=a[e];o.push(t.method_title)}return""})),o.length>0))return o=o.join(", "),(0,e.createElement)("div",{className:"wcf-payment-gateway-notice"},(0,e.createElement)("div",{className:"wcf-payment-gateway-notice-text"},(0,le.__)("CartFlows Upsell/Downsell offer does not support the ","cartflows"),(0,e.createElement)("span",{className:"wcf-gateway-notice-style"},o),(0,le.__)(" payment gateway. Please find the supported payment gateways ","cartflows"),(0,e.createElement)("a",{href:"https://cartflows.com/docs/supported-payment-gateways-by-cartflows/",target:"_blank",rel:"noreferrer"},(0,le.__)("here.","cartflows"))))}}(),(0,e.createElement)(Rb,{type:"flow",action:"wcf-edit-flow"})),(0,e.createElement)("div",{className:"editor-wrap__content"},(0,e.createElement)(sb,{action:"wcf-edit-flow",editAction:"wcf-edit-step"}),(0,e.createElement)(Ub,null)))},Fb=function(){var t;const[{page_slug:n,flow_id:r,step_id:a}]=he();let o=[];o=[{name:(0,le.__)("Product","cartflows"),id:"product"},{name:(0,le.__)("Design","cartflows"),id:"design"},{name:(0,le.__)("Content","cartflows"),id:"content"},{name:(0,le.__)("Conditions","cartflows"),id:"conditions"},{name:(0,le.__)("Settings","cartflows"),id:"settings"}];const i=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search),s=i.get("page")?i.get("page"):n,c=i.get("obtab")?i.get("obtab"):"product",l=i.get("ob_id")?i.get("ob_id"):"";return(0,e.createElement)("div",{className:"wcf-edit-step--nav"},(0,e.createElement)(te,{to:{pathname:"admin.php",search:`?page=${n}&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps`},className:"wcf-edit-step--nav__back-to-flow"},(0,e.createElement)("button",{className:"wcf-edit-step--nav__back-to-flow--button"},(0,e.createElement)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,e.createElement)("span",{className:"wcf-back-button"},(0,le.__)("Back","cartflows")))),o.map((t=>(0,e.createElement)(te,{key:t.tab,to:{pathname:"admin.php",search:`?page=${n}&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps&ob_id=${l}${""!==t.id&&"&obtab="+t.id}`},className:"wcf-edit-step--nav__tab "+(s===n&&c===t.id?" wcf-edit-step--nav__tab--active":"")},t.name))))},Bb=function(){return(0,e.createElement)("div",{className:"wcf-order-bump-product-tab is-placeholder"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("span",null)))},qb=function(){return(0,e.createElement)("div",{className:"wcf-order-bump-design-tab is-placeholder"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",null))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("span",null))),(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview--title"},(0,e.createElement)("label",null)),(0,e.createElement)("div",{className:"wcf-bump-order-wrap wcf-bump-order-style-1 wcf-after-order"},(0,e.createElement)("div",{className:"wcf-bump-order-content"},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("span",null)),(0,e.createElement)("div",{className:"wcf-content-container"},(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight"})),(0,e.createElement)("div",{className:"wcf-bump-order-desc"})))))))},Vb=function(){return(0,e.createElement)("div",{className:"wcf-order-bump-setting-tab is-placeholder"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",null))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-one"})))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-two"})))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",null))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-one"})))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-two"})))))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("span",null)))},Hb=function(){return(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,e.createElement)(Ic,{width:"65%"})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group"},Array(3).fill().map(((t,n)=>(0,e.createElement)("div",{className:"wcf-order-bumps-rule",key:t},(0,e.createElement)("div",{className:"wcf-order-bumps-rule--select-box"},(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"})),2!==n&&(0,e.createElement)("div",{className:"wcf-order-bumps-rule__and"},(0,e.createElement)(Sc,{height:"25px",width:"5%"})))))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or"},(0,e.createElement)(Sc,{height:"35px",width:"5%"}),(0,e.createElement)(Sc,{height:"45px",width:"12%"})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-save-settings"},(0,e.createElement)(Sc,{height:"45px",width:"12%"})))};const Gb=new function(){const e=this;this.compare=function(e,t,n){switch(n){case"==":return e==t;case"!=":return e!=t;case"!==":return e!==t;case"in":return-1!==t.indexOf(e);case"!in":return-1===t.indexOf(e);case"contains":return-1!==e.indexOf(t);case"!contains":return-1===e.indexOf(t);case"<":return e<t;case"<=":return e<=t;case">":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,n){const r="or"===t.relation;let a=!r;return t.fields.map((function(t){let o;return o=t.fields?e.check(t,n):e.compare(n[t.name],t.value,t.operator),r?(o&&(a=!0),!o):o?"":a=!1})),a},this.isActiveControl=function(t,n){const r=!(null==t||!t.conditions)&&(null==t?void 0:t.conditions);return!(r&&!e.check(r,n))}};var Zb=function(){const[{current_ob:n}]=he(),r=n,a=e=>{let t=r.product;return e&&t&&(Array.isArray(t)&&(t=r.product[0]),e=(e=(e=(e=e.replace("{{product_name}}",t.product_name)).replace("{{product_price}}",t.display_price?t.display_price:t.original_price)).replace("{{product_desc}}",t.product_desc)).replace("{{quantity}}",r.quantity)),e},o=r.position,i=a(r.checkbox_label),s=a(r.hl_text),c=(0,Te.ZP)(a(r.desc_text)),l=r.show_arrow,u=r.style,d=a(r.title_text),p=r.action_element,f=r.show_animation,m=r.enable_show_image,h="yes"===f?"wcf-blink":"",g=(0,e.createElement)("svg",{version:"1.1",className:`wcf-pointing-arrow ${h}`,id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"20px",height:"15px",fill:"red",viewBox:"310 253 90 70",enableBackground:"new 310 253 90 70"},(0,e.createElement)("g",null,(0,e.createElement)("g",null,(0,e.createElement)("path",{d:"M364.348,253.174c-0.623,0.26-1.029,0.867-1.029,1.54v18.257h-51.653c-0.919,0-1.666,0.747-1.666,1.666v26.658c0,0.92,0.747,1.666,1.666,1.666h51.653v18.327c0,0.673,0.406,1.28,1.026,1.54c0.623,0.257,1.34,0.116,1.816-0.36l33.349-33.238 c0.313-0.313,0.49-0.737,0.49-1.18c0-0.443-0.177-0.866-0.487-1.179l-33.349-33.335 C365.688,253.058,364.971,252.915,364.348,253.174z"})))),y=r.bg_color,w=r.border_style,v=r.border_color,b=r.label_color,M=r.label_bg_color,_=r.desc_text_color,E=r.hl_text_color,N=r.button_text_color,D=r.button_color,x=r.title_text_color,I=r.label_border_style,j=r.label_border_color,S={background:y,"border-style":w,"border-color":v};let T={},k={};"style-1"===u?T={"border-color":v,"border-bottom-style":w,background:M}:"style-2"===u?(T={"border-color":v,"border-top-style":"inherit"!==w?w:"dashed",background:M},S["border-style"]="inherit"!==w?w:"dashed"):"style-3"===u||"style-4"===u?S["border-style"]="inherit"!==w?w:"solid":"style-5"===u&&(S["border-style"]="inherit"!==w?w:"",k={"border-style":"inherit"!==I?I:"solid","border-color":j,background:M});let O="",A="left",C="auto";return"yes"===m&&(O=r.product_image,A=r.ob_image_position,C=""!==r.ob_image_width?r.ob_image_width+"px":"auto"),(0,t.useEffect)((()=>{const e=document.getElementById("wcf-order-bump-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",(()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")}));return()=>{window.removeEventListener("scroll",n)}}),[]),(0,e.createElement)("div",{id:"wcf-order-bump-preview-wrapper",className:"wcf-order-bump-preview-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview--title"},(0,e.createElement)("label",null,(0,le.__)("Order Bump Preview","cartflows"))),(0,e.createElement)("div",{className:`wcf-bump-order-wrap wcf-bump-order-${u} wcf-${o}`,style:S},function(){let t="";return"style-1"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap",style:T},"right"!==A&&(0,e.createElement)("label",{style:{color:b}},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("span",{className:"wcf-bump-order-label"},i)),"right"===A&&(0,e.createElement)("label",{style:{color:b}},(0,e.createElement)("span",{className:"wcf-bump-order-label"},i),(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===l&&g)),(0,e.createElement)("div",{className:"wcf-content-container"},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:E}},s)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})))):"style-2"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:E}},s)),(0,e.createElement)("div",{className:"wcf-content-container"},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100%":C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100%":C},alt:(0,le.__)("Order Bump Product Image","cartflows")}))),(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap",style:T},"right"!==A&&(0,e.createElement)("label",{style:{color:b}},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("span",{className:"wcf-bump-order-label"},i)),"right"===A&&(0,e.createElement)("label",{style:{color:b}},(0,e.createElement)("span",{className:"wcf-bump-order-label"},i),(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===l&&g))):"style-3"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==O&&"top"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-action"},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),(0,e.createElement)("div",{className:"wcf-bump-order-info"},""!==O&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"80px":C,height:"auto"},alt:(0,le.__)("Order Bump Product Image","cartflows")}))),(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},""===O&&(0,e.createElement)(e.Fragment,null,"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==O&&"top"===A&&(0,e.createElement)(e.Fragment,null,"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),(0,e.createElement)("label",{style:{color:x}},d)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c))),"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:x}},d),""===O&&(0,e.createElement)(e.Fragment,null,"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}))),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)),(0,e.createElement)("div",{className:"wcf-bump-order-info"},""!==O&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"80px":C,height:"auto"},alt:(0,le.__)("Order Bump Product Image","cartflows")}))),""!==O&&(0,e.createElement)("div",{className:"wcf-bump-order-action"},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})))):"style-4"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100px":C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),"right"!==A&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-info"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:x}},d)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c))),(0,e.createElement)("div",{className:"wcf-bump-order-action"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:{color:N,background:D}},(0,le.__)("Add","cartflows")))),"right"===A&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-bump-order-action"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:{color:N,background:D}},(0,le.__)("Add","cartflows"))),(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-info"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:x}},d)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)))),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100px":C},alt:(0,le.__)("Order Bump Product Image","cartflows")})))):"style-5"===u&&(t=(0,e.createElement)("div",{className:"wcf-bump-order-content"},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("div",{className:`wcf-bump-order-info wcf-bump-order-image-${A} `},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-text"},""!==d&&(0,e.createElement)("div",{className:"wcf-bump-order-label",style:{color:x}},(0,e.createElement)("span",null,d)),""!==c&&(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c),"checkbox"===p&&(0,e.createElement)("div",{className:"wcf-bump-order-action",style:k},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("label",{style:{color:b}},i)),"button"===p&&(0,e.createElement)("div",{className:"wcf-bump-order-action wcf-ob-action-button"},(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:{color:N,background:D}},(0,le.__)("Add","cartflows")))),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})))))),t}()))},Wb=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(qb,null);const r=t.settings["multiple-order-bump-design"];return(0,e.createElement)("div",{className:"wcf-order-bump-design-tab"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name,c=n[a.name],l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:c}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))),(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview"},(0,e.createElement)(Zb,null)))},$b=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(Bb,null);const r=t.settings["multiple-order-bump-product"];return(0,e.createElement)("div",{className:"wcf-order-bump-product-tab"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name;let c=n[a.name];if("original_price"===s||"sell_price"===s){const e=n.product;if(""===e||null==e)c=(0,le.__)("No product Selected","cartflows");else if(null!==e||void 0!==e){const t=Array.isArray(e)?parseFloat(n.product[0].original_price):parseFloat(n.product.original_price);if("sell_price"===s){const e=n.discount_type,r=parseFloat(n.discount_value);let a=t;"discount_percent"===e?r>0&&(a=(t-t*r/100).toFixed(2)):"discount_price"===e?r>0&&(a=(t-r).toFixed(2)):"coupon"===e&&(a=(0,le.__)("Coupon will apply on checkout page","cartflows")),c=a}else"original_price"===s&&(c=t)}}const l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,desc:a.desc,placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip,isNameArray:a.isNameArray});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},Xb=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(Vb,null);const r=t.settings["multiple-order-bump-settings"];return(0,e.createElement)("div",{className:"wcf-order-bump-setting-tab"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name,c=n[a.name],l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:c,label:a.label,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":const t="product_img_obj";i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip,isNameArray:a.isNameArray,objName:t});break;case"doc":i=(0,e.createElement)(hc,{content:a.content,custom_class:a.custom_class});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},Kb=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(qb,null);const r=t.settings["multiple-order-bump-content"];return(0,e.createElement)("div",{className:"wcf-order-bump-content-tab"},(0,e.createElement)("div",{className:"wcf-order-bump-content-tab__settings"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name,c=n[a.name],l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:c}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":const t="product_img_obj",r=n[t];i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip,isNameArray:a.isNameArray,objName:t,objValue:r,singleButton:a.singleButton});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))),(0,e.createElement)("div",{className:"wcf-order-bump-content-tab__preview"},(0,e.createElement)(Zb,null)))},Jb=function(t){let{rules:n,group_id:r,g_index:a,groups_length:o}=t;const[{page_settings:i},s]=he(),c=i.settings["multiple-order-bump-rules"],l=c.conditions,u=e=>{const t=e.target.getAttribute("rule_id");r&&t&&s({type:"REMOVE_OB_RULE",name:"rules",rule_id:t,group_id:r})};return(0,e.createElement)(e.Fragment,null,n.map(((t,i)=>{const d=null==t?void 0:t.rule_id,p=n[i],f=c.field_data[p.condition];return(0,e.createElement)(e.Fragment,null,0!==i&&(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules__condition-label"},(0,e.createElement)("div",{className:"wcf--condition-label__and_group"},(0,e.createElement)("span",{className:"wcf--condition-label__and_group__text"},"AND"))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules","data-rule-id":d,key:d},(0,e.createElement)("input",{type:"hidden",name:`rules[${a}][rules][${i}][rule_id]`,value:d}),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--rule_fields"},(0,e.createElement)(Ae,{name:`rules[${a}][rules][${i}][condition]`,options:l,onSelect:()=>{s({type:"RESET_OB_RULE_VALUE",name:"rules",group_id:r,rule_id:d})},value:p.condition}),(0,e.createElement)(Ae,{name:`rules[${a}][rules][${i}][operator]`,options:f.operator,value:(0,Te.ZP)(p.operator)}),function(t,n,r){const o=r.value;let i="";const s=`rules[${a}][rules][${n}][value]`;return t.map((t=>{switch(t.type){case"select2":i=(0,e.createElement)(ba,{name:`${s}[]`,value:o,placeholder:t.placeholder,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti});break;case"number":i=(0,e.createElement)(dc,{name:s,value:o,min:0,placeholder:t.placeholder,tooltip:t.tooltip});break;case"coupon":i="exist"===r.operator||"not_exist"===r.operator?(0,e.createElement)(Ae,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,e.createElement)(vc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti});break;case"product":i=(0,e.createElement)(wc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti})}return i}))}(f.fields,i,p)),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--rule_actions"},function(t,n){return 1===t&&1===o?"":(0,e.createElement)("span",{className:"dashicons dashicons-trash and-close",onClick:u,group_id:r,rule_id:n})}(n.length,d))))})))},eM=function(){const[{options:t,current_ob:n},r]=he();if(null===t||"undefined"===n)return(0,e.createElement)(Hb,null);const a=n.rules;if(void 0===a)return(0,e.createElement)(hc,{content:(0,le.__)("Please Update the CartFlows Pro to the latest version to use the conditional order bump feature.","cartflows")});const o=()=>{const e={group_id:Math.random().toString(36).substring(2,5),rules:[{rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""}]};r({type:"ADD_NEW_OB_GROUP",name:"rules",newGroup:e})},i=e=>{const t=e.target.getAttribute("group_id"),n={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};r({type:"ADD_NEW_OB_RULE",name:"rules",newRule:n,group_id:t})},s=function(e){const t=e.target.getAttribute("data-group_id"),n=document.getElementById(`wcf-order-bumps-rules--group-${t}`);c(e,n)},c=function(e,t){t.classList.contains("hidden")?(t.classList.remove("hidden"),e.target.classList.remove("dashicons-arrow-down"),e.target.classList.add("dashicons-arrow-up")):(t.classList.add("hidden"),e.target.classList.add("dashicons-arrow-down"),e.target.classList.remove("dashicons-arrow-up"))};return console.log(a),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,e.createElement)(ke,{name:"is_rule",value:n.is_rule,label:(0,le.__)("Enable conditional order bump ","cartflows"),tooltip:(0,le.__)("By enabling this option, you can create the conditions to display the order bump.","cartflows")})),"yes"===n.is_rule&&a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(be.ReactSortable,{list:a,setList:e=>r({type:"SET_OB_RULES_GROUPS",groups:e,fieldName:"rules"}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bumps-rules-page--group_wrapper",filter:".wcf-order-bumps-rules--rule_fields, .wcf-order-bumps-rules--rule_actions, .wcf-field wcf-select-option, .wcf-order-bumps-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-order-bumps-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header__right",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:inline-block")}},a.map(((t,n)=>{const r=t.group_id,c=t.rules;return(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper",key:r},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group","data-group-id":r},(0,e.createElement)("input",{type:"hidden",name:`rules[${n}][group_id]`,value:r}),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group-header"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_header__left"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules__handle dashicons dashicons-menu"}),(0,e.createElement)("span",{className:"wcf-group-header--text"},(0,le.__)("Show this order bump if following conditions are true","cartflows"))),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_header__right"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--group_id"},(0,le.__)("ID - ","cartflows"),r),(0,e.createElement)("span",{className:"dashicons dashicons-arrow-down",onClick:s,"data-group_id":r}))),(0,e.createElement)("div",{id:`wcf-order-bumps-rules--group-${r}`,className:"hidden"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules--wrapper"},0!==c.length&&(0,e.createElement)(Jb,{rules:c,group_id:r,g_index:n,groups_length:a.length})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--add-rule__repeater"},(0,e.createElement)("div",{className:"wcf-button wcf-button--secondary ",group_id:r,onClick:i},(0,le.__)("Add Condition","cartflows"))))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper__footer"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or_group"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--or_group__text"},(0,le.__)("OR","cartflows"))),parseInt(n)+1===a.length&&(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or_group__button"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--or_group_button or-button wcf-button wcf-button--secondary",onClick:o},(0,le.__)("Add Conditions Group","cartflows")))))})))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},tM=function(){const[{flow_id:n,step_id:r,options:a,current_ob:o},i]=he(),[{},c]=s(),l=new URLSearchParams(Z().search),u=l.get("ob_id"),d=l.get("obtab");if((0,t.useEffect)((()=>((async()=>{!function(){const e=new window.FormData;e.append("action","cartflows_pro_get_current_order_bump"),e.append("security",cartflows_admin.get_current_order_bump_nonce),e.append("ob_id",u),e.append("step_id",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{e.data.success&&i({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:u})}))}(),null!==a&&"undefined"!==a||ye()({path:`/cartflows/v1/admin/step-data/${r}`}).then((e=>{if(e.billing_fields){const t=Object.entries(e.billing_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));e.billing_fields=t}if(e.shipping_fields){const t=Object.entries(e.shipping_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));e.shipping_fields=t}i({type:"SET_STEP_DATA",data:e})}))})(),()=>{})),[]),null===o||"undefined"===o||o&&u!==o.id){let t="";switch(d){case"design":case"content":t=(0,e.createElement)(qb,null);break;case"product":default:t=(0,e.createElement)(Bb,null);break;case"settings":t=(0,e.createElement)(Vb,null);break;case"conditions":t=(0,e.createElement)(Hb,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper wcf-order-bump-page-wrapper"},t))}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_pro_save_order_bump_settings"),t.append("security",cartflows_admin.save_order_bump_settings_nonce),t.append("post_id",n),t.append("step_id",r),t.append("ob_id",u),t.append("ob_tab",d),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{e.data&&e.data.current_ob&&i({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:u}),c({status:"SAVED"})}))}},function(){let t=(0,e.createElement)("h1",null,"404 Not Found");switch(d){case"design":t=(0,e.createElement)(Wb,null);break;case"product":default:t=(0,e.createElement)($b,null);break;case"settings":t=(0,e.createElement)(Xb,null);break;case"content":t=(0,e.createElement)(Kb,null);break;case"conditions":t=(0,e.createElement)(eM,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper wcf-order-bump-page-wrapper"},t))}()))},nM=function(){const[{flow_id:n,step_id:r,flow_title:a,title:o,step_title:i,current_ob:s},c]=he(),l=new URLSearchParams(Z().search);if(!1===o||null===s||"undefined"===s)return"";const u=l.get("ob_id");if(s.id!==u)return"";const[d,p]=(0,t.useState)(!1),[f,m]=(0,t.useState)(!1),[h,g]=(0,t.useState)(""),[y,w]=(0,t.useState)(s.status);let v=s.title;const b=(0,t.createRef)(),M=function(e){e.preventDefault(),m(!0)},_=function(e){e.preventDefault(),g("wcf-saving");const t=b.current.value,n=new window.FormData;n.append("action","cartflows_pro_update_order_bump_title"),n.append("security",cartflows_admin.update_order_bump_title_nonce),n.append("step_id",r),n.append("new_title",t),n.append("ob_id",u),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{c({type:"SET_OB_TITLE",title:t,name:"wcf-order-bumps",ob_id:u}),g(""),m(!1)}))},E=function(e){e.preventDefault(),m(!1)};return(0,e.createElement)("div",{className:"wcf-edit-ob__title-wrap"},(0,e.createElement)("div",{className:"wcf-ob-header--action-wrap"},(0,e.createElement)("div",{className:"wcf-ob-header--title wcf-ob__title--editable"},function(){""===v&&(v=(0,le.__)("(no title)","cartflows"));let t=De(v,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),n=(0,e.createElement)("a",{href:"#",className:"wcf-ob-header__title--edit",title:(0,le.__)("Edit Step Name","cartflows"),onClick:M},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}));return f&&(t=(0,e.createElement)(uc,{attr:{ref:b},id:"new-step-title",value:v,autocomplete:"off",class:"new-step-title"}),n=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:`wcf-button--small wcf-button--primary ${h}`,href:"#",onClick:_},(0,le.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button--small wcf-button--secondary",href:"#",onClick:E},(0,le.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-ob-header__title--text"},t),(0,e.createElement)("span",{className:"wcf-ob-header__title--buttons"},n))}()),!f&&(0,e.createElement)("div",{className:"wcf-ob-header--ob-status"},(0,e.createElement)("button",{type:"button",className:"wcf-ob-status wcf-switch wcf-toggle-order-bump-status switch-grid","data-wcf-order-bump-switch":y,onClick:function(e){p(!0);const t=e.target.getAttribute("data-ob_id"),a=new window.FormData;a.append("action","cartflows_pro_update_order_bump_status"),a.append("security",cartflows_admin.update_order_bump_status_nonce),a.append("ob_id",t),a.append("post_id",n),a.append("step_id",r),a.append("ob_status",!y),ye()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((()=>{c({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!y,ob_id:t}),w(!y),p(!1)}))},"data-ob_id":s.id}),d&&(0,e.createElement)("span",{className:"wcf-icon dashicons dashicons-update wcf-spinner is-active"}))),(0,e.createElement)("div",{className:"wcf-ob-header--breadcrums"},(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&path=flows`,className:"wcf-breadcrum--nav-item__link"},(0,le.__)("Flows","cartflows"))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&action=${cartflows_admin.flow_action}&flow_id=${n}`,className:"wcf-breadcrum--nav-item__link"},""===a?(0,le.__)("(no title)","cartflows"):De(a,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&action=${cartflows_admin.step_action}&flow_id=${n}&step_id=${r}&tab=order_bumps`,className:"wcf-breadcrum--nav-item__link"},""===i?(0,le.__)("(no title)","cartflows"):De(i,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},""===v?(0,le.__)("(no title)","cartflows"):De(v,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))},rM=function(){return function(){const[{current_ob:e},n]=he(),r=function(t){const{name:r,value:a}=t.detail;if(r.includes("[")){const t=r.split("["),o=[];for(let e=1;e<t.length;e++)o.push(t[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=e[i];switch(o.length){case 2:s[o[0]][o[1]]=a;break;case 4:s[o[0]][o[1]][o[2]][o[3]]=a}n({type:"SET_OB_OPTION",name:i,value:s})}void 0!==e&&n({type:"SET_OB_OPTION",name:r,value:a})},a=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"textarea"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"image-selector"}];(0,t.useEffect)((()=>(e&&a.map((function(e){return document.addEventListener(`wcf:${e.type}:change`,r),""})),()=>{a.map((function(e){return document.removeEventListener(`wcf:${e.type}:change`,r),""}))})),[e])}(),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"editor-wrap__header"},(0,e.createElement)(nM,null)),(0,e.createElement)("div",{className:"editor-wrap__content"},(0,e.createElement)(Fb,null),(0,e.createElement)(tM,null)))},aM=function(){var t;const n=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search),r=n.get("flow_id"),a=n.get("step_id"),o=n.get("ob_id");return ob.flow_id=r,ob.step_id=a,(0,e.createElement)(me,{reducer:ib,initialState:ob},function(){let t="";return t=null!==o?(0,e.createElement)(rM,null):(0,e.createElement)(Qb,null),t}())},oM=function(){const[{step_id:n,flow_id:r,view_url:a,edit_builder_url:o,design_settings:i,page_builder:s,page_builder_name:c,options:l,title:u}]=he(),d=G(P);let p="";return(0,t.useEffect)((()=>{let e=!0;return()=>{e=!1}}),[]),"yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==s&&(p="disabled"),""===n?(0,e.createElement)(lb,null):(0,e.createElement)("div",{className:"wcf-design-page"},(0,e.createElement)("div",{className:"wcf-design-page__content"},(0,e.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},function(){let t=u;return""===u&&(t=(0,le.__)("(no title)","cartflows")),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-design-header__title--text"},t))}()),(0,e.createElement)("div",{className:"wcf-design-page__customize"},function(){if("yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==s)return(0,e.createElement)("p",{className:"wcf-design-page__text"},(0,le.__)("It seems that the page builder you selected is inactive. If you prefer another page builder tool, you can ","cartflows"),(0,e.createElement)("a",{href:`?page=${cartflows_admin.home_slug}&path=settings`,target:"_blank",rel:"noreferrer"},(0,le.__)("select it here.","cartflows")))}(),(0,e.createElement)("a",{className:`wcf-design-page__button--edit wcf-button wcf-button--primary ${p}`,href:o,target:"__blank"},(0,le.__)("Edit Design","cartflows")),(0,e.createElement)("a",{className:"wcf-design-page__button--preview wcf-button wcf-button--secondary",href:a,target:"__blank"},(0,le.__)("View Step","cartflows")),u&&(0,e.createElement)("div",{className:"wcf-change-step wcf-button wcf-button--secondary",onClick:function(){confirm((0,le.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"))&&d.push(`admin.php?page=cartflows&action=wcf-edit-store-step&step_id=${n}&flow_id=${r}&sub-tab=library`)}},(0,e.createElement)("span",{className:"wcf-create-step--text"},(0,le.__)("Change Template","cartflows")))),(0,e.createElement)("p",{className:"wcf-design-page__text"},function(){let e="";switch(c){case"Elementor":e=(0,le.__)("You are using a Elementor page builder, so all design options are available in the Elementor Widgets.","cartflows");break;case"Beaver Builder":e=(0,le.__)("You are using a Beaver Builder page builder, so all design options are available in the Beaver Builder Modules.","cartflows");break;case"Gutenberg":e=(0,le.__)("You are using a Gutenberg, so all design options are available in the Gutenberg Blocks.","cartflows");break;case"Divi":case"Other":e=(0,le.__)("","cartflows")}return e}()),(0,e.createElement)("a",{className:"wcf-design-page__WPeditor",href:Ne(n)},(0,le.__)("Go to WordPress Editor","cartflows"))),i&&(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)(cb,{settings_data:i,nav_enable_header:!0,nav_header_data:{nav_show_settings:"yes"===l["wcf-enable-design-settings"],nav_settings_title:(0,le.__)("Design Settings","cartflows"),nav_settings_field:{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:l["wcf-enable-design-settings"],label:(0,le.__)("Enable Design Settings","cartflows"),desc:(0,le.__)("If you are using shortcodes, enable this design settings.","cartflows")}}})))},iM=function(){const[{step_data:t,page_builder:n}]=he(),r={[t.type]:""};return(0,e.createElement)("div",{className:`wcf-step-library wcf-step-library-${n}`},(0,e.createElement)("div",{className:"wcf-step-library__header"},"other"!==n&&(0,e.createElement)("div",{className:"wcf-step-library__step-actions"},(0,e.createElement)("h3",null,(0,le.sprintf)(
17
  /* translators: %s is replaced with the step title */
18
- (0,le.__)("Templates for %s","cartflows"),t.title)),(0,e.createElement)("div",{className:"wcf-tab-wrapper"},(0,e.createElement)("div",{className:"wcf-get-started-steps"})))),(0,e.createElement)("div",{className:"wcf-step-library__body"},(0,e.createElement)("div",{className:"wcf-remote-content"},"other"!==n&&t&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-ready-templates current"},(0,e.createElement)(Kv,{required_step_type:r,currentStepId:t.id})),(0,e.createElement)("div",{className:"wcf-start-from-scratch "},(0,e.createElement)(Fv,null))),"other"===n&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-start-from-scratch current"},(0,e.createElement)(Fv,null))))))},sM=function(){const t=new URLSearchParams(Z().search),n=t.get("tab"),r=t.get("sub-tab");return(0,e.createElement)(e.Fragment,null,function(){var t,a;let o=(0,e.createElement)("h1",null,"404 Not Found");if("library"===r)return(0,e.createElement)(iM,null);switch(n){case"design":default:o=(0,e.createElement)(oM,null);break;case"settings":o=(0,e.createElement)(pb,null);break;case"checkout_form_fields":o=(0,e.createElement)(Ab,null);break;case"products":o=(0,e.createElement)(hb,null);break;case"order_bumps":o="no"===(null===(t=cartflows_admin)||void 0===t?void 0:t.is_order_bump_migrated)||"processing"===(null===(a=cartflows_admin)||void 0===a?void 0:a.is_order_bump_migrated)?(0,e.createElement)(Mb,null):(0,e.createElement)(_b,null);break;case"checkout_offer":o=(0,e.createElement)(Db,null);break;case"optin_form_fields":o=(0,e.createElement)(Lb,null);break;case"dynamic-offers":o=(0,e.createElement)(jb,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper"},o))}())},cM=function(){const[{step_id:n,step_data:r},a]=he(),[{unsavedChanges:o}]=s(),i=cartflows_admin.woocommerce_status;we(),(0,t.useEffect)((()=>{let e=!0;return(async()=>{ye()({path:`/cartflows/v1/admin/step-data/${n}`}).then((t=>{if(e){if(t.billing_fields){const e=Object.entries(t.billing_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.billing_fields=e}if(t.shipping_fields){const e=Object.entries(t.shipping_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.shipping_fields=e}a({type:"SET_STEP_DATA",data:t})}}))})(),()=>{e=!1}}),[]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Q,{when:o,message:"Are you sure you want to leave?"}),(0,e.createElement)("div",{className:"editor-wrap__header"},function(){if("active"!==i&&Object.keys(r).length>0&&"landing"!==r.type)return(0,e.createElement)("div",{className:"wcf-woo-notice"},(0,le.__)("This page requires WooCommerce plugin installed and activated!","cartflows"))}(),function(){if("active"===i&&r&&("upsell"===r.type||"downsell"===r.type)){var t,n;const r=null===(t=cartflows_admin)||void 0===t?void 0:t.supported_payment_gateways,a=null===(n=cartflows_admin)||void 0===n?void 0:n.available_payment_gateways;let o=[];if(r&&a&&(Object.keys(a).map((e=>{if(!r.hasOwnProperty(e)){const t=a[e];o.push(t.method_title)}return""})),o.length>0))return o=o.join(", "),(0,e.createElement)("div",{className:"wcf-payment-gateway-notice"},(0,e.createElement)("div",{className:"wcf-payment-gateway-notice-text"},(0,le.__)("CartFlows Upsell/Downsell offer does not support the ","cartflows"),(0,e.createElement)("span",{className:"wcf-gateway-notice-style"},o),(0,le.__)(" payment gateway. Please find the supported payment gateways ","cartflows"),(0,e.createElement)("a",{href:"https://cartflows.com/docs/supported-payment-gateways-by-cartflows/",target:"_blank",rel:"noreferrer"},(0,le.__)("here.","cartflows"))))}}(),(0,e.createElement)(Rb,{type:"storeCheckout",action:"wcf-store-checkout"})),(0,e.createElement)("div",{className:"editor-wrap__content"},(0,e.createElement)(sb,{action:"wcf-store-checkout",editAction:"wcf-edit-store-step"}),(0,e.createElement)(sM,null)))},lM=function(){var t;const n=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search),r=n.get("flow_id"),a=n.get("step_id"),o=n.get("ob_id");return ob.flow_id=r,ob.step_id=a,(0,e.createElement)(me,{reducer:ib,initialState:ob},function(){let t="";return t=null!==o?(0,e.createElement)(rM,null):(0,e.createElement)(cM,null),t}())},uM=function(){return de.flow_id=cartflows_admin.global_checkout_id,(0,e.createElement)(e.Fragment,null,(0,e.createElement)(me,{reducer:pe,initialState:de},(0,e.createElement)(rb,{type:"storeCheckout"})))},dM=function(){const t=new URLSearchParams(Z().search).get("action");return(0,e.createElement)(e.Fragment,null,function(){let n="";switch(t){case"wcf-edit-flow":n=(0,e.createElement)(ab,null);break;case"wcf-store-checkout":n=(0,e.createElement)(uM,null);break;case"wcf-edit-step":n=(0,e.createElement)(aM,null);break;case"wcf-edit-store-step":n=(0,e.createElement)(lM,null);break;default:n=(0,e.createElement)("h1",null,"404 Not Found.")}return n}())};o().render((0,e.createElement)((n=>{let{reducer:r,initialState:a,children:o}=n;return(0,e.createElement)(i.Provider,{value:(0,t.useReducer)(r,a)},o)}),{initialState:{settingsProcess:!1,unsavedChanges:!1},reducer:(e,t)=>{switch(t.status){case"SAVED":return window.wcfUnsavedChanges=!1,{...e,settingsProcess:"saved"};case"PROCESSING":return{...e,settingsProcess:"processing"};case"RESET":return{...e,settingsProcess:!1};case"UNSAVED_CHANGES":return"change"===t.trigger?{...e,unsavedChanges:!0}:{...e,unsavedChanges:!1};default:return e}}},(0,e.createElement)((function(){return(0,e.createElement)(W,null,(0,e.createElement)(ue,null),(0,e.createElement)("div",{className:"editor-wrap"},(0,e.createElement)(H,null,(0,e.createElement)(V,{path:"/"},(0,e.createElement)(dM,null)))))}),null)),document.getElementById("wcf-editor-app"))}()}();
15
  /* translators: %d is replaced with the count */
16
  (0,le.__)("Variation-%d","cartflows"),r))}return t}(),!y&&g!==a&&"checkout"!==l&&(0,e.createElement)("span",{className:"wcf-no-product-badge"},(0,le.__)("No Product Assigned","cartflows")),y&&g===a&&(0,e.createElement)("span",{className:"wcf-global-checkout-error-badge"},(0,le.__)("Global Checkout - Remove selected checkout product","cartflows")),!y&&g===a&&(0,e.createElement)("span",{className:"wcf-global-checkout-badge"},(0,le.__)("Store Checkout","cartflows")),function(){let t="";return!r||"upsell"!==l&&"downsell"!==l||(t=m&&f?(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"wcf-flow-badge wcf-conditional-badge wcf-yes-next-badge"},m),(0,e.createElement)("span",{className:"wcf-flow-badge wcf-conditional-badge wcf-no-next-badge"},f)):(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"wcf-flow-badge wcf-invalid-sequence-badge"},(0,le.__)("Invalid Position","cartflows")))),h&&(t=(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"wcf-flow-badge wcf-invalid-sequence-badge"},(0,le.__)("Invalid Step","cartflows")))),t}())),(0,e.createElement)("div",{className:"wcf-step__col-tags"},(0,e.createElement)("span",{className:`wcf-flow-badge ${N}`},"thankyou"===l?"Thank You":l)),(0,e.createElement)("div",{className:"wcf-step__col-actions"},(0,e.createElement)("div",{className:"wcf-step__actions",ref:_},b&&(0,e.createElement)(Ie,{id:g,control_id:i,onClickEvents:{clone:function(e){if(e.preventDefault(),!r)return null;if(confirm((0,le.__)("Do you want to clone this step? Are you sure?","cartflows"))){v(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.clone_step_nonce;const r=new window.FormData;"cartflows_clone_ab_test_step"===t&&(n=cartflows_admin.wcf_clone_ab_test_step_nonce,r.append("control_id",i)),r.append("action",t),r.append("security",n),r.append("step_id",g),r.append("post_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{window.location.reload(),v(!1)}))}},delete:function(e){if(e.preventDefault(),confirm((0,le.__)("Do you want to delete this step? Are you sure?","cartflows"))){v(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.delete_step_nonce;const r=new window.FormData;"cartflows_delete_ab_test_step"===t&&(n=cartflows_admin.wcf_delete_ab_test_step_nonce,r.append("control_id",i)),r.append("action",t),r.append("security",n),r.append("step_id",g),r.append("post_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{window.location.reload(),v(!1)}))}},abtest:function(e){if(e.preventDefault(),!r)return null;v(!0);const t=new window.FormData;t.append("action","cartflows_create_ab_test_variation"),t.append("security",cartflows_admin.wcf_create_ab_test_variation_nonce),t.append("step_id",g),t.append("flow_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{window.location.reload(),v(!1)}))},winner:function(e){if(e.preventDefault(),confirm((0,le.__)("Do you want to declare this step as winner? Are you sure?","cartflows"))){v(!0);const e=new window.FormData;e.append("action","cartflows_declare_ab_test_winner"),e.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),e.append("step_id",g),e.append("flow_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),v(!1)}))}},archived:function(e){if(e.preventDefault(),confirm((0,le.__)("Do you want to archived this step? Are you sure?","cartflows"))){v(!0);const e=new window.FormData;e.append("action","cartflows_archive_ab_test_step"),e.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),e.append("step_id",g),e.append("post_id",o),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),v(!1)}))}}},is_cf_pro:r,actions:d}),(0,e.createElement)("div",{className:"wcf-step__action-btns"},(0,e.createElement)("div",{className:"wcf-step__basic-action-btns"},u.map((t=>{var n;return(0,e.createElement)("a",{href:null==t?void 0:t.link,className:`wcf-step__action-btn ${null!==(n=t.class)&&void 0!==n?n:""}`,title:null==t?void 0:t.text,target:"View"===(null==t?void 0:t.text)?"_blank":"",rel:"noreferrer",key:null==t?void 0:t.link},(0,e.createElement)("span",{className:null==t?void 0:t.icon_class}),(0,e.createElement)("span",{className:"wcf-step__action-btn-text"},null==t?void 0:t.text))}))),(0,e.createElement)("div",{className:"wcf-step__action-menu",onClick:function(e){e.preventDefault(),b?E(e):(M(!0),document.addEventListener("mousedown",E))}},(0,e.createElement)("span",{className:"dashicons dashicons-ellipsis"}))))))},Tv=function(t){const[{is_cf_pro:n,global_checkout:r,flow_id:a}]=he(),{id:o,title:i,type:s,actions:c,menu_actions:l,ajaxcall:d,offer_yes_next_step:p,offer_no_next_step:f,invalid:m}=t,h=o,g=!!m;console.log(g),["checkout","thankyou"].includes(s)&&(delete l.clone,g||delete l.delete),g&&(delete l.clone,delete l.abtest);let y=!1,w=!1,v=[],b=[],M=0;n&&(y=!!t["ab-test-ui"]&&t["ab-test-ui"],w=!!t["ab-test-start"]&&t["ab-test-start"],v=t["ab-test-variations"]?t["ab-test-variations"]:[],b=t["ab-test-archived-variations"]?t["ab-test-archived-variations"]:[],M=v.length,M<2&&(y=!1));let _="";y&&(_+=" wcf-ab-test"),n||"upsell"!==s&&"downsell"!==s||(_+=" invalid-step"),g&&(_+=" invalid-step wcf-store-checkout");const E={is_cf_pro:n,global_checkout:r,flow_id:a,ab_test_ui:y,control_id:h,step_id:o,type:s,title:i,actions:Object.values(c),menu_actions:Object.values(l),has_product_assigned:t.is_product_assigned,offer_yes_next_step:p,offer_no_next_step:f,ab_test_archived_variations:b,invalidStep:g};return(0,e.createElement)("div",{className:"wcf-step-wrap "+_,id:o,onDragEnd:d},y&&(0,e.createElement)(Ec,{flow_id:a,control_id:h,step_id:o,abvariations:v,ab_test_start:w}),function(){let t="";if(E.step_id=o,y&&M>1){let n=0;t=v.map((t=>(h!==t.id&&++n,E.step_id=t.id,E.title=t.title,E.actions=Object.values(t.actions),E.menu_actions=Object.values(t.menu_actions),E.has_product_assigned=t.is_product_assigned,E.var_badge_count=n,(0,e.createElement)(Sv,u({},E,{key:t.id})))))}else t=(0,e.createElement)(Sv,E);return t}(),function(){if(y&&b.length>0){const t={flow_id:a,control_id:h,archived_variations:b};return(0,e.createElement)(Dc,t)}}())},kv=function(){const[{flow_id:t,steps:n,emptySteps:r},a]=he();let o=!1,i=!1;const s=[],c=[];console.log(n),n.length>0&&n.map(((e,t)=>{if("checkout"===e.type){if(!cartflows_admin.old_global_checkout)return o=t,"";if(e.id===parseInt(cartflows_admin.old_global_checkout))return o=t,"";s.push(e)}else"landing"===e.type?s.push(e):c.push(e);return""})),c.length>0&&(i=!0);let l=!0;n.length>0&&(l=!1);const d=()=>{const e=t,r=[];n.map((e=>(r.push(e.id),"")));const o=new window.FormData;o.append("action","cartflows_reorder_flow_steps"),o.append("security",cartflows_admin.reorder_flow_steps_nonce),o.append("step_ids",r),o.append("post_id",e),ye()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then((e=>{a({type:"SET_STORE_STEPS",steps:e.steps})}))};return(0,e.createElement)("div",{className:"wcf-steps-page-wrapper"},(0,e.createElement)(jv,null),(0,e.createElement)("div",{className:"wcf-list-steps"},r&&function(){if(0===n.length)return(0,e.createElement)("div",{className:"wcf-no-step-notice"},(0,e.createElement)("span",null," ",(0,le.__)("No Steps Added.","cartflows")))}(),!r&&l&&(0,e.createElement)(Tc,null),!r&&!l&&(0,e.createElement)(e.Fragment,null,s.map((t=>(0,e.createElement)(Tv,u({},t,{key:t.id,invalid:!0})))),(0,e.createElement)(Tv,u({},n[o],{key:n[o].id})),i&&(0,e.createElement)(be.ReactSortable,{list:c,setList:e=>a({type:"SET_STORE_STEPS",steps:e}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content",preventOnFilter:!1},c.map((t=>"checkout"!==t.type?(0,e.createElement)(Tv,u({},t,{ajaxcall:d,key:t.id})):(0,e.createElement)(e.Fragment,null)))))),(0,e.createElement)("div",{className:"wcf-step-footer"},(0,e.createElement)(te,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&action=wcf-store-checkout&flow_id=${t}&tab=steps&sub-tab=library`},className:"wcf-button wcf-button--primary wcf-create-step"},(0,e.createElement)("span",{className:"dashicons dashicons-plus"}),(0,e.createElement)("span",{className:"wcf-create-step--text"},(0,le.__)("Add New Step","cartflows")))))},Ov=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getselectedStep:t,getcurrentFlowSteps:n,getCFProStatus:r,getWooCommerceStatus:a}=e("wcf/importer");return{selectedStep:t(),currentFlowSteps:n(),cf_pro_status:r(),woocommerce_status:a()}})))((t=>{let{selectedStep:n,currentFlowSteps:r,cf_pro_status:a,woocommerce_status:o}=t;return""===n?"":!(r?r.filter((e=>n===e.type)):[]).length&&"upsell"!==n&&"downsell"!==n||"active"===a?"landing"!==n&&"active"!==o?"inactive"===o?(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Activate WooCommerce for adding more steps and other features.")):(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Install and activate WooCommerce for adding more steps and other features.")):"":"inactive"===a?(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Activate CartFlows Pro for adding more steps and other features.")):(0,e.createElement)("div",{className:"wcf-create-step__notice"},(0,e.createElement)("p",null,"Upgrade to CartFlows Pro for adding more steps and other features.",(0,e.createElement)("a",{target:"_blank",href:cartflows_admin.cf_domain_url,rel:"noreferrer"},"Click here to upgrade")))})),Av=()=>(0,e.createElement)("div",{className:"wcf-create-step__notice-wrap"},(0,e.createElement)(Ov,null)),Cv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getStoreStepTypes:t}=e("wcf/importer");return{stepTypes:t()}})),(0,Gw.withDispatch)((e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}})))((t=>{let{stepTypes:n,setSelectedStep:r}=t;return(0,e.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option"},(0,e.createElement)("select",{onChange:e=>{console.log(e.target.value),r(e.target.value)}},(0,e.createElement)("option",{value:"",className:"",key:"all"},"Select Step Type"),Object.keys(n).map((t=>(0,e.createElement)("option",{className:t,value:t,key:t},n[t])))))})),Lv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:a,getcurrentFlowSteps:o,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:c,getLicenseStatus:l}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:a(),currentFlowSteps:o(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:c(),license_status:l()}})))((n=>{let{currentStep:r,stepName:a,currentFlowId:o,currentFlowSteps:i,cf_pro_status:s,woocommerce_status:c,stepTypes:l,license_status:u,setInputFieldVisibility:d}=n;const p=r.type||"",f=r.title||l[p]||"",[m,h]=(0,t.useState)("Import Step"),[g,y]=(0,t.useState)(!1),[w,v]=(0,t.useState)({cta:"",error_msg:""}),{cta:b,error_msg:M}=w,[_,E]=(0,t.useState)(!1),N=function(){E(!0),document.addEventListener("click",D)},D=function(){E(!1),document.removeEventListener("click",D)};if(b)return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:b}}),(0,e.createElement)("a",{className:"wcf-error-message--toggle",onClick:function(e){e.preventDefault(),_?D():N()}},"Show Error info"),_&&(0,e.createElement)("div",{className:"wcf-error--info",dangerouslySetInnerHTML:{__html:M}}));if(console.log(o),""===r.type)return(0,e.createElement)("button",{className:"button disabled"},m);if("pro"===r.template_type&&"active"!==s)return d("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});const x=i?i.filter((e=>p===e.type)):[];if(console.log("selectedExistSteps.length",x.length),1<=x.length&&"active"!==s)return d("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});if("upsell"===p||"downsell"===p){if(d("hidden"),"active"!==s)return"inactive"===s?(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."}):(0,e.createElement)(dv,{title:`"${f}" step exist! Upgrade to Pro`});if("Activated"!==u)return d("hidden"),(0,e.createElement)(pv,{title:`Activate License and ${m}`})}return"landing"!==p&&"active"!==c?(d("hidden"),"inactive"===c?(0,e.createElement)(lv,{title:`Activate WooCommerce to Import ${f}`,description:(0,le.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,e.createElement)(uv,null)):(d(""),(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:e=>{"submit"===e.target.type&&(e.preventDefault(),((e,t,n,r,a,o,i)=>{if(console.log(e,t,n),o)return;n("Importing Step.."),a(!0);const s=new window.FormData;s.append("action","cartflows_import_step"),s.append("security",cartflows_admin.import_step_nonce),s.append("remote_flow_id",e.template_ID),s.append("flow_id",t),s.append("step",JSON.stringify(e)),s.append("step_name",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then((e=>{console.log(e),e.success?(a(!1),n("Imported! Redirecting..."),setTimeout((()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&action=wcf-store-checkout&flow_id=${t}`}),3e3)):"call_to_action"in e.data&&i({cta:e.data.call_to_action,error_msg:e.data.message})}))})(r,o,h,a,y,g,v))}},m))})),zv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}})))((n=>{let{currentFlowId:r,selectedStep:a,selectedStepTitle:o,stepName:i}=n;const[s,c]=(0,t.useState)({isProcessing:!1,buttonText:"Create Step"}),{isProcessing:l,buttonText:u}=s;return(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:e=>{e.preventDefault(),l||(c({isProcessing:!0,buttonText:"Creating Step.."}),((e,t,n,r,a)=>{console.log(e,t,n);const o=new window.FormData;o.append("action","cartflows_create_step"),o.append("flow_id",e),o.append("step_type",t),o.append("step_title",n),o.append("security",cartflows_admin.create_step_nonce),o.append("step_name",a),console.log("Creating step.."),console.log("creating"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then((t=>{console.log(t),r({isProcessing:!1,buttonText:"Step Created! Redirecting Flow Edit"}),t.success?setTimeout((()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&action=wcf-store-checkout&flow_id=${e}`}),3e3):r({isProcessing:!1,buttonText:"Failed to Create Step!"})}))})(r,a,o,c,i))}},l?(0,e.createElement)(iv,null):""," ",u)})),Pv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:a,getCFProStatus:o,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:a(),cf_pro_status:o(),woocommerce_status:i(),license_status:s()}})))((t=>{let{selectedStep:n,currentFlowSteps:r,cf_pro_status:a,woocommerce_status:o,license_status:i,stepName:s,setInputFieldVisibility:c}=t;if(""===n)return(0,e.createElement)("button",{className:"wcf-button wcf-button--primary disabled"},(0,le.__)("Create Step","cartflows"));if(1<=(r?r.filter((e=>n===e.type)):[]).length&&"active"!==a)return c("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});if("upsell"===n||"downsell"===n){if("active"!==a)return c("hidden"),"not-installed"===a?(0,e.createElement)(dv,null):(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});if("Activated"!==i)return c("hidden"),(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,e.createElement)("div",{className:"wcf-flow-import__message"},(0,e.createElement)("p",null,(0,le.__)("Activate license for adding more flows and other features.","cartflows"))),(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)(pv,null)))}return"landing"!==n&&"active"!==o?(c("hidden"),"inactive"===o?(0,e.createElement)(lv,{description:(0,le.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,e.createElement)(uv,null)):(c(""),(0,e.createElement)(zv,{stepName:s}))})),Uv=t=>{let{stepName:n,setInputFieldVisibility:r}=t;return(0,e.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,e.createElement)(Pv,{stepName:n,setInputFieldVisibility:r}))};const Yv=n=>{let{item:r,type:a,stepName:o,setInputFieldVisibility:i}=n;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-step__footer"},"ready-templates"===a&&(0,e.createElement)(Lv,{currentStep:r,stepName:o,setInputFieldVisibility:i}),"create-your-own"===a&&(0,e.createElement)(Uv,{stepName:o,setInputFieldVisibility:i})))},Rv=n=>{let{setVisibility:r,item:a,type:o,stepName:i,setStepName:s,inputFieldVisibility:c,setInputFieldVisibility:l}=n;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-step__header"},(0,e.createElement)("div",{className:"wcf-name-your-step__title"},(0,e.createElement)("span",{className:"wcf-name-your-step-popup__title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),(0,le.__)("Name Your Step","cartflows"))),(0,e.createElement)("div",{className:"wcf-name-your-step__menu",title:"Hide this",onClick:()=>{r("hide")}},(0,e.createElement)("span",{className:"dashicons dashicons-no"}))),(0,e.createElement)("div",{className:"wcf-name-your-step__body"},(0,e.createElement)("div",{className:"wcf-name-your-step__text-field-wrap"},(0,e.createElement)("div",{className:"wcf-text-field"},(0,e.createElement)("input",{type:"text",className:`input-field ${c}`,value:i,onChange:e=>s(e.target.value),placeholder:(0,le.__)("Enter Step Name","cartflows")}))),(0,e.createElement)(Yv,{setVisibility:r,type:o,stepName:i,setStepName:s,item:a,setInputFieldVisibility:l})))};var Qv=n=>{let{visibility:r,setVisibility:o,item:i,type:s,stepName:c,setStepName:l}=n;const[u,d]=(0,t.useState)("");return(0,a.createPortal)((0,e.createElement)("div",{className:`wcf-name-your-step ${r}`},(0,e.createElement)("div",{className:"wcf-name-your-step__overlay",onClick:()=>{o("hide")}}),(0,e.createElement)("div",{className:"wcf-name-your-step__inner"},(0,e.createElement)(Rv,{setVisibility:o,type:s,stepName:c,setStepName:l,item:i,inputFieldVisibility:u,setInputFieldVisibility:d}))),document.getElementById("wcf-json-importer"))},Fv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}})))((n=>{let{selectedStep:r}=n;const[a,o]=(0,t.useState)("hide"),[i,s]=(0,t.useState)("");return(0,e.createElement)("div",{className:"wcf-step-library__item wcf-step-library__item--scratch"},(0,e.createElement)("h3",null,(0,le.__)("Select Step Type","cartflows")),(0,e.createElement)("div",{className:"wcf-step-library__item--scratch__select"},(0,e.createElement)(Av,null),(0,e.createElement)(Cv,null),(0,e.createElement)(Qv,{visibility:a,setVisibility:o,type:"create-your-own",stepName:i,setStepName:s}),(0,e.createElement)("button",{className:"wcf-button wcf-button--primary "+(""===r?"disabled":""),onClick:()=>{o("hide"===a?"show":"hide")}},"Create Step"),(0,e.createElement)("div",{className:"wcf-learn-how"},(0,e.createElement)("a",{href:`${cartflows_admin.cf_domain_url}/docs/cartflows-step-types/`,target:"_blank",rel:"noreferrer"},"Learn How",(0,e.createElement)("i",{className:"dashicons dashicons-external"})))))})),Bv=function(n){let{item:r,currentStep:a,setCurrentStep:o}=n;const i=a;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"#",className:"step-type-filter-item "+(r[0]===i?"current":""),onClick:()=>{o(r[0])}},r[1])))};const qv=t=>{const{setVisibility:n,errorMessage:r,title:a}=t,o=a||(0,le.__)("Error","cartflows");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow__header"},(0,e.createElement)("div",{className:"wcf-name-your-flow__title"},(0,e.createElement)("h2",{className:"wcf-name-your-flow-popup__title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),o)),(0,e.createElement)("div",{className:"wcf-name-your-flow__menu",title:"Hide this",onClick:()=>n("hide")},(0,e.createElement)("span",{className:"dashicons dashicons-no"}))),(0,e.createElement)("div",{className:"wcf-name-your-flow__body"},(0,e.createElement)("div",{className:"wcf-name-your-flow__footer"},r)))};var Vv,Hv,Gv,Zv,Wv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}})))((t=>{let{visibility:n,setVisibility:r,errorMessage:o,title:i}=t;return(0,a.createPortal)((0,e.createElement)("div",{className:`wcf-name-your-flow ${n}`},(0,e.createElement)("div",{className:"wcf-name-your-flow__overlay",onClick:()=>r("hide")}),(0,e.createElement)("div",{className:"wcf-name-your-flow__inner"},(0,e.createElement)(qv,{setVisibility:r,errorMessage:o,title:i}))),document.getElementById("wcf-json-importer"))})),$v=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:a,getcurrentFlowSteps:o,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:c,getLicenseStatus:l}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:a(),currentFlowSteps:o(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:c(),license_status:l()}})))((n=>{let{currentStep:r,stepName:a,currentFlowId:o,currentFlowSteps:i,cf_pro_status:s,woocommerce_status:c,stepTypes:l,license_status:u,setInputFieldVisibility:d,step_id:p}=n;const f=r.type||"",m=r.title||l[f]||"",[h,g]=(0,t.useState)("Choose"),[y,w]=(0,t.useState)(!1),[v,b]=(0,t.useState)("hide"),[M,_]=(0,t.useState)("");if(""===r.type)return(0,e.createElement)("button",{className:"button disabled"},h);if("pro"===r.template_type&&"active"!==s)return d("hidden"),(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."});const E=i?i.filter((e=>f===e.type)):[];if(console.log("selectedExistSteps.length",E.length),"upsell"===f||"downsell"===f){if(d("hidden"),"active"!==s)return"inactive"===s?(0,e.createElement)(cv,{description:"Activate CartFlows Pro for adding more steps and other features."}):(0,e.createElement)(dv,{title:`"${m}" step exist! Upgrade to Pro`});if("Activated"!==u)return d("hidden"),(0,e.createElement)(pv,{title:`Activate License and ${h}`})}return"landing"!==f&&"active"!==c?(d("hidden"),"inactive"===c?(0,e.createElement)(lv,{title:`Activate WooCommerce to Import ${m}`,description:(0,le.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,e.createElement)(uv,null)):(d(""),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:e=>{"submit"===e.target.type&&(e.preventDefault(),((e,t,n,r,a,o,i,s,c)=>{if(o)return;n("Changing Template.."),a(!0);const l=new window.FormData;l.append("action","cartflows_update_step"),l.append("security",cartflows_admin.update_step_nonce),l.append("remote_flow_id",e.template_ID),l.append("flow_id",t),l.append("step_id",i),l.append("step",JSON.stringify(e)),l.append("step_name",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:l}).then((e=>{console.log(e),e.success?(a(!1),n("Changed! Redirecting..."),setTimeout((()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&action=wcf-store-checkout&flow_id=${t}`}),3e3)):"call_to_action"in e.data&&(n("Choose"),c(e.data.call_to_action),s("show"))}))})(r,o,g,a,w,y,p,b,_))}},h),(0,e.createElement)(Wv,{visibility:v,setVisibility:b,errorMessage:M})))})),Xv=function(n){let{item:r,mode:a,step_id:o}=n;void 0===a&&(a="");const[i,s]=(0,t.useState)("hide"),[c,l]=(0,t.useState)("");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-item"},"pro"===r.template_type?(0,e.createElement)("span",{className:`wcf-item__type wcf-item__type--${r.template_type}`},r.template_type):"",(0,e.createElement)("div",{className:"wcf-item__inner "},(0,e.createElement)("span",{className:"wcf-step-preview-wrap"},(0,e.createElement)("a",{className:"wcf-step-preview",href:r.link,target:"_blank",rel:"noreferrer"},"Preview",(0,e.createElement)("i",{className:"dashicons dashicons-external"}))),(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("img",{className:"wcf-item__thumbnail-image",src:r.featured_image_url,alt:(0,le.__)("Step thumbnail image","cartflows")}))),(0,e.createElement)("span",{className:"wcf-item__view"},"default"===a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Qv,{visibility:i,setVisibility:s,type:"ready-templates",stepName:c,setStepName:l,item:r}),(0,e.createElement)("span",{className:"wcf-item__btn",onClick:()=>{s("hide"===i?"show":"hide")}},(0,le.__)("Import","cartflows"))),"dynamic"===a&&(0,e.createElement)($v,{currentStep:r,stepName:"StepName",setInputFieldVisibility:s,step_id:o})),(0,e.createElement)("div",{className:"wcf-item__heading-wrap"},(0,e.createElement)("div",{className:"wcf-item__heading"},r.title)))))},Kv=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getStoreStepTypes:t,getAllStepTemplates:n}=e("wcf/importer");return{step_types:t(),all_step_templates:n()}})))((function(n){let{required_step_type:r,step_types:a,all_step_templates:o,currentStepId:i}=n,s="dynamic";void 0===r&&(r=a,s="default");let c=0;void 0!==i&&(c=i);const l=Object.entries(r),[u,d]=(0,t.useState)(l[0][0]);(0,t.useEffect)((()=>{const e=Object.entries(r);d(e[0][0])}),[r]);const p=[];return o.forEach((e=>{u===e.type&&p.push(e)})),(0,e.createElement)(t.Fragment,null,"default"===s&&(0,e.createElement)("div",{className:"wcf-remote-filters"},(0,e.createElement)("div",{className:"wcf-categories"},(0,e.createElement)("ul",{className:"step-type-filter-links filter-links"},l.map((t=>(0,e.createElement)(Bv,{item:t,currentStep:u,setCurrentStep:d,key:t[0]})))))),(0,e.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row"},p.map((t=>(0,e.createElement)(Xv,{item:t,key:t.id,mode:s,step_id:c})))))})),Jv=function(){const[n,r]=(0,t.useState)("ready-templates"),[{page_builder:a}]=he();return(0,e.createElement)("div",{className:`wcf-step-library wcf-step-library-${a}`},(0,e.createElement)("div",{className:"wcf-step-library__header"},"other"!==a&&(0,e.createElement)("div",{className:"wcf-step-library__step-actions"},(0,e.createElement)("h3",null,(0,le.__)("Steps Library","cartflows")),(0,e.createElement)("div",{className:"wcf-tab-wrapper"},(0,e.createElement)("div",{className:"wcf-get-started-steps"},(0,e.createElement)("ul",{className:"filter-links "},(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"#",className:"get-started-step-item "+("ready-templates"===n?"current":""),onClick:()=>{r("ready-templates")}},(0,le.__)("Ready Templates","cartflows"))),(0,e.createElement)("li",null,(0,e.createElement)("a",{href:"#",className:"get-started-step-item "+("create-your-own"===n?"current":""),onClick:()=>{r("create-your-own")}},(0,le.__)("Create Your Own","cartflows")))))))),(0,e.createElement)("div",{className:"wcf-step-library__body"},(0,e.createElement)("div",{className:"wcf-remote-content"},"other"!==a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-ready-templates "+("ready-templates"===n?"current":"")},(0,e.createElement)(Kv,null)),(0,e.createElement)("div",{className:"wcf-start-from-scratch "+("create-your-own"===n?"current":"")},(0,e.createElement)(Fv,null))),"other"===a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-start-from-scratch current"},(0,e.createElement)(Fv,null))))))},eb=(0,Hw.compose)((0,Gw.withSelect)((e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}})))((t=>{let{default_page_builder:n}=t;const[{flow_id:r}]=he();return"steps"===new URLSearchParams(Z().search).get("tab")?(0,e.createElement)(Jv,null):(0,e.createElement)("div",{className:"wcf-flow-library wcf-flex"},"other"!==n?(0,e.createElement)(te,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&action=wcf-edit-flow&flow_id=${r}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,e.createElement)(Fv,null))})),tb=function(){const t=new URLSearchParams(Z().search),n=t.get("tab"),r=t.get("sub-tab");return(0,e.createElement)(e.Fragment,null,function(){let t=(0,e.createElement)("h1",null,"Just test");if("library"===r)return(0,e.createElement)(eb,null);switch(n){case"settings":t=(0,e.createElement)(Pc,null);break;case"analytics":t=(0,e.createElement)(Ac,null);break;case"library":t=(0,e.createElement)(eb,null);break;case"canvas":t=(0,e.createElement)(Vw,null);break;default:t=(0,e.createElement)(kv,null)}return t}())},nb=function(n){const{type:r}=n,[{flow_id:a,title:o,steps:i,global_checkout:s},c]=he(),[l,u]=(0,t.useState)(!1),[d,p]=(0,t.useState)(""),f=!!Number.isInteger(s),m=Number.isInteger(s)?"disable":"enable",h={disable:(0,le.__)("Disable Store Checkout","cartflows"),enable:(0,le.__)("Enable Store Checkout","cartflows")},[g,y]=(0,t.useState)(f),[w,v]=(0,t.useState)(!1),[b,M]=(0,t.useState)(m),_=(0,t.createRef)();let E="";if("storeCheckout"===r)for(let e=0;e<i.length;e++)if("checkout"===i[e].type){E=i[e].id;break}const N=function(e){e.preventDefault(),u(!0)},D=function(e){e.preventDefault(),p("wcf-saving");const t=_.current.value,n=new window.FormData;n.append("action","cartflows_update_flow_title"),n.append("security",cartflows_admin.update_flow_title_nonce),n.append("flow_id",a),n.append("new_flow_title",t),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{c({type:"SET_FLOW_TITLE",title:t}),p(""),u(!1)}))},x=function(e){e.preventDefault(),u(!1)};return!1===o?"":(0,e.createElement)("div",{className:"wcf-edit-flow__title-wrap"},(0,e.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable"},function(){let t=o;""===o&&(t=(0,le.__)("(no title)","cartflows"));let n=De(t,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),a=(0,le.__)("Edit Flow Name","cartflows");"storeCheckout"===r&&(a=(0,le.__)("Edit Store Chekout Name","cartflows"));let i=(0,e.createElement)("a",{href:"#",className:"wcf-flows-header__title--edit",title:a,onClick:N},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}));return l&&(n=(0,e.createElement)(uc,{attr:{ref:_},id:"new-flow-title",value:o,autocomplete:"off",class:"new-flow-title"}),i=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:`wcf-button--small wcf-button--primary ${d}`,href:"#",onClick:D},(0,le.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button--small wcf-button--secondary",href:"#",onClick:x},(0,le.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-flows-header__title--text",title:t},n),(0,e.createElement)("span",{className:"wcf-flows-header__title--buttons"},i))}()),"storeCheckout"===r&&(0,e.createElement)("div",{className:"wcf-store-checkout_status--container"},!w&&(0,e.createElement)("span",{className:"wcf_store_checkout_status_label"},h[b]),w&&(0,e.createElement)("span",{className:"wcf-icon dashicons dashicons-update wcf-spinner is-active"}),(0,e.createElement)("div",{className:"wcf_store_checkout__status"},(0,e.createElement)("button",{type:"button",className:"wcf-switch",title:h[b],"data-wcf-order-bump-switch":g,"data-checkout-id":E,onClick:()=>{const e=new window.FormData;v(!0),e.append("action","cartflows_update_store_checkout_status"),e.append("security",cartflows_admin.update_store_checkout_status_nonce),e.append("checkout_id",E),e.append("enable_store_checkout",!g),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{e.success&&(y(!g),v(!1),c({type:"SET_GLOBAL_CHECKOUT",global_checkout:e.data.checkout_id}),M("enable"===b?"disable":"enable"))}))}}))),"flow"===r&&(0,e.createElement)("div",{className:"wcf-flows-header--breadcrums"},(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"}," ",(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&path=flows`,className:"wcf-breadcrum--nav-item__link"},(0,le.__)("Flows","cartflows"))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},""===o?(0,le.__)("(no title)","cartflows"):De(o,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))},rb=function(n){const{type:r}=n,[{flow_id:a,steps:o,is_cf_pro:i},s]=he();we();const c=cartflows_admin.woocommerce_status;return(0,t.useEffect)((()=>{let e=!0;return(async()=>{ye()({path:`/cartflows/v1/admin/flow-data/${a}`}).then((t=>{e&&s({type:"SET_FLOW_DATA",data:t})}))})(),()=>{e=!1}}),[]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"editor-wrap__header"},function(){const t=o;if("active"===c&&i&&t.length>0){var n,r;let a=!1;t.map((e=>("upsell"!==e.type&&"downsell"!==e.type||(a=!0),"")));const o=null===(n=cartflows_admin)||void 0===n?void 0:n.supported_payment_gateways,i=null===(r=cartflows_admin)||void 0===r?void 0:r.available_payment_gateways;let s=[];if(a&&o&&i&&(Object.keys(i).map((e=>{if(!o.hasOwnProperty(e)){const t=i[e];s.push(t.method_title)}return""})),s.length>0))return s=s.join(", "),(0,e.createElement)("div",{className:"wcf-payment-gateway-notice"},(0,e.createElement)("div",{className:"wcf-payment-gateway-notice-text"},(0,le.__)("CartFlows Upsell/Downsell offer does not support the ","cartflows"),(0,e.createElement)("span",{className:"wcf-gateway-notice-style"},s),(0,le.__)(" payment gateway. Please find the supported payment gateways ","cartflows"),(0,e.createElement)("a",{href:"https://cartflows.com/docs/supported-payment-gateways-by-cartflows/",target:"_blank",rel:"noreferrer"},(0,le.__)("here.","cartflows"))))}}(),(0,e.createElement)(nb,{type:r})),(0,e.createElement)("div",{className:"editor-wrap__content"},"flow"===r&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(ve,null),(0,e.createElement)(xv,null)),"storeCheckout"===r&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Iv,null),(0,e.createElement)(tb,null))))},ab=function(){var t;const n=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search).get("flow_id");return de.flow_id=n,(0,e.createElement)(e.Fragment,null,(0,e.createElement)(me,{reducer:pe,initialState:de},(0,e.createElement)(rb,{type:"flow"})))};const ob={flow_id:0,step_id:0,is_cf_pro:!(null===(Vv=cartflows_admin)||void 0===Vv||!Vv.is_pro)&&cartflows_admin.is_pro,page_slug:null!==(Hv=cartflows_admin)&&void 0!==Hv&&Hv.home_slug?cartflows_admin.home_slug:"cartflows",admin_url:"test_url",page_builder:null!==(Gv=cartflows_admin)&&void 0!==Gv&&Gv.page_builder?cartflows_admin.page_builder:"other",page_builder_name:null!==(Zv=cartflows_admin)&&void 0!==Zv&&Zv.page_builder_name?cartflows_admin.page_builder_name:"",flow_title:"",title:!1,nav_tabs:{},step_data:{},view_url:"#",edit_url:"#",edit_builder_url:"#",settings_data:{},step_title:"",step_slug:"",design_settings:null,options:null,page_settings:null,billing_fields:null,shipping_fields:null,ob_id:null,current_ob:null};var ib=(e,t)=>{switch(t.type){case"SET_STEP_DATA":return t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.slug,{...e,title:t.data.title,flow_title:t.data.flow_title,view_url:t.data.view,edit_url:t.data.edit?t.data.edit.replace(/&amp;/g,"&"):"",edit_builder_url:t.data.page_builder_edit?t.data.page_builder_edit.replace(/&amp;/g,"&"):"",step_data:t.data,settings_data:t.data.settings_data,design_settings:t.data.design_settings,page_settings:t.data.page_settings,custom_fields:t.data.custom_fields,billing_fields:t.data.billing_fields,shipping_fields:t.data.shipping_fields,options:t.data.options,step_title:t.data.title,step_slug:t.data.slug};case"SET_OPTION":const n=e.options;return n[t.name]=t.value,{...e,options:n};case"SET_STEP_TITLE":return e.options.post_title=t.title,{...e,title:t.title};case"SET_OB_TITLE":const r=e.options[t.name].findIndex((e=>e.id===t.ob_id));return e.options[t.name][r].title=t.title,e.current_ob.title=t.title,{...e};case"SET_OB_STATUS":const a=e.options[t.name].findIndex((e=>e.id===t.ob_id));return e.options[t.name][a].status=t.newStatus,{...e};case"SET_STEP_VIEW_URL":return{...e,view_url:t.step_view_url};case"SET_FIELDS":return"billing"===t.field_type?{...e,billing_fields:t.fields}:{...e,shipping_fields:t.fields};case"SET_OB_OPTION":const o=e.current_ob;return o[t.name]=t.value,{...e,current_ob:o};case"UPDATE_OPTIONS":return{...e,options:t.options};case"ADD_CHECKOUT_PRODUCT":const i=e.options[t.field_name];return i&&(i.push(t.product_data),e.options[t.field_name]=i),{...e};case"REMOVE_CHECKOUT_PRODUCT":const s=t.unique_id,c=e.options[t.field_name];return s&&c&&(e.options[t.field_name]=c.filter((function(e){return e.unique_id!==s}))),{...e};case"UPDATE_CHECKOUT_PRODUCTS":return e.options[t.field_name]=t.products,{...e};case"UPDATE_ORDER_BUMP":return e.options[t.name]=t.order_bumps,{...e};case"REMOVE_ORDER_BUMP":const l=t.ob_id,u=e.options[t.name];return e.options[t.name]=u.filter((function(e){return e.id!==l})),{...e};case"SET_CURRENT_OB":return{...e,ob_id:t.ob_id,current_ob:t.current_ob};case"ADD_NEW_OB_GROUP":const d=e.current_ob[t.name];return d&&(d.push(t.newGroup),e.current_ob[t.name]=d),{...e};case"ADD_NEW_GROUP":const p=e.options[t.name];return p&&(p.push(t.newGroup),e.options[t.name]=p),{...e};case"ADD_NEW_OB_RULE":const f=e.current_ob[t.name],m=t.group_id;if(f&&m){for(const e of f)if(m===e.group_id){e.rules.push(t.newRule);break}e.current_ob[t.name]=f}return{...e};case"ADD_NEW_RULE":const h=e.options[t.name],g=t.group_id;if(h&&g){for(const e of h)if(g===e.group_id){e.rules.push(t.newRule);break}e.options[t.name]=h}return{...e};case"REMOVE_OB_RULE":const y=e.current_ob[t.name];for(let e=0;e<y.length;e++)if(t.group_id===y[e].group_id){const n=y[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){y[e].rules.splice(r,1);break}0===y[e].rules.length&&y.splice(e,1)}return e.current_ob[t.name]=y,{...e};case"REMOVE_RULE":const w=e.options[t.name];for(let e=0;e<w.length;e++)if(t.group_id===w[e].group_id){const n=w[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){w[e].rules.splice(r,1);break}0===w[e].rules.length&&w.splice(e,1)}return e.options[t.name]=w,{...e};case"RESET_OB_RULE_VALUE":const v=e.current_ob[t.name];for(const e of v)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.current_ob[t.name]=v,{...e};case"RESET_RULE_VALUE":const b=e.options[t.name];for(const e of b)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.options[t.name]=b,{...e};case"SET_RULES_GROUPS":return e.options[t.fieldName]=t.groups,{...e};case"SET_OB_RULES_GROUPS":return e.current_ob[t.fieldName]=t.groups,{...e};case"SET_OB":return e.options[t.fieldName]=t.obs,{...e};default:return e}},sb=function(t){var n;const{action:r,editAction:a}=t,[{page_slug:o,flow_id:i,step_id:s,step_data:c}]=he();let l=!0,u=[];if(null!=c&&c.tabs){const e=c.tabs;l=!1,u=[];const t=Object.values(e).sort((function(e,t){return e.priority-t.priority}));Object.keys(t).map((e=>{const n=t[e],r={name:n.title,id:n.id};return u.push(r),""}))}const d=new URLSearchParams(null===(n=Z())||void 0===n?void 0:n.search),p=d.get("page")?d.get("page"):o,f=d.get("tab")?d.get("tab"):"design";return(0,e.createElement)("div",{className:"wcf-edit-step--nav"},(0,e.createElement)(te,{key:`?page=${o}&action=${r}&flow_id=${i}`,to:{pathname:"admin.php",search:`?page=${o}&action=${r}&flow_id=${i}`},className:"wcf-edit-step--nav__back-to-flow"},(0,e.createElement)("button",{className:"wcf-edit-step--nav__back-to-flow--button"},(0,e.createElement)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,e.createElement)("span",{className:"wcf-back-button"},(0,le.__)("Back","cartflows")))),!l&&u.map((t=>(0,e.createElement)(te,{key:t.tab,to:{pathname:"admin.php",search:`?page=${o}&action=${a}&flow_id=${i}&step_id=${s}${""!==t.id&&"&tab="+t.id}`},className:"wcf-edit-step--nav__tab "+(p===o&&f===t.id?" wcf-edit-step--nav__tab--active":"")},t.name))))},cb=function(t){const{settings_data:n,nav_enable_header:r=!1,nav_header_data:a={nav_show_settings:!0}}=t,[{step_data:o,flow_id:i,step_id:c,options:l},u]=he(),[{},d]=s(),p=Z(),f=""!==p.hash?p.hash.replace("#",""):"";let m="";void 0!==n.settings&&(m=Object.values(n.settings).sort((function(e,t){return e.priority-t.priority})));const{nav_show_settings:h=!0}=a;return(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",i),t.append("step_id",c),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{d({status:"SAVED"}),u({type:"SET_STEP_VIEW_URL",step_view_url:e.step_view_url})}))}},r&&(0,e.createElement)("div",{className:"wcf-vertical-nav__header-wrap"},(0,e.createElement)("div",{className:"wcf-vertical-nav__header"},(0,e.createElement)("span",{className:"wcf-vertical-nav__header-title"},a.nav_settings_title),(0,e.createElement)("span",{className:"wcf-vertical-nav__header-button"},(0,e.createElement)(ze,null))),(0,e.createElement)("div",{className:"wcf-vertical-nav__header-content"},(0,e.createElement)(ke,a.nav_settings_field))),(0,e.createElement)("div",{className:"wcf-settings"},h&&(0,e.createElement)("div",{className:"wcf-vertical-nav"},(0,e.createElement)("div",{className:"wcf-vertical-nav__menu"},m&&Object.keys(m).map(((t,n)=>{const r=m[t];if(void 0!==r.title&&r.fields){const t=r.slug;return(0,e.createElement)(Cc,{title:r.title,slug:t,activeTab:""===f&&0===n?t:f,isActive:xe.isActiveControl(r,l),key:t})}return""}))),(0,e.createElement)("div",{className:"wcf-vertical-nav__content"},m&&Object.keys(m).map(((t,n)=>{const a=m[t];if(void 0!==a.title){const t=void 0!==a.slug?a.slug:"";return(0,e.createElement)(Lc,{slug:t,settings:a,activeTab:""===f&&0===n?t:f,stepdata:o,show_submit_button:!r,key:t})}return""}))))))},lb=function(){return(0,e.createElement)("div",{className:"wcf-design-page is-placeholder"},(0,e.createElement)("div",{className:"wcf-design-page__content"},(0,e.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,e.createElement)("div",{className:"wcf-design-page__customize"},(0,e.createElement)("div",{className:"wcf-design-page__button"}),(0,e.createElement)("div",{className:"wcf-design-page__button"})),(0,e.createElement)("div",{className:"wcf-design-page__text"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--60"})),(0,e.createElement)("div",{className:"wcf-design-page__WPeditor"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--80"}))),(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)("div",{className:"title"}),(0,e.createElement)("div",{className:"wcf-field wcf-checkbox-field"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("div",{className:"wcf-settings"},(0,e.createElement)("form",null,(0,e.createElement)("div",{className:"wcf-vertical-nav"},(0,e.createElement)("div",{className:"wcf-vertical-nav__menu"},Array(5).fill().map((t=>(0,e.createElement)("div",{className:"wcf-settings-nav__tab",key:t},(0,e.createElement)(Sc,{height:"45px"}))))),(0,e.createElement)("div",{className:"wcf-vertical-nav__content"},(0,e.createElement)(Ic,{fontSize:"35px",width:"225px"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"65%"}),(0,e.createElement)(jc,null),(0,e.createElement)(Ic,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"45%"}),(0,e.createElement)(jc,null),(0,e.createElement)(Ic,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"45%"})))))))},ub=function(){const[{step_id:n,view_url:r,edit_builder_url:a,design_settings:o,page_builder:i,page_builder_name:s,options:c,title:l}]=he();let u="";return(0,t.useEffect)((()=>{let e=!0;return()=>{e=!1}}),[]),"yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==i&&(u="disabled"),""===n?(0,e.createElement)(lb,null):(0,e.createElement)("div",{className:"wcf-design-page"},(0,e.createElement)("div",{className:"wcf-design-page__content"},(0,e.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},function(){let t=l;return""===l&&(t=(0,le.__)("(no title)","cartflows")),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-design-header__title--text"},(0,_e.decode)(t)))}()),(0,e.createElement)("div",{className:"wcf-design-page__customize"},function(){if("yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==i)return(0,e.createElement)("p",{className:"wcf-design-page__text"},(0,le.__)("It seems that the page builder you selected is inactive. If you prefer another page builder tool, you can ","cartflows"),(0,e.createElement)("a",{href:`?page=${cartflows_admin.home_slug}&path=settings`,target:"_blank",rel:"noreferrer"},(0,le.__)("select it here.","cartflows")))}(),(0,e.createElement)("a",{className:`wcf-design-page__button--edit wcf-button wcf-button--primary ${u}`,href:a,target:"__blank"},(0,le.__)("Edit Design","cartflows")),(0,e.createElement)("a",{className:"wcf-design-page__button--preview wcf-button wcf-button--secondary",href:r,target:"__blank"},(0,le.__)("View","cartflows"))),(0,e.createElement)("p",{className:"wcf-design-page__text"},function(){let e="";switch(s){case"Elementor":e=(0,le.__)("You are using a Elementor page builder, so all design options are available in the Elementor Widgets.","cartflows");break;case"Beaver Builder":e=(0,le.__)("You are using a Beaver Builder page builder, so all design options are available in the Beaver Builder Modules.","cartflows");break;case"Gutenberg":e=(0,le.__)("You are using a Gutenberg, so all design options are available in the Gutenberg Blocks.","cartflows");break;case"Divi":case"Other":e=(0,le.__)("","cartflows")}return e}()),(0,e.createElement)("a",{className:"wcf-design-page__WPeditor",href:Ne(n)},(0,le.__)("Go to WordPress Editor","cartflows"))),o&&(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)(cb,{settings_data:o,nav_enable_header:!0,nav_header_data:{nav_show_settings:"yes"===c["wcf-enable-design-settings"],nav_settings_title:(0,le.__)("Design Settings","cartflows"),nav_settings_field:{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:c["wcf-enable-design-settings"],label:(0,le.__)("Enable Design Settings","cartflows"),desc:(0,le.__)("If you are using shortcodes, enable this design settings.","cartflows")}}})))},db=function(){return(0,e.createElement)("div",{className:"wcf-settings-nav"},(0,e.createElement)("div",{className:"wcf-settings-nav__tabs"},Array(5).fill().map((t=>(0,e.createElement)("div",{className:"wcf-settings-nav__tab",key:t},(0,e.createElement)(Sc,{height:"45px"}))))),(0,e.createElement)("div",{className:"wcf-settings-nav__content"},(0,e.createElement)(Ic,{fontSize:"35px",width:"225px"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"65%"}),(0,e.createElement)(jc,null),(0,e.createElement)(Ic,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"60%"}),(0,e.createElement)(Ic,{width:"45%"})))},pb=function(){const[{step_data:t,settings_data:n}]=he();let r=!0;void 0!==t.id&&(r=!1);const a=n;return r?(0,e.createElement)(db,null):(0,e.createElement)("div",{className:"wcf-settings-page"},(0,e.createElement)(cb,{settings_data:a}))},fb=function(){return(0,e.createElement)("div",{className:"wcf-checkout-products is-placeholder"},(0,e.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,e.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,e.createElement)("div",{className:"wcf-checkout-product-selection-field"},(0,e.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new"},(0,e.createElement)("div",{className:"wcf-checkout-products__button"}),(0,e.createElement)("div",{className:"wcf-checkout-products__button"})))))))))),(0,e.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,e.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,e.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field"},(0,e.createElement)("div",{className:"title"}))))))))))),(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-products__button"})))},mb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options wcf-offer-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=(e=>{let t="";const n=e.name;if(n&&n.includes("[")){const e=n.split("["),a=[];for(let t=1;t<e.length;t++)a.push(e[t].split("]")[0]);const o=n.substr(0,n.indexOf("[")),i=r[o],s=r["wcf-offer-product"];if((null==s||""===s||s.length<=0)&&("wcf-offer-product[original_price]"===n||"wcf-offer-product[sell_price]"===n))return(0,le.__)("No product Selected","cartflows");const c=Array.isArray(s)?parseFloat(s[0].original_price):parseFloat(s.original_price);if("wcf-offer-product[sell_price]"===n&&c){const e=r["wcf-offer-discount"],t=parseFloat(r["wcf-offer-discount-value"]);let n=c;return"discount_percent"===e?t>0&&(n=(c-c*t/100).toFixed(2)):"discount_price"===e&&t>0&&(n=(c-t).toFixed(2)),n}t=i[a[0]]}else t=r[e.name]?r[e.name]:"";return t})(a),c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))))},hb=function(){const[{flow_id:t,step_id:n,settings_data:r,page_settings:a}]=he(),[{},o]=s(),i=a;return void 0===r.settings?(0,e.createElement)(fb,null):(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const r=new window.FormData(e.target);r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",t),r.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{o({status:"SAVED"})}))}},(0,e.createElement)("div",{className:"wcf-products"},(0,e.createElement)("div",{className:"wcf-products--selection wcf-products__section"},(0,e.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,e.createElement)(mb,{settings:i.settings.product})))),(0,e.createElement)("div",null,(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},gb=function(n){const{addOB:r,closePopupCB:a}=n,[o,i]=(0,t.useState)(),[s,c]=(0,t.useState)((0,le.__)("Add Order Bump","cartflows")),[l,u]=(0,t.useState)(),[d,p]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"wcf-add-ob-popup-overlay",id:"wcf-add-ob-popup-overlay",onClick:function(e){"wcf-add-ob-popup-overlay"===e.target.id&&(a(),p(!1))}},(0,e.createElement)("div",{className:"wcf-add-ob-popup-content"},(0,e.createElement)("div",{className:"wcf-add-ob-header"},(0,e.createElement)("div",{className:"wcf-add-ob-header__title"},(0,e.createElement)("div",{className:"wcf-popup-header-title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),(0,le.__)("Add Order Bump","cartflows"))),(0,e.createElement)("div",{className:"wcf-popup-header-action",title:"Hide this",onClick:a},(0,e.createElement)("span",{className:"dashicons dashicons-no"}))),(0,e.createElement)("div",{className:"wcf-content-wrap"},(0,e.createElement)("div",{className:"wcf-add-ob-content"},(0,e.createElement)(Ce,{name:"",value:o,placeholder:(0,le.__)("Enter the order bump title…","cartflows"),onChangeCB:i,desc:l}),(0,e.createElement)("span",{className:"wcf-select-product__button"},(0,e.createElement)("a",{href:"#",className:"wcf-button wcf-button--primary",onClick:function(e){e.preventDefault(),p(!0),o?(c((0,le.__)("Adding…","cartflows")),d||r(o)):u((0,le.__)("Order bump title should not be empty…","cartflows"))}},s))))))},yb=function(n){const{flow_id:r,step_id:a,data:o,callback:i}=n,[{},s]=he(),[c,l]=(0,t.useState)(o.status),[u,d]=(0,t.useState)(!1),[p,f]=(0,t.useState)({button_text:(0,le.__)("Delete","cartflows"),is_processing:!1}),{button_text:m,is_processing:h}=p,[g,y]=(0,t.useState)({clone_button_text:(0,le.__)("Clone","cartflows"),is_cloning:!1}),{clone_button_text:w,is_cloning:v}=g;return(0,t.useEffect)((()=>{l(c)}),[c]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump",onDragEnd:i},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)(te,{to:{pathname:"admin.php",search:`?page=cartflows&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps&ob_id=${o.id}`},title:o.title},De(o.title,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length)),""===o.product&&(0,e.createElement)("span",{className:"wcf-flow-badge wcf-no-next-badge"},(0,le.__)("No product assigned","cartflows")))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("button",{type:"button",className:"wcf-ob-status wcf-switch wcf-toggle-order-bump-status switch-grid","data-wcf-order-bump-switch":c,onClick:function(e){d(!0);const t=e.target.getAttribute("data-ob_id"),n=new window.FormData;n.append("action","cartflows_pro_update_order_bump_status"),n.append("security",cartflows_admin.update_order_bump_status_nonce),n.append("ob_id",t),n.append("post_id",r),n.append("step_id",a),n.append("ob_status",!c),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{s({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!c,ob_id:t}),l(!c),d(!1)}))},"data-ob_id":o.id}),u&&(0,e.createElement)("span",{className:"wcf-icon dashicons dashicons-update wcf-spinner is-active"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)(te,{key:"edit-order-bump",to:{pathname:"admin.php",search:`?page=cartflows&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps&ob_id=${o.id}`},title:(0,le.__)("Edit Order Bump","cartflows")},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}),(0,e.createElement)("span",null,(0,le.__)("Edit","cartflows"))),(0,e.createElement)("a",{className:"wcf-clone-bump-button "+(v?"wcf-cloning":""),id:o.id,onClick:e=>{e.preventDefault();const t=new window.FormData,n=e.target.closest(".wcf-clone-bump-button").getAttribute("id");t.append("action","cartflows_pro_clone_order_bump"),t.append("security",cartflows_admin.clone_order_bump_nonce),t.append("ob_id",n),t.append("step_id",a),y({clone_button_text:(0,le.__)("Cloning…","cartflows"),is_cloning:!0}),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{e.success&&(y({clone_button_text:(0,le.__)("Clone","cartflows"),is_cloning:!1}),s({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}))}))},title:(0,le.__)("Clone Order Bump","cartflows")},(0,e.createElement)("span",{className:"dashicons dashicons-admin-page"}),(0,e.createElement)("span",null,w)),(0,e.createElement)("a",{className:h?"wcf-remove-order-bump-button wcf-removing":"wcf-remove-order-bump-button",id:o.id,onClick:function(e){if(e.preventDefault(),!window.confirm((0,le.__)("Do you really want to delete this order bump permanently?","cartflows")))return;const t=e.target.closest(".wcf-remove-order-bump-button").getAttribute("id"),n=new window.FormData;n.append("action","cartflows_pro_delete_order_bump"),n.append("security",cartflows_admin.delete_order_bump_nonce),n.append("ob_id",t),n.append("post_id",r),n.append("step_id",a),f({button_text:(0,le.__)("Deleting…","cartflows"),is_processing:!0}),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{e.success&&(f({button_text:(0,le.__)("Delete","cartflows"),is_processing:!1}),s({type:"REMOVE_ORDER_BUMP",name:"wcf-order-bumps",ob_id:t}))}))},title:(0,le.__)("Delete Order Bump","cartflows")},(0,e.createElement)("span",{className:"dashicons dashicons-trash"}),(0,e.createElement)("span",null,m))))))},wb=function(){return(0,e.createElement)("div",{className:"wcf-multiple-order-bumps is-placeholder"},(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,e.createElement)("span",{className:"wcf-add-new-order-bump wcf-button--primary"})),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,e.createElement)("div",{className:"wcf-column wcf-column--title"},"Title"),(0,e.createElement)("div",{className:"wcf-column wcf-column--status"},"Status"),(0,e.createElement)("div",{className:"wcf-column wcf-column--actions"},"Actions")),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__content"},(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump"},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)("span",{title:"ob"}))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("span",{className:"wcf-ob-status"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)("span",{title:"Edit Order Bump"}))))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump"},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)("span",{title:"ob"}))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("span",{className:"wcf-ob-status"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)("span",{title:"Edit Order Bump"})))))))},vb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options wcf-ob-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=(e=>{let t="";const n=e.name;if(n&&n.includes("[")){const e=n.split("["),a=[];for(let t=1;t<e.length;t++)a.push(e[t].split("]")[0]);const o=n.substr(0,n.indexOf("[")),i=r[o],s=r["wcf-order-bump-product"];if(!(""!==s&&null!==s||"wcf-order-bump-product[original_price]"!==n&&"wcf-order-bump-product[sell_price]"!==n))return(0,le.__)("No product Selected","cartflows");const c=Array.isArray(s)?parseFloat(s[0].original_price):parseFloat(s.original_price);if("wcf-order-bump-product[sell_price]"===n&&c){const e=r["wcf-order-bump-discount"],t=parseFloat(r["wcf-order-bump-discount-value"]);let n=c;return"discount_percent"===e?t>0&&(n=(c-c*t/100).toFixed(2)):"discount_price"===e?t>0&&(n=(c-t).toFixed(2)):"coupon"===e&&(n=(0,le.__)("Coupon will apply on checkout page","cartflows")),n}t=i[a[0]]}else t=r[e.name]?r[e.name]:"";return t})(a),c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))))},bb=function(){return(0,e.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section is-placeholder"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"checkbox-title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-offer__button"})))))},Mb=function(){const[{flow_id:t,step_id:n,settings_data:r,page_settings:a}]=he(),[{},o]=s();if(!cartflows_admin.is_pro)return(0,e.createElement)(yc,{feature:"Order Bump"});const i=a;return void 0===r.settings?(0,e.createElement)(bb,null):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const r=new window.FormData(e.target);r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",t),r.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{o({status:"SAVED"})}))}},(0,e.createElement)("div",{className:"wcf-order-bump-settings wcf-checkout__section"},(0,e.createElement)(vb,{settings:i.settings["order-bump"]})),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))))},_b=function(){const[{options:n,step_id:r,flow_id:a,page_settings:o},i]=he(),[s,c]=(0,t.useState)(!1);if(!cartflows_admin.is_pro)return(0,e.createElement)(yc,{feature:"Order Bumps"});if(null===n||"undefined"===o)return(0,e.createElement)(wb,null);if(null===n["wcf-order-bumps"]||void 0===n["wcf-order-bumps"])return(0,e.createElement)(Mb,null);const l=o,u=n["wcf-order-bumps"],d=Object.keys(u).length,p=o.settings["multiple-order-bump-design"],f=function(){c(!1)},m=()=>{const e=n["wcf-order-bumps"],t=[];Object.keys(e).map((n=>(t.push(e[n].id),"")));const a=new window.FormData;a.append("action","cartflows_pro_reorder_order_bumps"),a.append("security",cartflows_admin.reorder_order_bumps_nonce),a.append("step_id",r),a.append("sorted_obs",t),ye()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((()=>{}))};return(0,e.createElement)("div",{className:"wcf-multiple-order-bumps"},(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,e.createElement)("a",{className:"wcf-add-new-order-bump wcf-button wcf-button--primary",onClick:function(){c(!0)}},(0,e.createElement)("span",{className:"dashicons dashicons-plus"}),(0,e.createElement)("span",null,(0,le.__)("Add Order Bump","cartflows")))),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,e.createElement)("div",{className:"wcf-column wcf-column--title"},(0,le.__)("Title","cartflows")),(0,e.createElement)("div",{className:"wcf-column wcf-column--status"},(0,le.__)("Status","cartflows")),(0,e.createElement)("div",{className:"wcf-column wcf-column--actions"},(0,le.__)("Actions","cartflows"))),0===d&&(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__no-content"},(0,e.createElement)("p",null,(0,le.__)("No Order Bumps Found","cartflows"))),d>0&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__content"},u&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(be.ReactSortable,{list:u,setList:e=>i({type:"SET_OB",obs:e,fieldName:"wcf-order-bumps",step_id:r,flow_id:a}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bump",filter:".wcf-order-bump__action, .wcf_order_bump__status, .wcf-order-bump__data-title a",preventOnFilter:!1},u.map((t=>(0,e.createElement)(yb,{key:t.id,flow_id:a,step_id:r,data:t,title:t.title,settings:l.settings["multiple-order-bump"],design_settings:p,callback:m}))))))),s&&(0,e.createElement)(gb,{name:!0,closePopupCB:f,addOB:function(e){if(e){const t={title:e,id:Math.random().toString(36).substring(2,5)},n=new window.FormData;n.append("action","cartflows_pro_add_order_bump"),n.append("security",cartflows_admin.add_order_bump_nonce),n.append("ob_id",t.id),n.append("post_id",a),n.append("step_id",r),n.append("title",e),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{e.success&&(f(),i({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}))}))}}}))},Eb=function(){const[{options:n}]=he(),[r,a]=(0,t.useState)("");return(0,t.useEffect)((()=>{const e=document.getElementById("wcf-checkout-offer-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",(()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")}));return()=>{window.removeEventListener("scroll",n)}}),[]),(0,e.createElement)("div",{id:"wcf-checkout-offer-preview-wrapper",className:"fullscreen"===r?"wcf-checkout-offer-preview-wrapper fullscreen":"wcf-checkout-offer-preview-wrapper"},(0,e.createElement)(gc,{label:(0,le.__)("Checkout Offer Popup Preview","cartflows")}),""===r&&(0,e.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-button wcf-button wcf-button--secondary",onClick:()=>{a("fullscreen"),document.getElementById("wcf-co-options-wrapper").classList.add("full-screen"),document.body.classList.add("wcf-co-full-screen-preview")}},(0,le.__)("View in Full Screen","cartflows")),"fullscreen"===r&&(0,e.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-exit-button wcf-button wcf-button--secondary",onClick:()=>{a(""),document.getElementById("wcf-co-options-wrapper").classList.remove("full-screen"),document.body.classList.remove("wcf-co-full-screen-preview")}},(0,le.__)("Exit Full Screen","cartflows")),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-wrapper wcf-pre-checkout-full-width",style:{background:n["wcf-pre-checkout-offer-bg-color"]}},(0,e.createElement)("div",{id:"wcf-pre-checkout-offer-modal",style:{backgroundColor:n["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"wcf-content-main-wrapper"},(0,e.createElement)("div",{className:"wcf-lightbox-content",style:{backgroundColor:n["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"wcf-content-modal-progress-bar"},(0,e.createElement)("div",{className:"wcf-progress-bar-nav",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},(0,e.createElement)("div",{className:"wcf-pre-checkout-progress"},(0,e.createElement)("div",{className:"wcf-nav-bar-step active"},(0,e.createElement)("div",{className:"wcf-nav-bar-title",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},(0,le.__)("Order Submitted","cartflows")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line"},(0,e.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}},(0,e.createElement)("span",{className:"before"})),(0,e.createElement)("span",{className:"order-after",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}}))),(0,e.createElement)("div",{className:"wcf-nav-bar-step active inprogress"},(0,e.createElement)("div",{className:"wcf-nav-bar-title",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},(0,le.__)("Special Offer","cartflows-pro")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line"},(0,e.createElement)("span",{className:"before",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}}),(0,e.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:n["wcf-pre-checkout-offer-navbar-color"]}},(0,e.createElement)("span",{className:"before"})),(0,e.createElement)("span",{className:"after"}))),(0,e.createElement)("div",{className:"wcf-nav-bar-step"},(0,e.createElement)("div",{className:"wcf-nav-bar-title"},(0,le.__)("Order Receipt","cartflows-pro")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line"},(0,e.createElement)("span",{className:"before"}),(0,e.createElement)("div",{className:"wcf-progress-nav-step"})))))),(0,e.createElement)("div",{className:"wcf-content-main-head"},(0,e.createElement)("div",{className:"wcf-content-modal-title"},(0,e.createElement)("h1",{style:{color:n["wcf-pre-checkout-offer-title-color"]}},n["wcf-pre-checkout-offer-popup-title"])),(0,e.createElement)("div",{className:"wcf-content-modal-sub-title"},(0,e.createElement)("span",{style:{color:n["wcf-pre-checkout-offer-subtitle-color"]}},n["wcf-pre-checkout-offer-popup-sub-title"]))),(0,e.createElement)("div",{id:"wcf-pre-checkout-offer-content",className:"woocommerce",style:{backgroundColor:n["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-img"},(0,e.createElement)("img",{src:cartflows_admin.image_placeholder,alt:"Checkout Offer Product"})),(0,e.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-offer-product-details"},(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-product-title"},(0,e.createElement)("h1",{style:{color:n["wcf-pre-checkout-offer-title-color"]}},n["wcf-pre-checkout-offer-product-title"])),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-price",style:{color:n["wcf-pre-checkout-offer-desc-color"],fontWeight:500}},cartflows_admin.woo_currency," XX"),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-desc"},(0,e.createElement)("span",{style:{color:n["wcf-pre-checkout-offer-desc-color"],lineHeight:"0"}},n["wcf-pre-checkout-offer-desc"])),(0,e.createElement)("input",{type:"hidden",value:"add",className:"wcf-pre-checkout-offer-action"})),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-actions"},(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-add-cart-btn"},(0,e.createElement)("button",{className:"wcf-pre-checkout-offer-btn button alt",style:{backgroundColor:n["wcf-pre-checkout-offer-button-color"],borderColor:n["wcf-pre-checkout-offer-button-color"]}},n["wcf-pre-checkout-offer-popup-btn-text"])),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-skip-btn"},(0,e.createElement)("a",{className:"wcf-pre-checkout-skip",href:"#",style:{color:n["wcf-pre-checkout-offer-desc-color"]}},n["wcf-pre-checkout-offer-popup-skip-btn-text"])))))))))},Nb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options wcf-co-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("div",{className:"wcf-co-options-wrapper",id:"wcf-co-options-wrapper"},(0,e.createElement)("table",{className:"wcf-co-settings"},(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=(e=>{let t="";const n=e.name;if(n&&n.includes("[")){const e=n.split("["),a=[];for(let t=1;t<e.length;t++)a.push(e[t].split("]")[0]);const o=n.substr(0,n.indexOf("[")),i=r[o];if("wcf-pre-checkout-offer-product[original_price]"===n||"wcf-pre-checkout-offer-product[sell_price]"===n){const e=r["wcf-pre-checkout-offer-product"];if(""===e||null==e||e.length<=0)return(0,le.__)("No product Selected","cartflows");const t=Array.isArray(e)?parseFloat(e[0].original_price):parseFloat(e.original_price);if("wcf-pre-checkout-offer-product[original_price]"===n)return t;if("wcf-pre-checkout-offer-product[sell_price]"===n&&t){const e=r["wcf-pre-checkout-offer-discount"],n=parseFloat(r["wcf-pre-checkout-offer-discount-value"]);let a=t;return"discount_percent"===e?n>0&&(a=(t-t*n/100).toFixed(2)):"discount_price"===e&&n>0&&(a=(t-n).toFixed(2)),a}}t=i[a[0]]}else t=r[e.name]?r[e.name]:"";return t})(a),c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,placeholder:a.placeholder,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:s}));break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc});break;case"sub-heading":i=(0,e.createElement)(Mc,{subClass:a.subClass,label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),"yes"===r["wcf-pre-checkout-offer"]&&(0,e.createElement)("div",{className:"wcf-co-preview"},(0,e.createElement)(Eb,null))))},Db=function(){const[{flow_id:t,step_id:n,settings_data:r,page_settings:a}]=he(),[{},o]=s(),i=a;return cartflows_admin.is_pro?void 0===r.settings?(0,e.createElement)(bb,null):(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const r=new window.FormData(e.target);r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",t),r.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((e=>{o({status:"SAVED"}),console.log(e)}))}},(0,e.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section"},(0,e.createElement)(Nb,{settings:i.settings["checkout-offer"]})),(0,e.createElement)("div",{className:"wcf-checkout-offer-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))):(0,e.createElement)(yc,{feature:"Checkout Offer"})},xb=function(){return(0,e.createElement)("div",{className:"wcf-checkout-rules-page"},(0,e.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,e.createElement)(Ic,{width:"65%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_wrapper"},(0,e.createElement)("div",{className:"wcf-checkout-rules--text"},(0,e.createElement)(Ic,{width:"10%"}),(0,e.createElement)(Sc,{width:"25%",height:"35px"}),(0,e.createElement)(Ic,{width:"20%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules"},Array(3).fill().map(((t,n)=>(0,e.createElement)("div",{className:"wcf-checkout-rule",key:t},(0,e.createElement)("div",{className:"wcf-checkout-rule--select-box"},(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"})),2!==n&&(0,e.createElement)("div",{className:"wcf-checkout-rule__and"},(0,e.createElement)(Sc,{height:"25px",width:"5%"})))))),(0,e.createElement)(Sc,{height:"40px",width:"9%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--or"},(0,e.createElement)(Sc,{height:"35px",width:"5%"}),(0,e.createElement)(Sc,{height:"45px",width:"12%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,e.createElement)(Ic,{width:"10%"}),(0,e.createElement)(Sc,{width:"25%",height:"35px"}),(0,e.createElement)(Ic,{width:"20%"})))},Ib=function(t){let{rules:n,group_id:r,g_index:a,groups_length:o}=t;const[{page_settings:i},s]=he(),c=i.settings.rules,l=c.conditions,u=e=>{const t=e.target.getAttribute("rule_id");r&&t&&s({type:"REMOVE_RULE",name:"wcf-checkout-rules",rule_id:t,group_id:r})};return(0,e.createElement)(e.Fragment,null,n.map(((t,i)=>{const d=null==t?void 0:t.rule_id,p=n[i],f=c.field_data[p.condition];return(0,e.createElement)(e.Fragment,null,0!==i&&(0,e.createElement)("div",{className:"wcf-checkout-rules--group_rules__condition-label"},(0,e.createElement)("div",{className:"wcf--condition-label__and_group"},(0,e.createElement)("span",{className:"wcf--condition-label__and_group__text"},"AND"))),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_rules","data-rule-id":d,key:d},(0,e.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${a}][rules][${i}][rule_id]`,value:d}),(0,e.createElement)("div",{className:"wcf-checkout-rules--rule_fields"},(0,e.createElement)(Ae,{name:`wcf-checkout-rules[${a}][rules][${i}][condition]`,options:l,onSelect:()=>{s({type:"RESET_RULE_VALUE",name:"wcf-checkout-rules",group_id:r,rule_id:d})},value:p.condition}),(0,e.createElement)(Ae,{name:`wcf-checkout-rules[${a}][rules][${i}][operator]`,options:f.operator,value:(0,Te.ZP)(p.operator)}),function(t,n,r){const o=r.value;let i="";const s=`wcf-checkout-rules[${a}][rules][${n}][value]`;return t.map((t=>{switch(t.type){case"select2":i=(0,e.createElement)(ba,{name:`${s}[]`,value:o,placeholder:t.placeholder,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti});break;case"number":i=(0,e.createElement)(dc,{name:s,value:o,min:0,placeholder:t.placeholder,tooltip:t.tooltip});break;case"coupon":i="exist"===r.operator||"not_exist"===r.operator?(0,e.createElement)(Ae,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,e.createElement)(vc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti});break;case"product":i=(0,e.createElement)(wc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti})}return i}))}(f.fields,i,p)),(0,e.createElement)("div",{className:"wcf-checkout-rules--rule_actions"},function(t,n){return 1===t&&1===o?"":(0,e.createElement)("span",{className:"dashicons dashicons-trash and-close",onClick:u,group_id:r,rule_id:n})}(n.length,d))))})))},jb=function(){const[{step_data:t,flow_id:n,step_id:r,options:a},o]=he(),[{},i]=s();if(!cartflows_admin.is_pro)return(0,e.createElement)(yc,{feature:"Dynamic Offers"});if(null===a)return(0,e.createElement)(xb,null);const c=a["wcf-checkout-rules"];if(void 0===c)return(0,e.createElement)(hc,{content:(0,le.__)("Please Update the CartFlows Pro to the latest version to use the dynamic offers feature.","cartflows")});const l=()=>{const e={group_id:Math.random().toString(36).substring(2,5),rules:[{rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""}]};o({type:"ADD_NEW_GROUP",name:"wcf-checkout-rules",newGroup:e})},u=e=>{const t=e.target.getAttribute("group_id"),n={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};o({type:"ADD_NEW_RULE",name:"wcf-checkout-rules",newRule:n,group_id:t})},d=function(e){const t=e.target.getAttribute("data-group_id"),n=document.getElementById(`wcf-checkout-rules--group-${t}`);p(e,n)},p=function(e,t){t.classList.contains("hidden")?(t.classList.remove("hidden"),e.target.classList.remove("dashicons-arrow-down"),e.target.classList.add("dashicons-arrow-up")):(t.classList.add("hidden"),e.target.classList.add("dashicons-arrow-down"),e.target.classList.remove("dashicons-arrow-up"))};return console.log(c),(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",n),t.append("step_id",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{i({status:"SAVED"}),console.log(e)}))}},(0,e.createElement)("div",{className:"wcf-checkout-rules-page"},(0,e.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,e.createElement)(ke,{name:"wcf-checkout-rules-option",value:a["wcf-checkout-rules-option"],label:(0,le.__)("Enable Dynamic Offers","cartflows"),tooltip:(0,le.__)("By enabling this option, you can create the conditions for the next-step (dynamic offer) redirection.","cartflows")})),"yes"===a["wcf-checkout-rules-option"]&&c&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(be.ReactSortable,{list:c,setList:e=>o({type:"SET_RULES_GROUPS",groups:e,fieldName:"wcf-checkout-rules",step_id:r}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-checkout-rules--group",filter:".wcf-checkout-rules--rule_fields, .wcf-checkout-rules--rule_actions, .wcf-field.wcf-select-option, .wcf-checkout-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-checkout-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-checkout-rules--or_group_button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-checkout-rules--or_group_button")[0].setAttribute("style","display:inline-block")}},c.map(((n,r)=>{const a=n.group_id,o=n.rules;return(0,e.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper",key:a},(0,e.createElement)("div",{className:"wcf-checkout-rules--group","data-group-id":a},(0,e.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${r}][group_id]`,value:a}),(0,e.createElement)("div",{className:"wcf-checkout-rules--redirection-step"},(0,e.createElement)("div",{className:"wcf-checkout-rules--group_header__left"},(0,e.createElement)("span",{className:"wcf-checkout-rules__handle dashicons dashicons-menu"}),(0,e.createElement)(Ae,{name:`wcf-checkout-rules[${r}][step_id]`,value:n.step_id,placeholder:(0,le.__)("Search for step…","cartflows"),options:t.step_lists,label:(0,le.__)("Redirect to ","cartflows"),after:(0,le.__)("If the following conditions are true","cartflows")})),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_header"},(0,e.createElement)("span",{className:"wcf-checkout-rules--group_id"},(0,le.__)("ID - ","cartflows"),a),(0,e.createElement)("span",{className:"dashicons dashicons-arrow-down",onClick:d,"data-group_id":a}))),(0,e.createElement)("div",{id:`wcf-checkout-rules--group-${a}`,className:"hidden"},(0,e.createElement)("div",{className:"wcf-checkout-rules--group_rules--wrapper"},0!==o.length&&(0,e.createElement)(Ib,{rules:o,group_id:a,g_index:r,groups_length:c.length})),(0,e.createElement)("div",{className:"wcf-checkout-rules--add-rule__repeater"},(0,e.createElement)("div",{className:"wcf-button wcf-button--secondary ",group_id:a,onClick:u},(0,le.__)("Add Condition","cartflows"))))),(0,e.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper__footer"},(0,e.createElement)("div",{className:"wcf-checkout-rules--or-group"},(0,e.createElement)("span",{className:"wcf-checkout-rules--or_group__text"},(0,le.__)("OR","cartflows"))),parseInt(r)+1===c.length&&(0,e.createElement)("div",{className:"wcf-checkout-rules--or_group__button"},(0,e.createElement)("span",{className:"wcf-checkout-rules--or_group_button or-button wcf-button wcf-button--secondary",onClick:l},(0,le.__)("Add Dynamic Offer","cartflows")))))})))),"yes"===a["wcf-checkout-rules-option"]&&(0,e.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,e.createElement)(Ae,{name:"wcf-checkout-rules-default-step",value:a["wcf-checkout-rules-default-step"],placeholder:(0,le.__)("Search for default step…","cartflows"),options:t.step_lists,label:(0,le.__)("Redirect to","cartflows"),after:(0,le.__)("If all of the above conditions failed.","cartflows")}))),(0,e.createElement)("div",{className:"wcf-checkout-rules-save-settings"},(0,e.createElement)(ze,{className:"wcf-button wcf-button--primary"})))},Sb=function(n){const{innerField:r,innerFieldData:a,removecustomField:o,type:i}=n,[s,c]=(0,t.useState)((0,le.__)("Remove","cartflows")),[{options:l}]=he();return(0,e.createElement)("div",{className:"wcf-field-item__settings hidden",id:`wcf-field-setting-${r}`},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,a&&Object.keys(a.field_options).map((t=>{const n=a.field_options[t];let r="";const o=function(e){const t=e.name;let n="";if(t.includes("[")){const e=t.split("["),r=[];for(let t=1;t<e.length;t++)r.push(e[t].split("]")[0]);const a=t.substr(0,t.indexOf("["));n=l[a][r[0]][r[1]]}else n=l[e.name]?l[e.name]:e.value;return n}(n);switch(n.type){case"text":r=(0,e.createElement)(Ce,{class:n.class,name:n.name,value:o,label:n.label,placeholder:n.placeholder,readonly:n.readonly});break;case"checkbox":r=(0,e.createElement)(ke,{class:n.class,name:n.name,value:o,label:n.label,desc:n.desc,child_class:n.child_class});break;case"select":r=(0,e.createElement)(Ae,{class:n.class,name:n.name,value:o,label:n.label,options:n.options});break;case"doc":r=(0,e.createElement)(hc,{content:n.content})}return(0,e.createElement)("tr",{className:`wcf-cfe-field-${t}`,key:n.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,r)))})))),a.custom&&(0,e.createElement)("div",{className:"wcf-cpf-actions"},(0,e.createElement)("a",{className:"wcf-pro-custom-field-remove","data-key":r,"data-type":i,onClick:function(e){c((0,le.__)("Removing…","cartflows")),o(e)}},s)))},Tb=function(t){const[{billing_fields:n,shipping_fields:r},a]=he(),{step:o,type:i,removeCallback:s}=t;let c=[];c="billing"===i?n:r;const l=function(e){const t=e.target.getAttribute("data-name"),n=document.getElementById(`wcf-field-setting-${t}`);n.classList.contains("hidden")?n.classList.remove("hidden"):n.classList.add("hidden")},u=function(e){const t=e.target,n=t.getAttribute("for"),r=document.getElementById(n);t.classList.contains("dashicons-visibility")?(t.classList.remove("dashicons-visibility"),t.classList.add("dashicons-hidden"),t.closest(".wcf-field-item__bar").classList.add("wcf-field-item__disabled")):(t.classList.remove("dashicons-hidden"),t.classList.add("dashicons-visibility"),t.closest(".wcf-field-item__bar").classList.remove("wcf-field-item__disabled")),r.click()},d=function(e){s(e)};return(0,e.createElement)("div",null,(0,e.createElement)(be.ReactSortable,{list:c,setList:e=>a({type:"SET_FIELDS",field_type:i,fields:e}),direction:"vertical",animation:150,handle:".wcf-field-item"},c&&c.map((t=>{const n=t.key,r=t.enabled;return(0,e.createElement)("div",{key:n,className:"wcf-field-item","data-key":n},(0,e.createElement)("div",{className:"yes"===r?"wcf-field-item__bar ":"wcf-field-item__bar wcf-field-item__disabled"},(0,e.createElement)("div",{className:"wcf-field-item-handle"},(0,e.createElement)("span",{className:"yes"===r?"dashicons dashicons-visibility":"dashicons dashicons-hidden",htmlFor:"checkout"===o?`wcf_field_order_${i}[${n}][enabled]`:`wcf-optin-fields-${i}[${n}][enabled]`,onClick:u}),(0,e.createElement)("span",{className:"item-title"},(0,e.createElement)("span",{className:"wcf-field-item-title"},t.label?t.label:t.placeholder),"yes"===t.required&&(0,e.createElement)("span",null," *"),("billing_email"===n||"shipping_email"===n)&&(0,e.createElement)(bc,{text:(0,le.__)("Email field is not editable when using the Modern Checkout Style","cartflows"),position:"right"})),(0,e.createElement)("span",{className:"item-controls"},(0,e.createElement)("span",{className:"dashicons dashicons-menu"}),(0,e.createElement)("span",{className:"dashicons dashicons-arrow-down",onClick:l,"data-name":n})))),(0,e.createElement)(Sb,{innerField:n,innerFieldData:t,removecustomField:d,type:i}))}))))},kb=function(n){const{addNewField:r,step_type:a}=n,[o,i]=(0,t.useState)(!1),[s,c]=(0,t.useState)(!1),[l,u]=(0,t.useState)((0,le.__)("Add New Field","cartflows")),d=function(){i(!1),c(!1),h(!1),u((0,le.__)("Add New Field","cartflows"))},p=function(e){e.preventDefault(),i(!1)},f=function(e){e.preventDefault(),c(!0),u((0,le.__)("Adding…","cartflows")),s||r(e,d)},[m,h]=(0,t.useState)(!1),[g,y]=(0,t.useState)(!0),[w,v]=(0,t.useState)(!1),[b,M]=(0,t.useState)(!1),_=function(){h(!m)},E=function(){const e=document.getElementById("wcf-checkout-custom-fields[0][type]").value;v(!1),M(!1),y(!1),"text"===e||"textarea"===e?y(!0):"select"===e?M(!0):"checkbox"===e&&v(!0)};return(0,e.createElement)("div",{className:"wcf-custom-field-box"},(0,e.createElement)("p",null,(0,e.createElement)("button",{className:"wcf-add-custom-field wcf-button wcf-button--secondary",onClick:function(e){e.preventDefault(),i(!0)}},(0,le.__)("Add Custom Field","cartflows"))),o&&(0,e.createElement)("div",{className:"wcf-cfe-popup-overlay",onClick:function(e){"wcf-cfe-popup-overlay"===e.target.className&&(i(!1),c(!1))}},(0,e.createElement)("div",{className:"wcf-cfe-popup-content-wrapper"},function(){const t=[{value:"billing",label:(0,le.__)("Billing","cartflows")},{value:"shipping",label:(0,le.__)("Shipping","cartflows")}],n=[{value:"text",label:(0,le.__)("Text","cartflows")},{value:"textarea",label:(0,le.__)("TextArea","cartflows")},{value:"checkbox",label:(0,le.__)("Checkbox","cartflows")},{value:"select",label:(0,le.__)("Select","cartflows")},{value:"hidden",label:(0,le.__)("Hidden","cartflows")}],r=[{value:"33",label:(0,le.__)("33%","cartflows")},{value:"50",label:(0,le.__)("50%","cartflows")},{value:"100",label:(0,le.__)("100%","cartflows")}];return(0,e.createElement)("div",{className:"wcf-cfe-popup-content"},(0,e.createElement)("div",{className:"wcf-cpf-row-header"},(0,e.createElement)("div",{className:"wcf-popup-header-title"},(0,e.createElement)("span",{className:"cartflows-logo-icon"}),(0,le.__)("Add Custom Field","cartflows")),(0,e.createElement)("div",{className:"wcf-popup-header-action"},(0,e.createElement)("span",{className:"wcf-close-popup dashicons dashicons-no-alt",onClick:p}))),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,"checkout"===a&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-add_to",name:"wcf-checkout-custom-fields[0][add_to]",options:t,label:(0,le.__)("Add To","cartflows")}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-type",id:"wcf-checkout-custom-fields[0][type]",name:"wcf-checkout-custom-fields[0][type]",options:n,label:(0,le.__)("Type","cartflows"),onSelect:E}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ce,{class:"wcf-cpf-label",name:"wcf-checkout-custom-fields[0][label]",label:(0,le.__)("Label","cartflows")}))),b&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Le,{class:"wcf-cpf-options",name:"wcf-checkout-custom-fields[0][options]",label:(0,le.__)("Options","cartflows"),placeholder:(0,le.__)("Enter your options separated by comma.","cartflows")}))),w&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-default",name:"wcf-checkout-custom-fields[0][default]",label:(0,le.__)("Default","cartflows"),options:[{value:"1",label:(0,le.__)("Checked","cartflows")},{value:"0",label:(0,le.__)("UnChecked","cartflows")}]}))),!w&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ce,{class:"wcf-cpf-default",name:"wcf-checkout-custom-fields[0][default]",label:(0,le.__)("Default","cartflows")}))),g&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ce,{class:"wcf-cpf-placeholder",name:"wcf-checkout-custom-fields[0][placeholder]",label:(0,le.__)("Placeholder","cartflows")}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(Ae,{class:"wcf-cpf-width",name:"wcf-checkout-custom-fields[0][width]",options:r,value:"100",label:(0,le.__)("Width","cartflows")}))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{class:"wcf-cpf-required",name:"wcf-checkout-custom-fields[0][required]",label:(0,le.__)("Required","cartflows"),onClick:_}))),!m&&"optin"!==a&&(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{class:"wcf-cpf-optimized",name:"wcf-checkout-custom-fields[0][optimized]",label:(0,le.__)("Collapsible","cartflows")}))),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"wcf-button wcf-button--primary",onClick:f},l)))))}())))},Ob=function(){return(0,e.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section is-placeholder"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("form",null,(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})))),(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-custom-fields__button"})))),(0,e.createElement)(Ic,{fontSize:"35px",width:"400px"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"80%"}),(0,e.createElement)(Ic,{width:"65%"}))},Ab=function(){const[{custom_fields:t,step_id:n,flow_id:r,options:a,billing_fields:o,shipping_fields:i},c]=he(),[{},l]=s();if(void 0===t)return(0,e.createElement)(Ob,null);const u=t.extra_fields,d=function(e){e.preventDefault();const t=new FormData,r=e.target.getAttribute("data-key"),a=e.target.getAttribute("data-type");t.append("action","cartflows_pro_delete_custom_field"),t.append("security",cartflows_admin.delete_custom_field_nonce),t.append("post_id",n),t.append("key",r),t.append("type",a),t.append("step","checkout"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{if(e.status){const e=o.filter((function(e){return e.key!==r}));c({type:"SET_FIELDS",field_type:"billing",fields:e});const t=i.filter((function(e){return e.key!==r}));c({type:"SET_FIELDS",field_type:"shipping",fields:t})}}))};return(0,e.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("h3",{className:"wcf-custom-field-editor__title"},(0,le.__)("Field Settings","cartflows")),(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",r),t.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{l({status:"SAVED"})}))}},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,u&&Object.keys(u.fields).map((t=>{const n=u.fields[t],r=a[n.name]?a[n.name]:"",o=xe.isActiveControl(n,a);return(0,e.createElement)("tr",{className:o?"":"wcf-hide",key:n.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{name:n.name,value:r,label:n.label,desc:n.desc,child_class:n.child_class})))})))),"yes"===a["wcf-custom-checkout-fields"]&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,e.createElement)("h3",null,(0,le.__)("Custom Field Editor","cartflows")),cartflows_admin.is_pro&&(0,e.createElement)("div",{className:"wcf-custom-field-editor-buttons"},(0,e.createElement)(kb,{addNewField:function(e,t){e.preventDefault();const r=document.getElementsByClassName("wcf-cpf-add_to")[0],s=document.getElementsByClassName("wcf-cpf-type")[0],l=document.getElementsByClassName("wcf-cpf-label")[0],u=document.getElementsByClassName("wcf-cpf-default")[0],d=document.getElementsByClassName("wcf-cpf-placeholder")[0],p=document.getElementsByClassName("wcf-cpf-options")[0],f=document.getElementsByClassName("wcf-cpf-width")[0],m=document.getElementsByClassName("wcf-cpf-required")[1],h=document.getElementsByClassName("wcf-cpf-optimized")[1];if(""===l.value)return alert((0,le.__)("Label is required field","cartflows")),"";const g=new FormData;g.append("add_to",r?r.value:""),g.append("type",s?s.value:""),g.append("label",l?l.value:""),g.append("default",u?u.value:""),g.append("placeholder",d?d.value:""),g.append("options",p?p.value:""),g.append("width",f?f.value:""),g.append("required",m?m.value:""),g.append("optimized",h?h.value:""),g.append("action","cartflows_pro_prepare_custom_field"),g.append("security",cartflows_admin.prepare_custom_field_nonce),g.append("post_id",n),g.append("save_field_name","wcf_field_order_"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:g}).then((e=>{if(e.success){const t=e.data,n=t.field_data;if("billing"===t.add_to){o.push(n);const e=a.wcf_field_order_billing;e[t.new_field.key]=t.new_field,c({type:"SET_OPTION",name:"wcf_field_order_billing",value:e}),c({type:"SET_FIELDS",field_type:"billing",fields:o})}if("shipping"===t.add_to){i.push(n);const e=a.wcf_field_order_shipping;e[t.new_field.key]=t.new_field,c({type:"SET_OPTION",name:"wcf_field_order_shipping",value:e}),c({type:"SET_FIELDS",field_type:"shipping",fields:i})}}t()}))},step_type:"checkout"}))),(0,e.createElement)("div",{className:"wcf-billings-fields-section"},(0,e.createElement)("h3",null,(0,le.__)("Billing Fields","cartflows")),(0,e.createElement)("ul",{id:"wcf-billing-fields",className:"billing-field-sortable wcf-field-row"},o&&(0,e.createElement)(Tb,{data:o,step:"checkout",type:"billing",removeCallback:d}))),(0,e.createElement)("div",{className:"wcf-shippings-fields-section"},(0,e.createElement)("h3",null,(0,le.__)("Shipping Fields","cartflows")),(0,e.createElement)("ul",{id:"wcf-shipping-fields",className:"shipping-field-sortable wcf-field-row"},i&&(0,e.createElement)(Tb,{data:i,step:"checkout",type:"shipping",removeCallback:d})))),(0,e.createElement)(ze,{class:"wcf-save-cusom-field-editor wcf-button wcf-button--primary"}))))},Cb=function(){return(0,e.createElement)("div",{className:"wcf-custom-field-editor is-placeholder"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("form",null,(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"checkbox-title"})))),(0,e.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,e.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("div",{className:"wcf-optin-fields"},(0,e.createElement)("div",{className:"title"}),(0,e.createElement)("div",{className:"title"}),(0,e.createElement)("div",{className:"title"}))),(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-optin-form-field__button"})))))},Lb=function(){const[{custom_fields:t,step_id:n,flow_id:r,options:a,billing_fields:o},i]=he(),[{},c]=s();if(void 0===t)return(0,e.createElement)(Cb,null);const l=t.extra_fields;return(0,e.createElement)("div",{className:"wcf-custom-field-editor"},(0,e.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,e.createElement)("h3",{className:"wcf-custom-field-editor__title"},(0,le.__)("Field Editor","cartflows")),(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",r),t.append("step_id",n),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{c({status:"SAVED"}),console.log(e)}))}},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,l&&Object.keys(l.fields).map((t=>{const n=l.fields[t],r=a[n.name]?a[n.name]:"";return(0,e.createElement)("tr",{key:t},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(ke,{name:n.name,value:r,label:n.label,desc:n.desc})))})))),"yes"===a["wcf-optin-enable-custom-fields"]&&(0,e.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,e.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,e.createElement)("h3",null,(0,le.__)("Form Fields","cartflows")),cartflows_admin.is_pro&&(0,e.createElement)("div",{className:"wcf-custom-field-editor-buttons"},(0,e.createElement)(kb,{addNewField:function(e,t){e.preventDefault();const r=document.getElementsByClassName("wcf-cpf-type")[0],s=document.getElementsByClassName("wcf-cpf-label")[0],c=document.getElementsByClassName("wcf-cpf-default")[0],l=document.getElementsByClassName("wcf-cpf-placeholder")[0],u=document.getElementsByClassName("wcf-cpf-options")[0],d=document.getElementsByClassName("wcf-cpf-width")[0],p=document.getElementsByClassName("wcf-cpf-required")[1],f=document.getElementsByClassName("wcf-cpf-optimized")[1];if(""===s.value)return alert((0,le.__)("Label is required field","cartflows")),"";const m=new FormData;m.append("add_to","billing"),m.append("type",r?r.value:""),m.append("label",s?s.value:""),m.append("default",c?c.value:""),m.append("placeholder",l?l.value:""),m.append("options",u?u.value:""),m.append("width",d?d.value:""),m.append("required",p?p.value:""),m.append("optimized",f?f.value:""),m.append("action","cartflows_pro_prepare_custom_field"),m.append("security",cartflows_admin.prepare_custom_field_nonce),m.append("post_id",n),m.append("save_field_name","wcf-optin-fields-"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:m}).then((e=>{if(e.success){const t=e.data,n=t.field_data;if("billing"===t.add_to){o.push(n);const e=a["wcf-optin-fields-billing"];e[t.new_field.key]=t.new_field,i({type:"SET_OPTION",name:"wcf-optin-fields-billing",value:e}),i({type:"SET_FIELDS",field_type:"billing",fields:o})}}t()}))},step_type:"optin"}))),(0,e.createElement)("ul",{id:"wcf-optin-fields",className:"billing-field-sortable wcf-field-row"},(0,e.createElement)(Tb,{data:o,step:"optin",type:"billing",removeCallback:function(e){e.preventDefault();const t=new FormData,r=e.target.getAttribute("data-key"),a=e.target.getAttribute("data-type");t.append("action","cartflows_pro_delete_custom_field"),t.append("security",cartflows_admin.delete_custom_field_nonce),t.append("post_id",n),t.append("key",r),t.append("type",a),t.append("step","optin"),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{if(console.log(e),e.status){const e=o.filter((function(e){return e.key!==r}));i({type:"SET_FIELDS",field_type:"billing",fields:e})}}))}}))),(0,e.createElement)(ze,{class:"wcf-save-cusom-field-editor wcf-button wcf-button--primary"}))))},zb=function(t){let{settings:n}=t;const[{options:r}]=he();return(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("h3",{className:"wcf-list-options__title"},n.title),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(n.fields).map((t=>{const a=n.fields[t],o=a.type;let i="";const s=r[a.name]?r[a.name]:"",c=xe.isActiveControl(a,r);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,id:a.name,name:a.name,value:a.readonly?a.value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,id:a.name,name:a.name,value:s,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{id:a.name,name:a.name,value:s,label:a.label,checked:"yes"===s,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{id:a.name,name:a.name,value:s,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:a.name,label:a.label,desc:a.desc,field:a.fieldtype,placeholder:a.placeholder,tooltip:a.tooltip,value:s}));break;case"product-repeater":i=(0,e.createElement)(Na,{id:a.name,name:a.name,value:s,label:a.label});break;case"font-family":i=(0,e.createElement)(cc,{id:a.name,name:a.name,value:s,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"product-options":i=(0,e.createElement)(Da,{id:a.name,name:a.name,label:a.label,products:s});break;case"color-picker":i=(0,e.createElement)(sc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{id:a.name,name:a.name,label:a.label,value:s,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:c?"":"wcf-hide",key:a.name},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))))},Pb=function(){const[{step_data:t,flow_id:n,step_id:r,settings_data:a,page_settings:o,is_cf_pro:i,options:c}]=he(),[{},l]=s(),u=o;if(void 0===a.settings)return(0,e.createElement)(fb,null);const d=c["wcf-checkout-products"];return(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);if(t.append("action","cartflows_save_meta_settings"),t.append("security",cartflows_admin.save_meta_settings_nonce),t.append("post_id",n),t.append("step_id",r),"single-selection"===c["wcf-product-options"]){const e=t.get("wcf_default_add_to_cart");t.set(`wcf-product-options-data[${e}][add_to_cart]`,"yes")}ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{l({status:"SAVED"})}))}},(0,e.createElement)("div",{className:"wcf-checkout-products"},(0,e.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,e.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,e.createElement)(zb,{settings:u.settings.product}))),"checkout"===t.type&&(0,e.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,e.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,e.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,e.createElement)(zb,{settings:u.settings.coupon}))),function(t){return 0===t.length&&i?(0,e.createElement)("div",{className:"wcf-product-options-section"},(0,e.createElement)("h3",{className:"wcf-product-options__title"},(0,le.__)("Product Options","cartflows")),(0,e.createElement)("div",{className:"wcf-product-options-notice__text"},(0,le.__)("No Products Selected. Please add product/s first.","cartflows"))):(0,e.createElement)("div",{className:"wcf-checkout-products--options"},(0,e.createElement)("div",{className:"wcf-product-options-wrapper"},(0,e.createElement)(zb,{settings:u.settings["product-options"]})))}(d))),(0,e.createElement)("div",null,(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},Ub=function(){const t=new URLSearchParams(Z().search).get("tab");return(0,e.createElement)(e.Fragment,null,function(){var n,r;let a=(0,e.createElement)("h1",null,"404 Not Found");switch(t){case"design":default:a=(0,e.createElement)(ub,null);break;case"settings":a=(0,e.createElement)(pb,null);break;case"checkout_form_fields":a=(0,e.createElement)(Ab,null);break;case"checkout_products":a=(0,e.createElement)(Pb,null);break;case"products":a=(0,e.createElement)(hb,null);break;case"order_bumps":a="no"===(null===(n=cartflows_admin)||void 0===n?void 0:n.is_order_bump_migrated)||"processing"===(null===(r=cartflows_admin)||void 0===r?void 0:r.is_order_bump_migrated)?(0,e.createElement)(Mb,null):(0,e.createElement)(_b,null);break;case"checkout_offer":a=(0,e.createElement)(Db,null);break;case"optin_form_fields":a=(0,e.createElement)(Lb,null);break;case"dynamic-offers":a=(0,e.createElement)(jb,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper"},a))}())},Yb=function(){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&path=flows`,className:"wcf-breadcrum--nav-item__link"},(0,le.__)("Flows","cartflows"))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "))},Rb=function(n){const{type:r,action:a}=n,[{flow_id:o,flow_title:i,title:s,step_id:c,view_url:l},u]=he();(0,t.useEffect)((()=>{let e=!0;return()=>{e=!1}}),[]);const[d,p]=(0,t.useState)(!1),[f,m]=(0,t.useState)(""),h=(0,t.createRef)(),g=function(e){e.preventDefault(),p(!0)},y=function(e){e.preventDefault(),m("wcf-saving");const t=h.current.value,n=new window.FormData;n.append("action","cartflows_update_step_title"),n.append("security",cartflows_admin.update_step_title_nonce),n.append("step_id",c),n.append("new_step_title",t),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{u({type:"SET_STEP_TITLE",title:t}),m(""),p(!1)}))},w=function(e){e.preventDefault(),p(!1)};return!1===s?"":(0,e.createElement)("div",{className:"wcf-edit-step__title-wrap"},(0,e.createElement)("div",{className:"wcf-steps-header--title wcf-step__title--editable"},function(){let t=s;""===t&&(t=(0,le.__)("(no title)","cartflows"));let n=De(t,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),r=(0,e.createElement)("a",{href:"#",className:"wcf-steps-header__title--edit",title:(0,le.__)("Edit Step Name","cartflows"),onClick:g},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}));return d&&(n=(0,e.createElement)(uc,{attr:{ref:h},id:"new-step-title",value:t,autocomplete:"off",class:"new-step-title"}),r=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:`wcf-button--small wcf-button--primary ${f}`,href:"#",onClick:y},(0,le.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button--small wcf-button--secondary",href:"#",onClick:w},(0,le.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-steps-header__title--text",title:t},n),(0,e.createElement)("span",{className:"wcf-steps-header__title--buttons"},r))}(),!d&&(0,e.createElement)("span",{className:"wcf-steps-header__quick-view"},(0,e.createElement)("a",{href:l,className:"wcf-steps-header__quick-view--button",title:(0,le.__)("Quick View","cartflows"),target:"_blank",rel:"noreferrer"},(0,e.createElement)("span",{className:"dashicons dashicons-external"})))),(0,e.createElement)("div",{className:"wcf-steps-header--breadcrums"},"flow"===r&&(0,e.createElement)(Yb,null),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&action=${a}&flow_id=${o}`,className:"wcf-breadcrum--nav-item__link"},""===i?(0,le.__)("(no title)","cartflows"):De(i,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},""===s?(0,le.__)("(no title)","cartflows"):De(s,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))},Qb=function(){const[{step_id:n,step_data:r},a]=he(),[{unsavedChanges:o}]=s(),i=cartflows_admin.woocommerce_status;we(),(0,t.useEffect)((()=>{let e=!0;return(async()=>{ye()({path:`/cartflows/v1/admin/step-data/${n}`}).then((t=>{if(e){if(t.billing_fields){const e=Object.entries(t.billing_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.billing_fields=e}if(t.shipping_fields){const e=Object.entries(t.shipping_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.shipping_fields=e}a({type:"SET_STEP_DATA",data:t})}}))})(),()=>{e=!1}}),[]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Q,{when:o,message:"Are you sure you want to leave?"}),(0,e.createElement)("div",{className:"editor-wrap__header"},function(){if("active"!==i&&Object.keys(r).length>0&&"landing"!==r.type)return(0,e.createElement)("div",{className:"wcf-woo-notice"},(0,le.__)("This page requires WooCommerce plugin installed and activated!","cartflows"))}(),function(){if("active"===i&&r&&("upsell"===r.type||"downsell"===r.type)){var t,n;const r=null===(t=cartflows_admin)||void 0===t?void 0:t.supported_payment_gateways,a=null===(n=cartflows_admin)||void 0===n?void 0:n.available_payment_gateways;let o=[];if(r&&a&&(Object.keys(a).map((e=>{if(!r.hasOwnProperty(e)){const t=a[e];o.push(t.method_title)}return""})),o.length>0))return o=o.join(", "),(0,e.createElement)("div",{className:"wcf-payment-gateway-notice"},(0,e.createElement)("div",{className:"wcf-payment-gateway-notice-text"},(0,le.__)("CartFlows Upsell/Downsell offer does not support the ","cartflows"),(0,e.createElement)("span",{className:"wcf-gateway-notice-style"},o),(0,le.__)(" payment gateway. Please find the supported payment gateways ","cartflows"),(0,e.createElement)("a",{href:"https://cartflows.com/docs/supported-payment-gateways-by-cartflows/",target:"_blank",rel:"noreferrer"},(0,le.__)("here.","cartflows"))))}}(),(0,e.createElement)(Rb,{type:"flow",action:"wcf-edit-flow"})),(0,e.createElement)("div",{className:"editor-wrap__content"},(0,e.createElement)(sb,{action:"wcf-edit-flow",editAction:"wcf-edit-step"}),(0,e.createElement)(Ub,null)))},Fb=function(){var t;const[{page_slug:n,flow_id:r,step_id:a}]=he();let o=[];o=[{name:(0,le.__)("Product","cartflows"),id:"product"},{name:(0,le.__)("Design","cartflows"),id:"design"},{name:(0,le.__)("Content","cartflows"),id:"content"},{name:(0,le.__)("Conditions","cartflows"),id:"conditions"},{name:(0,le.__)("Settings","cartflows"),id:"settings"}];const i=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search),s=i.get("page")?i.get("page"):n,c=i.get("obtab")?i.get("obtab"):"product",l=i.get("ob_id")?i.get("ob_id"):"";return(0,e.createElement)("div",{className:"wcf-edit-step--nav"},(0,e.createElement)(te,{to:{pathname:"admin.php",search:`?page=${n}&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps`},className:"wcf-edit-step--nav__back-to-flow"},(0,e.createElement)("button",{className:"wcf-edit-step--nav__back-to-flow--button"},(0,e.createElement)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,e.createElement)("span",{className:"wcf-back-button"},(0,le.__)("Back","cartflows")))),o.map((t=>(0,e.createElement)(te,{key:t.tab,to:{pathname:"admin.php",search:`?page=${n}&action=${cartflows_admin.step_action}&flow_id=${r}&step_id=${a}&tab=order_bumps&ob_id=${l}${""!==t.id&&"&obtab="+t.id}`},className:"wcf-edit-step--nav__tab "+(s===n&&c===t.id?" wcf-edit-step--nav__tab--active":"")},t.name))))},Bb=function(){return(0,e.createElement)("div",{className:"wcf-order-bump-product-tab is-placeholder"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",{className:""},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("span",null)))},qb=function(){return(0,e.createElement)("div",{className:"wcf-order-bump-design-tab is-placeholder"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",null))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,e.createElement)("div",{className:"wcf-selection-field"},(0,e.createElement)("label",null)))))))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("span",null))),(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview--title"},(0,e.createElement)("label",null)),(0,e.createElement)("div",{className:"wcf-bump-order-wrap wcf-bump-order-style-1 wcf-after-order"},(0,e.createElement)("div",{className:"wcf-bump-order-content"},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("span",null)),(0,e.createElement)("div",{className:"wcf-content-container"},(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight"})),(0,e.createElement)("div",{className:"wcf-bump-order-desc"})))))))},Vb=function(){return(0,e.createElement)("div",{className:"wcf-order-bump-setting-tab is-placeholder"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",null))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-one"})))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-two"})))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",null))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-one"})))),(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"row"},(0,e.createElement)("div",{className:"wcf-field__data--label"},(0,e.createElement)("label",{className:"wcf-field-two"})))))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("span",null)))},Hb=function(){return(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,e.createElement)(Ic,{width:"65%"})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group"},Array(3).fill().map(((t,n)=>(0,e.createElement)("div",{className:"wcf-order-bumps-rule",key:t},(0,e.createElement)("div",{className:"wcf-order-bumps-rule--select-box"},(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"}),(0,e.createElement)(Sc,{height:"35px",width:"30%"})),2!==n&&(0,e.createElement)("div",{className:"wcf-order-bumps-rule__and"},(0,e.createElement)(Sc,{height:"25px",width:"5%"})))))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or"},(0,e.createElement)(Sc,{height:"35px",width:"5%"}),(0,e.createElement)(Sc,{height:"45px",width:"12%"})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-save-settings"},(0,e.createElement)(Sc,{height:"45px",width:"12%"})))};const Gb=new function(){const e=this;this.compare=function(e,t,n){switch(n){case"==":return e==t;case"!=":return e!=t;case"!==":return e!==t;case"in":return-1!==t.indexOf(e);case"!in":return-1===t.indexOf(e);case"contains":return-1!==e.indexOf(t);case"!contains":return-1===e.indexOf(t);case"<":return e<t;case"<=":return e<=t;case">":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,n){const r="or"===t.relation;let a=!r;return t.fields.map((function(t){let o;return o=t.fields?e.check(t,n):e.compare(n[t.name],t.value,t.operator),r?(o&&(a=!0),!o):o?"":a=!1})),a},this.isActiveControl=function(t,n){const r=!(null==t||!t.conditions)&&(null==t?void 0:t.conditions);return!(r&&!e.check(r,n))}};var Zb=function(){const[{current_ob:n}]=he(),r=n,a=e=>{let t=r.product;return e&&t&&(Array.isArray(t)&&(t=r.product[0]),e=(e=(e=(e=e.replace("{{product_name}}",t.product_name)).replace("{{product_price}}",t.display_price?t.display_price:t.original_price)).replace("{{product_desc}}",t.product_desc)).replace("{{quantity}}",r.quantity)),e},o=r.position,i=a(r.checkbox_label),s=a(r.hl_text),c=(0,Te.ZP)(a(r.desc_text)),l=r.show_arrow,u=r.style,d=a(r.title_text),p=r.action_element,f=r.show_animation,m=r.enable_show_image,h="yes"===f?"wcf-blink":"",g=(0,e.createElement)("svg",{version:"1.1",className:`wcf-pointing-arrow ${h}`,id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"20px",height:"15px",fill:"red",viewBox:"310 253 90 70",enableBackground:"new 310 253 90 70"},(0,e.createElement)("g",null,(0,e.createElement)("g",null,(0,e.createElement)("path",{d:"M364.348,253.174c-0.623,0.26-1.029,0.867-1.029,1.54v18.257h-51.653c-0.919,0-1.666,0.747-1.666,1.666v26.658c0,0.92,0.747,1.666,1.666,1.666h51.653v18.327c0,0.673,0.406,1.28,1.026,1.54c0.623,0.257,1.34,0.116,1.816-0.36l33.349-33.238 c0.313-0.313,0.49-0.737,0.49-1.18c0-0.443-0.177-0.866-0.487-1.179l-33.349-33.335 C365.688,253.058,364.971,252.915,364.348,253.174z"})))),y=r.bg_color,w=r.border_style,v=r.border_color,b=r.label_color,M=r.label_bg_color,_=r.desc_text_color,E=r.hl_text_color,N=r.button_text_color,D=r.button_color,x=r.title_text_color,I=r.label_border_style,j=r.label_border_color,S={background:y,"border-style":w,"border-color":v};let T={},k={};"style-1"===u?T={"border-color":v,"border-bottom-style":w,background:M}:"style-2"===u?(T={"border-color":v,"border-top-style":"inherit"!==w?w:"dashed",background:M},S["border-style"]="inherit"!==w?w:"dashed"):"style-3"===u||"style-4"===u?S["border-style"]="inherit"!==w?w:"solid":"style-5"===u&&(S["border-style"]="inherit"!==w?w:"",k={"border-style":"inherit"!==I?I:"solid","border-color":j,background:M});let O="",A="left",C="auto";return"yes"===m&&(O=r.product_image,A=r.ob_image_position,C=""!==r.ob_image_width?r.ob_image_width+"px":"auto"),(0,t.useEffect)((()=>{const e=document.getElementById("wcf-order-bump-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",(()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")}));return()=>{window.removeEventListener("scroll",n)}}),[]),(0,e.createElement)("div",{id:"wcf-order-bump-preview-wrapper",className:"wcf-order-bump-preview-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview--title"},(0,e.createElement)("label",null,(0,le.__)("Order Bump Preview","cartflows"))),(0,e.createElement)("div",{className:`wcf-bump-order-wrap wcf-bump-order-${u} wcf-${o}`,style:S},function(){let t="";return"style-1"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap",style:T},"right"!==A&&(0,e.createElement)("label",{style:{color:b}},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("span",{className:"wcf-bump-order-label"},i)),"right"===A&&(0,e.createElement)("label",{style:{color:b}},(0,e.createElement)("span",{className:"wcf-bump-order-label"},i),(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===l&&g)),(0,e.createElement)("div",{className:"wcf-content-container"},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:E}},s)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})))):"style-2"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:E}},s)),(0,e.createElement)("div",{className:"wcf-content-container"},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100%":C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100%":C},alt:(0,le.__)("Order Bump Product Image","cartflows")}))),(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap",style:T},"right"!==A&&(0,e.createElement)("label",{style:{color:b}},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("span",{className:"wcf-bump-order-label"},i)),"right"===A&&(0,e.createElement)("label",{style:{color:b}},(0,e.createElement)("span",{className:"wcf-bump-order-label"},i),(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===l&&g))):"style-3"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==O&&"top"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-action"},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),(0,e.createElement)("div",{className:"wcf-bump-order-info"},""!==O&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"80px":C,height:"auto"},alt:(0,le.__)("Order Bump Product Image","cartflows")}))),(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},""===O&&(0,e.createElement)(e.Fragment,null,"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==O&&"top"===A&&(0,e.createElement)(e.Fragment,null,"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),(0,e.createElement)("label",{style:{color:x}},d)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c))),"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:x}},d),""===O&&(0,e.createElement)(e.Fragment,null,"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}))),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)),(0,e.createElement)("div",{className:"wcf-bump-order-info"},""!==O&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"80px":C,height:"auto"},alt:(0,le.__)("Order Bump Product Image","cartflows")}))),""!==O&&(0,e.createElement)("div",{className:"wcf-bump-order-action"},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})))):"style-4"===u?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${A} `},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100px":C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),"right"!==A&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-info"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:x}},d)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c))),(0,e.createElement)("div",{className:"wcf-bump-order-action"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:{color:N,background:D}},(0,le.__)("Add","cartflows")))),"right"===A&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-bump-order-action"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:{color:N,background:D}},(0,le.__)("Add","cartflows"))),(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-info"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:x}},d)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c)))),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:"auto"===C?"100px":C},alt:(0,le.__)("Order Bump Product Image","cartflows")})))):"style-5"===u&&(t=(0,e.createElement)("div",{className:"wcf-bump-order-content"},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("div",{className:`wcf-bump-order-info wcf-bump-order-image-${A} `},""!==O&&"right"!==A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-text"},""!==d&&(0,e.createElement)("div",{className:"wcf-bump-order-label",style:{color:x}},(0,e.createElement)("span",null,d)),""!==c&&(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:_}},c),"checkbox"===p&&(0,e.createElement)("div",{className:"wcf-bump-order-action",style:k},"yes"===l&&g,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("label",{style:{color:b}},i)),"button"===p&&(0,e.createElement)("div",{className:"wcf-bump-order-action wcf-ob-action-button"},(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:{color:N,background:D}},(0,le.__)("Add","cartflows")))),""!==O&&"right"===A&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:O,className:"wcf-image",style:{width:C},alt:(0,le.__)("Order Bump Product Image","cartflows")})))))),t}()))},Wb=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(qb,null);const r=t.settings["multiple-order-bump-design"];return(0,e.createElement)("div",{className:"wcf-order-bump-design-tab"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name,c=n[a.name],l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:c}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))),(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__preview"},(0,e.createElement)(Zb,null)))},$b=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(Bb,null);const r=t.settings["multiple-order-bump-product"];return(0,e.createElement)("div",{className:"wcf-order-bump-product-tab"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name;let c=n[a.name];if("original_price"===s||"sell_price"===s){const e=n.product;if(""===e||null==e)c=(0,le.__)("No product Selected","cartflows");else if(null!==e||void 0!==e){const t=Array.isArray(e)?parseFloat(n.product[0].original_price):parseFloat(n.product.original_price);if("sell_price"===s){const e=n.discount_type,r=parseFloat(n.discount_value);let a=t;"discount_percent"===e?r>0&&(a=(t-t*r/100).toFixed(2)):"discount_price"===e?r>0&&(a=(t-r).toFixed(2)):"coupon"===e&&(a=(0,le.__)("Coupon will apply on checkout page","cartflows")),c=a}else"original_price"===s&&(c=t)}}const l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,desc:a.desc,placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip,isNameArray:a.isNameArray});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},Xb=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(Vb,null);const r=t.settings["multiple-order-bump-settings"];return(0,e.createElement)("div",{className:"wcf-order-bump-setting-tab"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name,c=n[a.name],l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"select2":i=(0,e.createElement)(ba,{id:a.name,name:a.name,value:c,label:a.label,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,options:a.options,isMulti:a.isMulti});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":const t="product_img_obj";i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip,isNameArray:a.isNameArray,objName:t});break;case"doc":i=(0,e.createElement)(hc,{content:a.content,custom_class:a.custom_class});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},Kb=function(){const[{page_settings:t,current_ob:n}]=he();if(null===t||"undefined"===t)return(0,e.createElement)(qb,null);const r=t.settings["multiple-order-bump-content"];return(0,e.createElement)("div",{className:"wcf-order-bump-content-tab"},(0,e.createElement)("div",{className:"wcf-order-bump-content-tab__settings"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,Object.keys(r.fields).map((t=>{const a=r.fields[t],o=a.type;let i="";const s=a.name,c=n[a.name],l=Gb.isActiveControl(a,n);switch(o){case"text":i=(0,e.createElement)(Ce,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,desc:a.desc,tooltip:a.tooltip});break;case"number":i=(0,e.createElement)(dc,{type:a.type,name:s,value:c,label:a.label,placeholder:a.placeholder,readonly:a.readonly,min:a.min,max:a.max,desc:a.desc,tooltip:a.tooltip,afterfield:a.afterfield,width:a.width});break;case"checkbox":i=(0,e.createElement)(ke,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip});break;case"radio":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip,child_class:a.child_class});break;case"radio-one":i=(0,e.createElement)(Oe,{name:s,value:c,label:a.label,checked:"yes"===c,backComp:!0,desc:a.desc,tooltip:a.tooltip});break;case"textarea":i=(0,e.createElement)(Le,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,rows:a.rows,cols:a.cols});break;case"select":i=(0,e.createElement)(Ae,{name:s,value:c,label:a.label,options:a.options,desc:a.desc,tooltip:a.tooltip});break;case"product":i=(0,e.createElement)("div",null,(0,e.createElement)(wc,{name:s,label:a.label,desc:a.desc,field:a.fieldtype,allowed_products:a.allowed_product_types?a.allowed_product_types:"",include_products:a.include_product_types?a.include_product_types:"",excluded_products:a.excluded_product_types?a.excluded_product_types:"",placeholder:a.placeholder,tooltip:a.tooltip,value:c,nameComp:a.nameComp}));break;case"coupon":i=(0,e.createElement)("div",null,(0,e.createElement)(vc,{name:s,label:a.label,field:a.fieldtype,placeholder:a.placeholder,desc:a.desc,tooltip:a.tooltip,value:c}));break;case"font-family":i=(0,e.createElement)(cc,{name:s,value:c,label:a.label,desc:a.desc,tooltip:a.tooltip,font_weight_name:a.font_weight_name,font_weight_value:a.font_weight_value});break;case"color-picker":i=(0,e.createElement)(sc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip});break;case"image-selector":const t="product_img_obj",r=n[t];i=(0,e.createElement)(lc,{name:s,label:a.label,value:c,desc:a.desc,tooltip:a.tooltip,isNameArray:a.isNameArray,objName:t,objValue:r,singleButton:a.singleButton});break;case"doc":i=(0,e.createElement)(hc,{content:a.content});break;case"pro-notice":i=(0,e.createElement)("p",{className:"wcf-pro-update-notice"},"Please upgrade to the CartFlows Pro to use the ",a.feature," feature.");break;case"heading":i=(0,e.createElement)(gc,{label:a.label,desc:a.desc})}return(0,e.createElement)("tr",{className:l?"":"wcf-hide",key:s},(0,e.createElement)("th",{scope:"row"},(0,e.createElement)(e.Fragment,null,i)))})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"}))),(0,e.createElement)("div",{className:"wcf-order-bump-content-tab__preview"},(0,e.createElement)(Zb,null)))},Jb=function(t){let{rules:n,group_id:r,g_index:a,groups_length:o}=t;const[{page_settings:i},s]=he(),c=i.settings["multiple-order-bump-rules"],l=c.conditions,u=e=>{const t=e.target.getAttribute("rule_id");r&&t&&s({type:"REMOVE_OB_RULE",name:"rules",rule_id:t,group_id:r})};return(0,e.createElement)(e.Fragment,null,n.map(((t,i)=>{const d=null==t?void 0:t.rule_id,p=n[i],f=c.field_data[p.condition];return(0,e.createElement)(e.Fragment,null,0!==i&&(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules__condition-label"},(0,e.createElement)("div",{className:"wcf--condition-label__and_group"},(0,e.createElement)("span",{className:"wcf--condition-label__and_group__text"},"AND"))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules","data-rule-id":d,key:d},(0,e.createElement)("input",{type:"hidden",name:`rules[${a}][rules][${i}][rule_id]`,value:d}),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--rule_fields"},(0,e.createElement)(Ae,{name:`rules[${a}][rules][${i}][condition]`,options:l,onSelect:()=>{s({type:"RESET_OB_RULE_VALUE",name:"rules",group_id:r,rule_id:d})},value:p.condition}),(0,e.createElement)(Ae,{name:`rules[${a}][rules][${i}][operator]`,options:f.operator,value:(0,Te.ZP)(p.operator)}),function(t,n,r){const o=r.value;let i="";const s=`rules[${a}][rules][${n}][value]`;return t.map((t=>{switch(t.type){case"select2":i=(0,e.createElement)(ba,{name:`${s}[]`,value:o,placeholder:t.placeholder,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti});break;case"number":i=(0,e.createElement)(dc,{name:s,value:o,min:0,placeholder:t.placeholder,tooltip:t.tooltip});break;case"coupon":i="exist"===r.operator||"not_exist"===r.operator?(0,e.createElement)(Ae,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,e.createElement)(vc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti});break;case"product":i=(0,e.createElement)(wc,{name:s,placeholder:t.placeholder,tooltip:t.tooltip,value:o,isMulti:t.isMulti})}return i}))}(f.fields,i,p)),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--rule_actions"},function(t,n){return 1===t&&1===o?"":(0,e.createElement)("span",{className:"dashicons dashicons-trash and-close",onClick:u,group_id:r,rule_id:n})}(n.length,d))))})))},eM=function(){const[{options:t,current_ob:n},r]=he();if(null===t||"undefined"===n)return(0,e.createElement)(Hb,null);const a=n.rules;if(void 0===a)return(0,e.createElement)(hc,{content:(0,le.__)("Please Update the CartFlows Pro to the latest version to use the conditional order bump feature.","cartflows")});const o=()=>{const e={group_id:Math.random().toString(36).substring(2,5),rules:[{rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""}]};r({type:"ADD_NEW_OB_GROUP",name:"rules",newGroup:e})},i=e=>{const t=e.target.getAttribute("group_id"),n={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};r({type:"ADD_NEW_OB_RULE",name:"rules",newRule:n,group_id:t})},s=function(e){const t=e.target.getAttribute("data-group_id"),n=document.getElementById(`wcf-order-bumps-rules--group-${t}`);c(e,n)},c=function(e,t){t.classList.contains("hidden")?(t.classList.remove("hidden"),e.target.classList.remove("dashicons-arrow-down"),e.target.classList.add("dashicons-arrow-up")):(t.classList.add("hidden"),e.target.classList.add("dashicons-arrow-down"),e.target.classList.remove("dashicons-arrow-up"))};return console.log(a),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,e.createElement)(ke,{name:"is_rule",value:n.is_rule,label:(0,le.__)("Enable conditional order bump ","cartflows"),tooltip:(0,le.__)("By enabling this option, you can create the conditions to display the order bump.","cartflows")})),"yes"===n.is_rule&&a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(be.ReactSortable,{list:a,setList:e=>r({type:"SET_OB_RULES_GROUPS",groups:e,fieldName:"rules"}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bumps-rules-page--group_wrapper",filter:".wcf-order-bumps-rules--rule_fields, .wcf-order-bumps-rules--rule_actions, .wcf-field wcf-select-option, .wcf-order-bumps-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-order-bumps-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header__right",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:inline-block")}},a.map(((t,n)=>{const r=t.group_id,c=t.rules;return(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper",key:r},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group","data-group-id":r},(0,e.createElement)("input",{type:"hidden",name:`rules[${n}][group_id]`,value:r}),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group-header"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_header__left"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules__handle dashicons dashicons-menu"}),(0,e.createElement)("span",{className:"wcf-group-header--text"},(0,le.__)("Show this order bump if following conditions are true","cartflows"))),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_header__right"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--group_id"},(0,le.__)("ID - ","cartflows"),r),(0,e.createElement)("span",{className:"dashicons dashicons-arrow-down",onClick:s,"data-group_id":r}))),(0,e.createElement)("div",{id:`wcf-order-bumps-rules--group-${r}`,className:"hidden"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules--wrapper"},0!==c.length&&(0,e.createElement)(Jb,{rules:c,group_id:r,g_index:n,groups_length:a.length})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--add-rule__repeater"},(0,e.createElement)("div",{className:"wcf-button wcf-button--secondary ",group_id:r,onClick:i},(0,le.__)("Add Condition","cartflows"))))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper__footer"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or_group"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--or_group__text"},(0,le.__)("OR","cartflows"))),parseInt(n)+1===a.length&&(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or_group__button"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--or_group_button or-button wcf-button wcf-button--secondary",onClick:o},(0,le.__)("Add Conditions Group","cartflows")))))})))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-save-settings"},(0,e.createElement)(ze,{class:"wcf-button wcf-button--primary"})))},tM=function(){const[{flow_id:n,step_id:r,options:a,current_ob:o},i]=he(),[{},c]=s(),l=new URLSearchParams(Z().search),u=l.get("ob_id"),d=l.get("obtab");if((0,t.useEffect)((()=>((async()=>{!function(){const e=new window.FormData;e.append("action","cartflows_pro_get_current_order_bump"),e.append("security",cartflows_admin.get_current_order_bump_nonce),e.append("ob_id",u),e.append("step_id",r),ye()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{e.data.success&&i({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:u})}))}(),null!==a&&"undefined"!==a||ye()({path:`/cartflows/v1/admin/step-data/${r}`}).then((e=>{if(e.billing_fields){const t=Object.entries(e.billing_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));e.billing_fields=t}if(e.shipping_fields){const t=Object.entries(e.shipping_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));e.shipping_fields=t}i({type:"SET_STEP_DATA",data:e})}))})(),()=>{})),[]),null===o||"undefined"===o||o&&u!==o.id){let t="";switch(d){case"design":case"content":t=(0,e.createElement)(qb,null);break;case"product":default:t=(0,e.createElement)(Bb,null);break;case"settings":t=(0,e.createElement)(Vb,null);break;case"conditions":t=(0,e.createElement)(Hb,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper wcf-order-bump-page-wrapper"},t))}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault();const t=new window.FormData(e.target);t.append("action","cartflows_pro_save_order_bump_settings"),t.append("security",cartflows_admin.save_order_bump_settings_nonce),t.append("post_id",n),t.append("step_id",r),t.append("ob_id",u),t.append("ob_tab",d),ye()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{e.data&&e.data.current_ob&&i({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:u}),c({status:"SAVED"})}))}},function(){let t=(0,e.createElement)("h1",null,"404 Not Found");switch(d){case"design":t=(0,e.createElement)(Wb,null);break;case"product":default:t=(0,e.createElement)($b,null);break;case"settings":t=(0,e.createElement)(Xb,null);break;case"content":t=(0,e.createElement)(Kb,null);break;case"conditions":t=(0,e.createElement)(eM,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper wcf-order-bump-page-wrapper"},t))}()))},nM=function(){const[{flow_id:n,step_id:r,flow_title:a,title:o,step_title:i,current_ob:s},c]=he(),l=new URLSearchParams(Z().search);if(!1===o||null===s||"undefined"===s)return"";const u=l.get("ob_id");if(s.id!==u)return"";const[d,p]=(0,t.useState)(!1),[f,m]=(0,t.useState)(!1),[h,g]=(0,t.useState)(""),[y,w]=(0,t.useState)(s.status);let v=s.title;const b=(0,t.createRef)(),M=function(e){e.preventDefault(),m(!0)},_=function(e){e.preventDefault(),g("wcf-saving");const t=b.current.value,n=new window.FormData;n.append("action","cartflows_pro_update_order_bump_title"),n.append("security",cartflows_admin.update_order_bump_title_nonce),n.append("step_id",r),n.append("new_title",t),n.append("ob_id",u),ye()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{c({type:"SET_OB_TITLE",title:t,name:"wcf-order-bumps",ob_id:u}),g(""),m(!1)}))},E=function(e){e.preventDefault(),m(!1)};return(0,e.createElement)("div",{className:"wcf-edit-ob__title-wrap"},(0,e.createElement)("div",{className:"wcf-ob-header--action-wrap"},(0,e.createElement)("div",{className:"wcf-ob-header--title wcf-ob__title--editable"},function(){""===v&&(v=(0,le.__)("(no title)","cartflows"));let t=De(v,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),n=(0,e.createElement)("a",{href:"#",className:"wcf-ob-header__title--edit",title:(0,le.__)("Edit Step Name","cartflows"),onClick:M},(0,e.createElement)("span",{className:"dashicons dashicons-edit"}));return f&&(t=(0,e.createElement)(uc,{attr:{ref:b},id:"new-step-title",value:v,autocomplete:"off",class:"new-step-title"}),n=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:`wcf-button--small wcf-button--primary ${h}`,href:"#",onClick:_},(0,le.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button--small wcf-button--secondary",href:"#",onClick:E},(0,le.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-ob-header__title--text"},t),(0,e.createElement)("span",{className:"wcf-ob-header__title--buttons"},n))}()),!f&&(0,e.createElement)("div",{className:"wcf-ob-header--ob-status"},(0,e.createElement)("button",{type:"button",className:"wcf-ob-status wcf-switch wcf-toggle-order-bump-status switch-grid","data-wcf-order-bump-switch":y,onClick:function(e){p(!0);const t=e.target.getAttribute("data-ob_id"),a=new window.FormData;a.append("action","cartflows_pro_update_order_bump_status"),a.append("security",cartflows_admin.update_order_bump_status_nonce),a.append("ob_id",t),a.append("post_id",n),a.append("step_id",r),a.append("ob_status",!y),ye()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((()=>{c({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!y,ob_id:t}),w(!y),p(!1)}))},"data-ob_id":s.id}),d&&(0,e.createElement)("span",{className:"wcf-icon dashicons dashicons-update wcf-spinner is-active"}))),(0,e.createElement)("div",{className:"wcf-ob-header--breadcrums"},(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&path=flows`,className:"wcf-breadcrum--nav-item__link"},(0,le.__)("Flows","cartflows"))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&action=${cartflows_admin.flow_action}&flow_id=${n}`,className:"wcf-breadcrum--nav-item__link"},""===a?(0,le.__)("(no title)","cartflows"):De(a,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},(0,e.createElement)("a",{href:`admin.php?page=${cartflows_admin.home_slug}&action=${cartflows_admin.step_action}&flow_id=${n}&step_id=${r}&tab=order_bumps`,className:"wcf-breadcrum--nav-item__link"},""===i?(0,le.__)("(no title)","cartflows"):De(i,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item wcf-breadcrum--separator"}," ","/"," "),(0,e.createElement)("span",{className:"wcf-breadcrum--nav-item is-active"},""===v?(0,le.__)("(no title)","cartflows"):De(v,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))},rM=function(){return function(){const[{current_ob:e},n]=he(),r=function(t){const{name:r,value:a}=t.detail;if(r.includes("[")){const t=r.split("["),o=[];for(let e=1;e<t.length;e++)o.push(t[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=e[i];switch(o.length){case 2:s[o[0]][o[1]]=a;break;case 4:s[o[0]][o[1]][o[2]][o[3]]=a}n({type:"SET_OB_OPTION",name:i,value:s})}void 0!==e&&n({type:"SET_OB_OPTION",name:r,value:a})},a=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"textarea"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"image-selector"}];(0,t.useEffect)((()=>(e&&a.map((function(e){return document.addEventListener(`wcf:${e.type}:change`,r),""})),()=>{a.map((function(e){return document.removeEventListener(`wcf:${e.type}:change`,r),""}))})),[e])}(),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"editor-wrap__header"},(0,e.createElement)(nM,null)),(0,e.createElement)("div",{className:"editor-wrap__content"},(0,e.createElement)(Fb,null),(0,e.createElement)(tM,null)))},aM=function(){var t;const n=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search),r=n.get("flow_id"),a=n.get("step_id"),o=n.get("ob_id");return ob.flow_id=r,ob.step_id=a,(0,e.createElement)(me,{reducer:ib,initialState:ob},function(){let t="";return t=null!==o?(0,e.createElement)(rM,null):(0,e.createElement)(Qb,null),t}())},oM=function(){const[{step_id:n,flow_id:r,view_url:a,edit_builder_url:o,design_settings:i,page_builder:s,page_builder_name:c,options:l,title:u}]=he(),d=G(P);let p="";return(0,t.useEffect)((()=>{let e=!0;return()=>{e=!1}}),[]),"yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==s&&(p="disabled"),""===n?(0,e.createElement)(lb,null):(0,e.createElement)("div",{className:"wcf-design-page"},(0,e.createElement)("div",{className:"wcf-design-page__content"},(0,e.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},function(){let t=u;return""===u&&(t=(0,le.__)("(no title)","cartflows")),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-design-header__title--text"},t))}()),(0,e.createElement)("div",{className:"wcf-design-page__customize"},function(){if("yes"===cartflows_admin.is_any_required_plugins_missing&&"gutenberg"!==s)return(0,e.createElement)("p",{className:"wcf-design-page__text"},(0,le.__)("It seems that the page builder you selected is inactive. If you prefer another page builder tool, you can ","cartflows"),(0,e.createElement)("a",{href:`?page=${cartflows_admin.home_slug}&path=settings`,target:"_blank",rel:"noreferrer"},(0,le.__)("select it here.","cartflows")))}(),(0,e.createElement)("a",{className:`wcf-design-page__button--edit wcf-button wcf-button--primary ${p}`,href:o,target:"__blank"},(0,le.__)("Edit Design","cartflows")),(0,e.createElement)("a",{className:"wcf-design-page__button--preview wcf-button wcf-button--secondary",href:a,target:"__blank"},(0,le.__)("View Step","cartflows")),u&&(0,e.createElement)("div",{className:"wcf-change-step wcf-button wcf-button--secondary",onClick:function(){confirm((0,le.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"))&&d.push(`admin.php?page=cartflows&action=wcf-edit-store-step&step_id=${n}&flow_id=${r}&sub-tab=library`)}},(0,e.createElement)("span",{className:"wcf-create-step--text"},(0,le.__)("Change Template","cartflows")))),(0,e.createElement)("p",{className:"wcf-design-page__text"},function(){let e="";switch(c){case"Elementor":e=(0,le.__)("You are using a Elementor page builder, so all design options are available in the Elementor Widgets.","cartflows");break;case"Beaver Builder":e=(0,le.__)("You are using a Beaver Builder page builder, so all design options are available in the Beaver Builder Modules.","cartflows");break;case"Gutenberg":e=(0,le.__)("You are using a Gutenberg, so all design options are available in the Gutenberg Blocks.","cartflows");break;case"Divi":case"Other":e=(0,le.__)("","cartflows")}return e}()),(0,e.createElement)("a",{className:"wcf-design-page__WPeditor",href:Ne(n)},(0,le.__)("Go to WordPress Editor","cartflows"))),i&&(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)(cb,{settings_data:i,nav_enable_header:!0,nav_header_data:{nav_show_settings:"yes"===l["wcf-enable-design-settings"],nav_settings_title:(0,le.__)("Design Settings","cartflows"),nav_settings_field:{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:l["wcf-enable-design-settings"],label:(0,le.__)("Enable Design Settings","cartflows"),desc:(0,le.__)("If you are using shortcodes, enable this design settings.","cartflows")}}})))},iM=function(){const[{step_data:t,page_builder:n}]=he(),r={[t.type]:""};return(0,e.createElement)("div",{className:`wcf-step-library wcf-step-library-${n}`},(0,e.createElement)("div",{className:"wcf-step-library__header"},"other"!==n&&(0,e.createElement)("div",{className:"wcf-step-library__step-actions"},(0,e.createElement)("h3",null,(0,le.sprintf)(
17
  /* translators: %s is replaced with the step title */
18
+ (0,le.__)("Templates for %s","cartflows"),t.title)),(0,e.createElement)("div",{className:"wcf-tab-wrapper"},(0,e.createElement)("div",{className:"wcf-get-started-steps"})))),(0,e.createElement)("div",{className:"wcf-step-library__body"},(0,e.createElement)("div",{className:"wcf-remote-content"},"other"!==n&&t&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-ready-templates current"},(0,e.createElement)(Kv,{required_step_type:r,currentStepId:t.id})),(0,e.createElement)("div",{className:"wcf-start-from-scratch "},(0,e.createElement)(Fv,null))),"other"===n&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-start-from-scratch current"},(0,e.createElement)(Fv,null))))))},sM=function(){const t=new URLSearchParams(Z().search),n=t.get("tab"),r=t.get("sub-tab");return(0,e.createElement)(e.Fragment,null,function(){var t,a;let o=(0,e.createElement)("h1",null,"404 Not Found");if("library"===r)return(0,e.createElement)(iM,null);switch(n){case"design":default:o=(0,e.createElement)(oM,null);break;case"settings":o=(0,e.createElement)(pb,null);break;case"checkout_form_fields":o=(0,e.createElement)(Ab,null);break;case"checkout_products":o=(0,e.createElement)(Pb,null);break;case"order_bumps":o="no"===(null===(t=cartflows_admin)||void 0===t?void 0:t.is_order_bump_migrated)||"processing"===(null===(a=cartflows_admin)||void 0===a?void 0:a.is_order_bump_migrated)?(0,e.createElement)(Mb,null):(0,e.createElement)(_b,null);break;case"checkout_offer":o=(0,e.createElement)(Db,null);break;case"optin_form_fields":o=(0,e.createElement)(Lb,null);break;case"dynamic-offers":o=(0,e.createElement)(jb,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper"},o))}())},cM=function(){const[{step_id:n,step_data:r},a]=he(),[{unsavedChanges:o}]=s(),i=cartflows_admin.woocommerce_status;we(),(0,t.useEffect)((()=>{let e=!0;return(async()=>{ye()({path:`/cartflows/v1/admin/step-data/${n}`}).then((t=>{if(e){if(t.billing_fields){const e=Object.entries(t.billing_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.billing_fields=e}if(t.shipping_fields){const e=Object.entries(t.shipping_fields.fields).map((e=>{let[t,n]=e;return{...n,key:t}}));t.shipping_fields=e}a({type:"SET_STEP_DATA",data:t})}}))})(),()=>{e=!1}}),[]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Q,{when:o,message:"Are you sure you want to leave?"}),(0,e.createElement)("div",{className:"editor-wrap__header"},function(){if("active"!==i&&Object.keys(r).length>0&&"landing"!==r.type)return(0,e.createElement)("div",{className:"wcf-woo-notice"},(0,le.__)("This page requires WooCommerce plugin installed and activated!","cartflows"))}(),function(){if("active"===i&&r&&("upsell"===r.type||"downsell"===r.type)){var t,n;const r=null===(t=cartflows_admin)||void 0===t?void 0:t.supported_payment_gateways,a=null===(n=cartflows_admin)||void 0===n?void 0:n.available_payment_gateways;let o=[];if(r&&a&&(Object.keys(a).map((e=>{if(!r.hasOwnProperty(e)){const t=a[e];o.push(t.method_title)}return""})),o.length>0))return o=o.join(", "),(0,e.createElement)("div",{className:"wcf-payment-gateway-notice"},(0,e.createElement)("div",{className:"wcf-payment-gateway-notice-text"},(0,le.__)("CartFlows Upsell/Downsell offer does not support the ","cartflows"),(0,e.createElement)("span",{className:"wcf-gateway-notice-style"},o),(0,le.__)(" payment gateway. Please find the supported payment gateways ","cartflows"),(0,e.createElement)("a",{href:"https://cartflows.com/docs/supported-payment-gateways-by-cartflows/",target:"_blank",rel:"noreferrer"},(0,le.__)("here.","cartflows"))))}}(),(0,e.createElement)(Rb,{type:"storeCheckout",action:"wcf-store-checkout"})),(0,e.createElement)("div",{className:"editor-wrap__content"},(0,e.createElement)(sb,{action:"wcf-store-checkout",editAction:"wcf-edit-store-step"}),(0,e.createElement)(sM,null)))},lM=function(){var t;const n=new URLSearchParams(null===(t=Z())||void 0===t?void 0:t.search),r=n.get("flow_id"),a=n.get("step_id"),o=n.get("ob_id");return ob.flow_id=r,ob.step_id=a,(0,e.createElement)(me,{reducer:ib,initialState:ob},function(){let t="";return t=null!==o?(0,e.createElement)(rM,null):(0,e.createElement)(cM,null),t}())},uM=function(){return de.flow_id=cartflows_admin.global_checkout_id,(0,e.createElement)(e.Fragment,null,(0,e.createElement)(me,{reducer:pe,initialState:de},(0,e.createElement)(rb,{type:"storeCheckout"})))},dM=function(){const t=new URLSearchParams(Z().search).get("action");return(0,e.createElement)(e.Fragment,null,function(){let n="";switch(t){case"wcf-edit-flow":n=(0,e.createElement)(ab,null);break;case"wcf-store-checkout":n=(0,e.createElement)(uM,null);break;case"wcf-edit-step":n=(0,e.createElement)(aM,null);break;case"wcf-edit-store-step":n=(0,e.createElement)(lM,null);break;default:n=(0,e.createElement)("h1",null,"404 Not Found.")}return n}())};o().render((0,e.createElement)((n=>{let{reducer:r,initialState:a,children:o}=n;return(0,e.createElement)(i.Provider,{value:(0,t.useReducer)(r,a)},o)}),{initialState:{settingsProcess:!1,unsavedChanges:!1},reducer:(e,t)=>{switch(t.status){case"SAVED":return window.wcfUnsavedChanges=!1,{...e,settingsProcess:"saved"};case"PROCESSING":return{...e,settingsProcess:"processing"};case"RESET":return{...e,settingsProcess:!1};case"UNSAVED_CHANGES":return"change"===t.trigger?{...e,unsavedChanges:!0}:{...e,unsavedChanges:!1};default:return e}}},(0,e.createElement)((function(){return(0,e.createElement)(W,null,(0,e.createElement)(ue,null),(0,e.createElement)("div",{className:"editor-wrap"},(0,e.createElement)(H,null,(0,e.createElement)(V,{path:"/"},(0,e.createElement)(dM,null)))))}),null)),document.getElementById("wcf-editor-app"))}()}();
cartflows.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
- * Version: 1.10.1
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
+ * Version: 1.10.2
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows
changelog.txt CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  Version 1.10.1 - Thursday, 7th July 2022
2
  - Fix: CartFlows Setup dashboard widget was not getting hidden if hidden from the screen option.
3
  - Fix: Fixed console error on store checkout tab.
1
+ Version 1.10.2 - Thursday, 21st July 2022
2
+ - Improvement: Added filter `cartflows_show_store_checkout_product_tab` to show the product tab for store checkout.
3
+
4
  Version 1.10.1 - Thursday, 7th July 2022
5
  - Fix: CartFlows Setup dashboard widget was not getting hidden if hidden from the screen option.
6
  - Fix: Fixed console error on store checkout tab.
classes/class-cartflows-default-meta.php CHANGED
@@ -308,7 +308,7 @@ class Cartflows_Default_Meta {
308
  'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_FIELDS',
309
  ),
310
  'wcf-google-autoaddress' => array(
311
- 'default' => 'no',
312
  'sanitize' => 'FILTER_SANITIZE_STRING',
313
  ),
314
 
308
  'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_FIELDS',
309
  ),
310
  'wcf-google-autoaddress' => array(
311
+ 'default' => 'yes',
312
  'sanitize' => 'FILTER_SANITIZE_STRING',
313
  ),
314
 
classes/class-cartflows-loader.php CHANGED
@@ -140,7 +140,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
140
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
141
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
142
 
143
- define( 'CARTFLOWS_VER', '1.10.1' );
144
  define( 'CARTFLOWS_SLUG', 'cartflows' );
145
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
146
  define( 'CARTFLOWS_NAME', 'CartFlows' );
140
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
141
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
142
 
143
+ define( 'CARTFLOWS_VER', '1.10.2' );
144
  define( 'CARTFLOWS_SLUG', 'cartflows' );
145
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
146
  define( 'CARTFLOWS_NAME', 'CartFlows' );
languages/cartflows.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the CartFlows plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: CartFlows 1.10.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-07-07T07:19:49+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: cartflows\n"
@@ -458,9 +458,9 @@ msgstr ""
458
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:165
459
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:194
460
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:96
461
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:352
462
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1323
463
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1340
464
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:181
465
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:143
466
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:189
@@ -546,7 +546,7 @@ msgstr ""
546
  #: admin-core/inc/admin-menu.php:276
547
  #: admin-core/inc/admin-menu.php:277
548
  #: classes/class-cartflows-admin.php:199
549
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:168
550
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:58
551
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:299
552
  #: modules/thankyou/classes/class-cartflows-thankyou-meta-data.php:58
@@ -666,8 +666,8 @@ msgstr ""
666
 
667
  #: admin-core/inc/flow-meta.php:107
668
  #: admin-core/inc/flow-meta.php:112
669
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1059
670
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1066
671
  #: modules/flow/classes/class-cartflows-step-meta-base.php:80
672
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:128
673
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:135
@@ -763,7 +763,7 @@ msgid "Flow and Step Slug"
763
  msgstr ""
764
 
765
  #: admin-core/inc/global-settings.php:141
766
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:972
767
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:114
768
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:662
769
  #: modules/thankyou/classes/class-cartflows-thankyou-meta-data.php:222
@@ -1133,7 +1133,7 @@ msgid "Docs"
1133
  msgstr ""
1134
 
1135
  #: classes/class-cartflows-default-meta.php:162
1136
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1001
1137
  msgid "Place Order"
1138
  msgstr ""
1139
 
@@ -1289,7 +1289,7 @@ msgstr ""
1289
 
1290
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:137
1291
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:145
1292
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:232
1293
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:153
1294
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:161
1295
  #: modules/gutenberg/dist/blocks.build.js:1
@@ -1298,7 +1298,7 @@ msgstr ""
1298
 
1299
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:138
1300
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:146
1301
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:236
1302
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:154
1303
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:162
1304
  #: modules/gutenberg/dist/blocks.build.js:1
@@ -1307,7 +1307,7 @@ msgstr ""
1307
 
1308
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:139
1309
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:147
1310
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:240
1311
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:155
1312
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:163
1313
  #: modules/gutenberg/dist/blocks.build.js:1
@@ -1316,7 +1316,7 @@ msgstr ""
1316
 
1317
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:140
1318
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:148
1319
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:244
1320
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:156
1321
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:164
1322
  #: modules/gutenberg/dist/blocks.build.js:1
@@ -1329,14 +1329,14 @@ msgid "Two Step ( PRO )"
1329
  msgstr ""
1330
 
1331
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:149
1332
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:248
1333
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:165
1334
  #: modules/gutenberg/dist/blocks.build.js:1
1335
  msgid "Two Step"
1336
  msgstr ""
1337
 
1338
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:166
1339
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:356
1340
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:182
1341
  #: modules/gutenberg/dist/blocks.build.js:1
1342
  msgid "Modern Labels"
@@ -1345,7 +1345,7 @@ msgstr ""
1345
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:181
1346
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:132
1347
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:94
1348
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:965
1349
  #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:157
1350
  #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:291
1351
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:160
@@ -1375,7 +1375,7 @@ msgstr ""
1375
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:112
1376
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:141
1377
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:150
1378
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:346
1379
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:469
1380
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:207
1381
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:399
@@ -1392,7 +1392,7 @@ msgstr ""
1392
 
1393
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:209
1394
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:119
1395
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:257
1396
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:298
1397
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:168
1398
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:381
@@ -1415,7 +1415,7 @@ msgstr ""
1415
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:365
1416
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:431
1417
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:497
1418
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:637
1419
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:382
1420
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:663
1421
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:763
@@ -1457,7 +1457,7 @@ msgstr ""
1457
 
1458
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:241
1459
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:193
1460
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:283
1461
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:414
1462
  #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:288
1463
  #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:507
@@ -1470,7 +1470,7 @@ msgstr ""
1470
 
1471
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:271
1472
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:137
1473
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:332
1474
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:461
1475
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:199
1476
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:394
@@ -1479,7 +1479,7 @@ msgstr ""
1479
 
1480
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:285
1481
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:147
1482
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:507
1483
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:497
1484
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:957
1485
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:226
@@ -1576,8 +1576,8 @@ msgstr ""
1576
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:838
1577
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:245
1578
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:393
1579
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:492
1580
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:697
1581
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:584
1582
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1024
1583
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:290
@@ -1598,7 +1598,7 @@ msgstr ""
1598
 
1599
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:435
1600
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:274
1601
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:523
1602
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:628
1603
  msgid "Buttons"
1604
  msgstr ""
@@ -1606,7 +1606,7 @@ msgstr ""
1606
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:463
1607
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:411
1608
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:292
1609
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:652
1610
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:591
1611
  #: modules/gutenberg/dist/blocks.build.js:1
1612
  msgid "Text Hover Color"
@@ -1622,8 +1622,8 @@ msgstr ""
1622
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:379
1623
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:445
1624
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:511
1625
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:477
1626
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:667
1627
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:684
1628
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:802
1629
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1011
@@ -1645,7 +1645,7 @@ msgstr ""
1645
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:507
1646
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:433
1647
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:320
1648
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:682
1649
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:603
1650
  msgid "Background Hover Color"
1651
  msgstr ""
@@ -1653,7 +1653,7 @@ msgstr ""
1653
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:624
1654
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:331
1655
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:407
1656
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:712
1657
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:782
1658
  #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:448
1659
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:421
@@ -1895,8 +1895,8 @@ msgid "Full Width"
1895
  msgstr ""
1896
 
1897
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:268
1898
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:417
1899
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:582
1900
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:453
1901
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:547
1902
  msgid "Custom"
@@ -2114,7 +2114,7 @@ msgstr ""
2114
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:342
2115
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:407
2116
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:473
2117
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:297
2118
  msgid "Heading Color"
2119
  msgstr ""
2120
 
@@ -2309,47 +2309,47 @@ msgstr ""
2309
  msgid "Hide Order Summary"
2310
  msgstr ""
2311
 
2312
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:140
2313
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:285
2314
  msgid "Products"
2315
  msgstr ""
2316
 
2317
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:147
2318
  msgid "Order Bumps"
2319
  msgstr ""
2320
 
2321
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:154
2322
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:292
2323
  #: admin-core/assets/build/editor-app.js:16
2324
  msgid "Form Fields"
2325
  msgstr ""
2326
 
2327
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:161
2328
  msgid "Dynamic Offers"
2329
  msgstr ""
2330
 
2331
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:179
2332
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:794
2333
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:898
2334
  msgid "Checkout Offer"
2335
  msgstr ""
2336
 
2337
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:213
2338
  msgid "Two Step (Available in CartFlows Pro) "
2339
  msgstr ""
2340
 
2341
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:220
2342
  msgid "Checkout Design"
2343
  msgstr ""
2344
 
2345
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:226
2346
  msgid "Checkout Skin"
2347
  msgstr ""
2348
 
2349
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:262
2350
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:313
2351
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:372
2352
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:537
2353
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:387
2354
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:417
2355
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:510
@@ -2359,102 +2359,102 @@ msgstr ""
2359
  msgid "Font Family"
2360
  msgstr ""
2361
 
2362
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:270
2363
  msgid "Checkout Texts & Buttons"
2364
  msgstr ""
2365
 
2366
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:276
2367
  msgid "Enable Advance Options"
2368
  msgstr ""
2369
 
2370
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:391
2371
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:556
2372
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:427
2373
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:521
2374
  #: modules/gutenberg/dist/blocks.build.js:1
2375
  msgid "Size"
2376
  msgstr ""
2377
 
2378
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:397
2379
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:562
2380
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:433
2381
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:527
2382
  msgid "Extra Small"
2383
  msgstr ""
2384
 
2385
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:401
2386
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:566
2387
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:437
2388
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:531
2389
  msgid "Small"
2390
  msgstr ""
2391
 
2392
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:405
2393
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:570
2394
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:441
2395
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:535
2396
  msgid "Medium"
2397
  msgstr ""
2398
 
2399
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:409
2400
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:574
2401
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:445
2402
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:539
2403
  msgid "Large"
2404
  msgstr ""
2405
 
2406
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:413
2407
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:578
2408
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:449
2409
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:543
2410
  msgid "Extra Large"
2411
  msgstr ""
2412
 
2413
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:432
2414
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:597
2415
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:459
2416
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:553
2417
  msgid "Top Bottom Spacing"
2418
  msgstr ""
2419
 
2420
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:447
2421
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:617
2422
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:465
2423
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:559
2424
  msgid "Left Right Spacing"
2425
  msgstr ""
2426
 
2427
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:462
2428
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:477
2429
  msgid "Text / Placeholder Color"
2430
  msgstr ""
2431
 
2432
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:728
2433
  #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:354
2434
  #: modules/gutenberg/dist/blocks.build.js:1
2435
  msgid "Sections"
2436
  msgstr ""
2437
 
2438
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:742
2439
  msgid "Highlight Area Background Color"
2440
  msgstr ""
2441
 
2442
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:760
2443
  msgid "Two-Step Design"
2444
  msgstr ""
2445
 
2446
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:782
2447
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:883
2448
  #: admin-core/assets/build/editor-app.js:16
2449
  msgid "Product Options"
2450
  msgstr ""
2451
 
2452
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:814
2453
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:918
2454
  msgid "Order Bump"
2455
  msgstr ""
2456
 
2457
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:844
2458
  #: modules/checkout/templates/checkout/order-review-table.php:16
2459
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:335
2460
  #: admin-core/assets/build/editor-app.js:3
@@ -2462,198 +2462,198 @@ msgstr ""
2462
  msgid "Product"
2463
  msgstr ""
2464
 
2465
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:852
2466
  msgid "Select Product"
2467
  msgstr ""
2468
 
2469
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:853
2470
  msgid "Search for a product..."
2471
  msgstr ""
2472
 
2473
  #. translators: %1$1s: link html start, %2$12: link html end
2474
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:863
2475
  msgid "For more information about the checkout product settings please %1$1s Click here.%2$2s"
2476
  msgstr ""
2477
 
2478
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:869
2479
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:874
2480
  msgid "Coupon"
2481
  msgstr ""
2482
 
2483
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:950
2484
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:640
2485
  msgid "Shortcodes"
2486
  msgstr ""
2487
 
2488
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:957
2489
  msgid "CartFlows Checkout"
2490
  msgstr ""
2491
 
2492
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:959
2493
  msgid "Add this shortcode to your checkout page"
2494
  msgstr ""
2495
 
2496
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:978
2497
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:120
2498
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:668
2499
  #: modules/thankyou/classes/class-cartflows-thankyou-meta-data.php:228
2500
  msgid "Step Note"
2501
  msgstr ""
2502
 
2503
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:988
2504
  msgid "Checkout Settings"
2505
  msgstr ""
2506
 
2507
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:994
2508
  msgid "Place Order Button"
2509
  msgstr ""
2510
 
2511
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:998
2512
  msgid "Place Order Button Text"
2513
  msgstr ""
2514
 
2515
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1002
2516
  msgid "It will change the Place Order Button text on checkout page."
2517
  msgstr ""
2518
 
2519
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1007
2520
  msgid "Enable Lock Icon"
2521
  msgstr ""
2522
 
2523
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1010
2524
  msgid "This will show the lock icon on the place order button on checkout page."
2525
  msgstr ""
2526
 
2527
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1015
2528
  msgid "Enable Price Display"
2529
  msgstr ""
2530
 
2531
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1018
2532
  msgid "This will show the cart total from the place order button."
2533
  msgstr ""
2534
 
2535
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1023
2536
  msgid "Others"
2537
  msgstr ""
2538
 
2539
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1028
2540
  msgid "Display product images"
2541
  msgstr ""
2542
 
2543
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1031
2544
  msgid "Enabling this option will display the product's images in the order review section."
2545
  msgstr ""
2546
 
2547
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1036
2548
  msgid "Enable cart editing on checkout"
2549
  msgstr ""
2550
 
2551
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1039
2552
  msgid "Users will able to remove products from the checkout page."
2553
  msgstr ""
2554
 
2555
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1044
2556
  msgid "Enable Google Address Autocomplete"
2557
  msgstr ""
2558
 
2559
  #. translators: %1$s: link html start, %2$s: link html end
2560
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1047
2561
  msgid "Before enabling this option, make sure that you have added API key in %1$1sGoogle Address Autocomplete Settings.%1$1s"
2562
  msgstr ""
2563
 
2564
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1153
2565
  msgid "Enable Coupon Field"
2566
  msgstr ""
2567
 
2568
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1158
2569
  msgid "Collapsible Coupon Field"
2570
  msgstr ""
2571
 
2572
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1173
2573
  msgid "Enable Additional Field"
2574
  msgstr ""
2575
 
2576
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1178
2577
  msgid "Collapsible Additional Field"
2578
  msgstr ""
2579
 
2580
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1193
2581
  msgid "Enable Ship To Different Address"
2582
  msgstr ""
2583
 
2584
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1198
2585
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:76
2586
  msgid "Enable Custom Field Editor"
2587
  msgstr ""
2588
 
2589
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1288
2590
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:154
2591
  msgid "Enable Field"
2592
  msgstr ""
2593
 
2594
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1294
2595
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:160
2596
  msgid "Field Width"
2597
  msgstr ""
2598
 
2599
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1300
2600
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:166
2601
  #: admin-core/assets/build/editor-app.js:16
2602
  msgid "33%"
2603
  msgstr ""
2604
 
2605
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1304
2606
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:170
2607
  #: admin-core/assets/build/editor-app.js:16
2608
  msgid "50%"
2609
  msgstr ""
2610
 
2611
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1308
2612
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:174
2613
  #: admin-core/assets/build/editor-app.js:16
2614
  msgid "100%"
2615
  msgstr ""
2616
 
2617
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1315
2618
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:181
2619
  msgid "Field Label"
2620
  msgstr ""
2621
 
2622
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1329
2623
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:195
2624
  #: admin-core/assets/build/editor-app.js:16
2625
  msgid "Checked"
2626
  msgstr ""
2627
 
2628
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1333
2629
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:199
2630
  msgid "Un-Checked"
2631
  msgstr ""
2632
 
2633
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1350
2634
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:216
2635
  #: admin-core/assets/build/editor-app.js:16
2636
  msgid "Options"
2637
  msgstr ""
2638
 
2639
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1359
2640
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:225
2641
  #: admin-core/assets/build/editor-app.js:16
2642
  msgid "Placeholder"
2643
  msgstr ""
2644
 
2645
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1367
2646
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:233
2647
  #: admin-core/assets/build/editor-app.js:16
2648
  msgid "Required"
2649
  msgstr ""
2650
 
2651
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1374
2652
  #: admin-core/assets/build/editor-app.js:16
2653
  msgid "Collapsible"
2654
  msgstr ""
2655
 
2656
- #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1484
2657
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:805
2658
  #: admin-core/assets/build/editor-app.js:16
2659
  msgid "Remove"
2
  # This file is distributed under the same license as the CartFlows plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: CartFlows 1.10.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-07-21T10:10:24+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: cartflows\n"
458
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:165
459
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:194
460
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:96
461
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:353
462
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1324
463
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1341
464
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:181
465
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:143
466
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:189
546
  #: admin-core/inc/admin-menu.php:276
547
  #: admin-core/inc/admin-menu.php:277
548
  #: classes/class-cartflows-admin.php:199
549
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:169
550
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:58
551
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:299
552
  #: modules/thankyou/classes/class-cartflows-thankyou-meta-data.php:58
666
 
667
  #: admin-core/inc/flow-meta.php:107
668
  #: admin-core/inc/flow-meta.php:112
669
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1060
670
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1067
671
  #: modules/flow/classes/class-cartflows-step-meta-base.php:80
672
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:128
673
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:135
763
  msgstr ""
764
 
765
  #: admin-core/inc/global-settings.php:141
766
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:973
767
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:114
768
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:662
769
  #: modules/thankyou/classes/class-cartflows-thankyou-meta-data.php:222
1133
  msgstr ""
1134
 
1135
  #: classes/class-cartflows-default-meta.php:162
1136
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1002
1137
  msgid "Place Order"
1138
  msgstr ""
1139
 
1289
 
1290
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:137
1291
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:145
1292
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:233
1293
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:153
1294
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:161
1295
  #: modules/gutenberg/dist/blocks.build.js:1
1298
 
1299
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:138
1300
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:146
1301
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:237
1302
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:154
1303
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:162
1304
  #: modules/gutenberg/dist/blocks.build.js:1
1307
 
1308
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:139
1309
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:147
1310
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:241
1311
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:155
1312
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:163
1313
  #: modules/gutenberg/dist/blocks.build.js:1
1316
 
1317
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:140
1318
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:148
1319
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:245
1320
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:156
1321
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:164
1322
  #: modules/gutenberg/dist/blocks.build.js:1
1329
  msgstr ""
1330
 
1331
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:149
1332
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:249
1333
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:165
1334
  #: modules/gutenberg/dist/blocks.build.js:1
1335
  msgid "Two Step"
1336
  msgstr ""
1337
 
1338
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:166
1339
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:357
1340
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:182
1341
  #: modules/gutenberg/dist/blocks.build.js:1
1342
  msgid "Modern Labels"
1345
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:181
1346
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:132
1347
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:94
1348
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:966
1349
  #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:157
1350
  #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:291
1351
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:160
1375
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:112
1376
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:141
1377
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:150
1378
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:347
1379
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:469
1380
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:207
1381
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:399
1392
 
1393
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:209
1394
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:119
1395
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:258
1396
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:298
1397
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:168
1398
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:381
1415
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:365
1416
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:431
1417
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:497
1418
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:638
1419
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:382
1420
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:663
1421
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:763
1457
 
1458
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:241
1459
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:193
1460
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:284
1461
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:414
1462
  #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:288
1463
  #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:507
1470
 
1471
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:271
1472
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:137
1473
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:333
1474
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:461
1475
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:199
1476
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:394
1479
 
1480
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:285
1481
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:147
1482
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:508
1483
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:497
1484
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:957
1485
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:226
1576
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:838
1577
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:245
1578
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:393
1579
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:493
1580
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:698
1581
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:584
1582
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1024
1583
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:290
1598
 
1599
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:435
1600
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:274
1601
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:524
1602
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:628
1603
  msgid "Buttons"
1604
  msgstr ""
1606
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:463
1607
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:411
1608
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:292
1609
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:653
1610
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:591
1611
  #: modules/gutenberg/dist/blocks.build.js:1
1612
  msgid "Text Hover Color"
1622
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:379
1623
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:445
1624
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:511
1625
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:478
1626
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:668
1627
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:684
1628
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:802
1629
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1011
1645
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:507
1646
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:433
1647
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:320
1648
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:683
1649
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:603
1650
  msgid "Background Hover Color"
1651
  msgstr ""
1653
  #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:624
1654
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:331
1655
  #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:407
1656
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:713
1657
  #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:782
1658
  #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:448
1659
  #: modules/elementor/widgets/class-cartflows-el-optin-form.php:421
1895
  msgstr ""
1896
 
1897
  #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:268
1898
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:418
1899
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:583
1900
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:453
1901
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:547
1902
  msgid "Custom"
2114
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:342
2115
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:407
2116
  #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:473
2117
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:298
2118
  msgid "Heading Color"
2119
  msgstr ""
2120
 
2309
  msgid "Hide Order Summary"
2310
  msgstr ""
2311
 
2312
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:141
2313
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:285
2314
  msgid "Products"
2315
  msgstr ""
2316
 
2317
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:148
2318
  msgid "Order Bumps"
2319
  msgstr ""
2320
 
2321
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:155
2322
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:292
2323
  #: admin-core/assets/build/editor-app.js:16
2324
  msgid "Form Fields"
2325
  msgstr ""
2326
 
2327
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:162
2328
  msgid "Dynamic Offers"
2329
  msgstr ""
2330
 
2331
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:180
2332
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:795
2333
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:899
2334
  msgid "Checkout Offer"
2335
  msgstr ""
2336
 
2337
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:214
2338
  msgid "Two Step (Available in CartFlows Pro) "
2339
  msgstr ""
2340
 
2341
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:221
2342
  msgid "Checkout Design"
2343
  msgstr ""
2344
 
2345
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:227
2346
  msgid "Checkout Skin"
2347
  msgstr ""
2348
 
2349
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:263
2350
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:314
2351
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:373
2352
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:538
2353
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:387
2354
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:417
2355
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:510
2359
  msgid "Font Family"
2360
  msgstr ""
2361
 
2362
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:271
2363
  msgid "Checkout Texts & Buttons"
2364
  msgstr ""
2365
 
2366
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:277
2367
  msgid "Enable Advance Options"
2368
  msgstr ""
2369
 
2370
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:392
2371
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:557
2372
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:427
2373
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:521
2374
  #: modules/gutenberg/dist/blocks.build.js:1
2375
  msgid "Size"
2376
  msgstr ""
2377
 
2378
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:398
2379
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:563
2380
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:433
2381
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:527
2382
  msgid "Extra Small"
2383
  msgstr ""
2384
 
2385
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:402
2386
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:567
2387
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:437
2388
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:531
2389
  msgid "Small"
2390
  msgstr ""
2391
 
2392
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:406
2393
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:571
2394
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:441
2395
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:535
2396
  msgid "Medium"
2397
  msgstr ""
2398
 
2399
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:410
2400
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:575
2401
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:445
2402
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:539
2403
  msgid "Large"
2404
  msgstr ""
2405
 
2406
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:414
2407
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:579
2408
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:449
2409
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:543
2410
  msgid "Extra Large"
2411
  msgstr ""
2412
 
2413
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:433
2414
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:598
2415
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:459
2416
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:553
2417
  msgid "Top Bottom Spacing"
2418
  msgstr ""
2419
 
2420
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:448
2421
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:618
2422
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:465
2423
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:559
2424
  msgid "Left Right Spacing"
2425
  msgstr ""
2426
 
2427
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:463
2428
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:477
2429
  msgid "Text / Placeholder Color"
2430
  msgstr ""
2431
 
2432
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:729
2433
  #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:354
2434
  #: modules/gutenberg/dist/blocks.build.js:1
2435
  msgid "Sections"
2436
  msgstr ""
2437
 
2438
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:743
2439
  msgid "Highlight Area Background Color"
2440
  msgstr ""
2441
 
2442
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:761
2443
  msgid "Two-Step Design"
2444
  msgstr ""
2445
 
2446
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:783
2447
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:884
2448
  #: admin-core/assets/build/editor-app.js:16
2449
  msgid "Product Options"
2450
  msgstr ""
2451
 
2452
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:815
2453
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:919
2454
  msgid "Order Bump"
2455
  msgstr ""
2456
 
2457
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:845
2458
  #: modules/checkout/templates/checkout/order-review-table.php:16
2459
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:335
2460
  #: admin-core/assets/build/editor-app.js:3
2462
  msgid "Product"
2463
  msgstr ""
2464
 
2465
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:853
2466
  msgid "Select Product"
2467
  msgstr ""
2468
 
2469
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:854
2470
  msgid "Search for a product..."
2471
  msgstr ""
2472
 
2473
  #. translators: %1$1s: link html start, %2$12: link html end
2474
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:864
2475
  msgid "For more information about the checkout product settings please %1$1s Click here.%2$2s"
2476
  msgstr ""
2477
 
2478
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:870
2479
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:875
2480
  msgid "Coupon"
2481
  msgstr ""
2482
 
2483
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:951
2484
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:640
2485
  msgid "Shortcodes"
2486
  msgstr ""
2487
 
2488
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:958
2489
  msgid "CartFlows Checkout"
2490
  msgstr ""
2491
 
2492
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:960
2493
  msgid "Add this shortcode to your checkout page"
2494
  msgstr ""
2495
 
2496
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:979
2497
  #: modules/landing/classes/class-cartflows-landing-meta-data.php:120
2498
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:668
2499
  #: modules/thankyou/classes/class-cartflows-thankyou-meta-data.php:228
2500
  msgid "Step Note"
2501
  msgstr ""
2502
 
2503
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:989
2504
  msgid "Checkout Settings"
2505
  msgstr ""
2506
 
2507
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:995
2508
  msgid "Place Order Button"
2509
  msgstr ""
2510
 
2511
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:999
2512
  msgid "Place Order Button Text"
2513
  msgstr ""
2514
 
2515
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1003
2516
  msgid "It will change the Place Order Button text on checkout page."
2517
  msgstr ""
2518
 
2519
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1008
2520
  msgid "Enable Lock Icon"
2521
  msgstr ""
2522
 
2523
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1011
2524
  msgid "This will show the lock icon on the place order button on checkout page."
2525
  msgstr ""
2526
 
2527
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1016
2528
  msgid "Enable Price Display"
2529
  msgstr ""
2530
 
2531
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1019
2532
  msgid "This will show the cart total from the place order button."
2533
  msgstr ""
2534
 
2535
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1024
2536
  msgid "Others"
2537
  msgstr ""
2538
 
2539
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1029
2540
  msgid "Display product images"
2541
  msgstr ""
2542
 
2543
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1032
2544
  msgid "Enabling this option will display the product's images in the order review section."
2545
  msgstr ""
2546
 
2547
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1037
2548
  msgid "Enable cart editing on checkout"
2549
  msgstr ""
2550
 
2551
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1040
2552
  msgid "Users will able to remove products from the checkout page."
2553
  msgstr ""
2554
 
2555
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1045
2556
  msgid "Enable Google Address Autocomplete"
2557
  msgstr ""
2558
 
2559
  #. translators: %1$s: link html start, %2$s: link html end
2560
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1048
2561
  msgid "Before enabling this option, make sure that you have added API key in %1$1sGoogle Address Autocomplete Settings.%1$1s"
2562
  msgstr ""
2563
 
2564
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1154
2565
  msgid "Enable Coupon Field"
2566
  msgstr ""
2567
 
2568
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1159
2569
  msgid "Collapsible Coupon Field"
2570
  msgstr ""
2571
 
2572
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1174
2573
  msgid "Enable Additional Field"
2574
  msgstr ""
2575
 
2576
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1179
2577
  msgid "Collapsible Additional Field"
2578
  msgstr ""
2579
 
2580
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1194
2581
  msgid "Enable Ship To Different Address"
2582
  msgstr ""
2583
 
2584
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1199
2585
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:76
2586
  msgid "Enable Custom Field Editor"
2587
  msgstr ""
2588
 
2589
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1289
2590
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:154
2591
  msgid "Enable Field"
2592
  msgstr ""
2593
 
2594
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1295
2595
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:160
2596
  msgid "Field Width"
2597
  msgstr ""
2598
 
2599
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1301
2600
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:166
2601
  #: admin-core/assets/build/editor-app.js:16
2602
  msgid "33%"
2603
  msgstr ""
2604
 
2605
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1305
2606
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:170
2607
  #: admin-core/assets/build/editor-app.js:16
2608
  msgid "50%"
2609
  msgstr ""
2610
 
2611
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1309
2612
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:174
2613
  #: admin-core/assets/build/editor-app.js:16
2614
  msgid "100%"
2615
  msgstr ""
2616
 
2617
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1316
2618
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:181
2619
  msgid "Field Label"
2620
  msgstr ""
2621
 
2622
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1330
2623
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:195
2624
  #: admin-core/assets/build/editor-app.js:16
2625
  msgid "Checked"
2626
  msgstr ""
2627
 
2628
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1334
2629
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:199
2630
  msgid "Un-Checked"
2631
  msgstr ""
2632
 
2633
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1351
2634
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:216
2635
  #: admin-core/assets/build/editor-app.js:16
2636
  msgid "Options"
2637
  msgstr ""
2638
 
2639
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1360
2640
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:225
2641
  #: admin-core/assets/build/editor-app.js:16
2642
  msgid "Placeholder"
2643
  msgstr ""
2644
 
2645
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1368
2646
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:233
2647
  #: admin-core/assets/build/editor-app.js:16
2648
  msgid "Required"
2649
  msgstr ""
2650
 
2651
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1375
2652
  #: admin-core/assets/build/editor-app.js:16
2653
  msgid "Collapsible"
2654
  msgstr ""
2655
 
2656
+ #: modules/checkout/classes/class-cartflows-checkout-meta-data.php:1485
2657
  #: modules/optin/classes/class-cartflows-optin-meta-data.php:805
2658
  #: admin-core/assets/build/editor-app.js:16
2659
  msgid "Remove"
modules/checkout/classes/class-cartflows-checkout-meta-data.php CHANGED
@@ -74,10 +74,11 @@ class Cartflows_Checkout_Meta_Data extends Cartflows_Step_Meta_Base {
74
  */
75
  public function remove_store_checkout_product( $settings, $step_id ) {
76
  $flow_id = absint( get_post_meta( $step_id, 'wcf-flow-id', true ) );
77
- if ( absint( \Cartflows_Helper::get_global_setting( '_cartflows_store_checkout' ) ) !== $flow_id ) {
78
- return $settings;
 
79
  }
80
- unset( $settings['tabs']['checkout_products'] );
81
  return $settings;
82
  }
83
 
74
  */
75
  public function remove_store_checkout_product( $settings, $step_id ) {
76
  $flow_id = absint( get_post_meta( $step_id, 'wcf-flow-id', true ) );
77
+
78
+ if ( absint( \Cartflows_Helper::get_global_setting( '_cartflows_store_checkout' ) ) === $flow_id && ! apply_filters( 'cartflows_show_store_checkout_product_tab', false ) ) {
79
+ unset( $settings['tabs']['checkout_products'] );
80
  }
81
+
82
  return $settings;
83
  }
84
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sujaypawar, wpcrafter
3
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
4
  Requires at least: 5.4
5
  Tested up to: 6.0
6
- Stable tag: 1.10.1
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -322,6 +322,9 @@ This includes, but is not limited to:
322
 
323
  == Changelog ==
324
 
 
 
 
325
  = Version 1.10.1 - Thursday, 7th July 2022 =
326
  * Fix: CartFlows Setup dashboard widget was not getting hidden if hidden from the screen option.
327
  * Fix: Fixed console error on store checkout tab.
3
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
4
  Requires at least: 5.4
5
  Tested up to: 6.0
6
+ Stable tag: 1.10.2
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
322
 
323
  == Changelog ==
324
 
325
+ = Version 1.10.2 - Thursday, 21st July 2022 =
326
+ * Improvement: Added filter `cartflows_show_store_checkout_product_tab` to show the product tab for store checkout.
327
+
328
  = Version 1.10.1 - Thursday, 7th July 2022 =
329
  * Fix: CartFlows Setup dashboard widget was not getting hidden if hidden from the screen option.
330
  * Fix: Fixed console error on store checkout tab.