Files
szkoleniauryzaj.pl/wp-content/plugins/woocommerce/assets/client/admin/chunks/shipping-recommendations.js
2024-11-10 21:08:49 +01:00

1 line
9.6 KiB
JavaScript

(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[6125],{22309:(e,t,c)=>{"use strict";c.r(t),c.d(t,{default:()=>S});var o=c(69307),i=c(9818),n=c(67221),s=c(50977),m=c(65736),r=c(55609),l=c(86020),a=c(10431),u=c(14599),M=c(40610),L=c.n(M),N=c(97489);const j=e=>{let{isWCSInstalled:t}=e;const c=(0,o.useContext)(N.VY),i=(0,o.useMemo)((()=>c.getExtendedContext("wc-settings")),[c]);return(0,o.createElement)("div",{className:"woocommerce-list__item-inner woocommerce-services-item"},(0,o.createElement)("div",{className:"woocommerce-list__item-before"},(0,o.createElement)("img",{className:"woocommerce-services-item__logo",src:L(),alt:"WooCommerce Service Logo"})),(0,o.createElement)("div",{className:"woocommerce-list__item-text"},(0,o.createElement)("span",{className:"woocommerce-list__item-title"},(0,m.__)("WooCommerce Shipping","woocommerce"),(0,o.createElement)(l.Pill,null,(0,m.__)("Recommended","woocommerce"))),(0,o.createElement)("span",{className:"woocommerce-list__item-content"},(0,m.__)("Print USPS and DHL Express labels straight from your WooCommerce dashboard and save on shipping.","woocommerce"),(0,o.createElement)("br",null),(0,o.createElement)(r.ExternalLink,{href:"https://woocommerce.com/woocommerce-shipping/"},(0,m.__)("Learn more","woocommerce")))),(0,o.createElement)("div",{className:"woocommerce-list__item-after"},(0,o.createElement)(r.Button,{isSecondary:!0,onClick:()=>{(0,u.recordEvent)("tasklist_click",{task_name:"shipping-recommendation",context:i.toString()}),(0,a.navigateTo)({url:(0,a.getNewPath)({task:"shipping-recommendation"},"/",{})})}},t?(0,m.__)("Activate","woocommerce"):(0,m.__)("Get started","woocommerce"))))};var g=c(14805);const S=()=>{const{activePlugins:e,installedPlugins:t,countryCode:c,isJetpackConnected:m,isSellingDigitalProductsOnly:r}=(0,i.useSelect)((e=>{var t;const c=e(n.SETTINGS_STORE_NAME).getSettings("general"),{getActivePlugins:o,getInstalledPlugins:i,isJetpackConnected:m}=e(n.PLUGINS_STORE_NAME),r=e(n.ONBOARDING_STORE_NAME).getProfileItems().product_types;return{activePlugins:o(),installedPlugins:i(),countryCode:(0,s.so)(null===(t=c.general)||void 0===t?void 0:t.woocommerce_default_country),isJetpackConnected:m(),isSellingDigitalProductsOnly:1===(null==r?void 0:r.length)&&"downloads"===r[0]}}));return e.includes("woocommerce-services")&&m||"US"!==c||r?null:(0,o.createElement)(g.ShippingRecommendationsList,null,(0,o.createElement)(j,{isWCSInstalled:t.includes("woocommerce-services")}))}},14805:(e,t,c)=>{"use strict";c.r(t),c.d(t,{ShippingRecommendationsList:()=>d,default:()=>I});var o=c(69307),i=c(65736),n=c(9818),s=c(14812),m=c(67221),r=c(72672),l=c(55609),a=c(37942),u=c(86020),M=c(83849),L=c.n(M);const N=(0,o.createContext)(""),j=e=>{let{children:t,onDismiss:c=(()=>null)}=e;const{updateOptions:s}=(0,n.useDispatch)(m.OPTIONS_STORE_NAME),r=(0,o.useContext)(N),a=()=>{c(),s({[r]:"yes"})};return(0,o.createElement)(l.CardHeader,null,(0,o.createElement)("div",{className:"woocommerce-dismissable-list__header"},t),(0,o.createElement)("div",null,(0,o.createElement)(u.EllipsisMenu,{label:(0,i.__)("Task List Options","woocommerce"),renderContent:()=>(0,o.createElement)("div",{className:"woocommerce-dismissable-list__controls"},(0,o.createElement)(l.Button,{onClick:a},(0,i.__)("Hide this","woocommerce")))})))},g=e=>{let{children:t,className:c,dismissOptionName:i}=e;return(0,n.useSelect)((e=>{const{getOption:t,hasFinishedResolution:c}=e(m.OPTIONS_STORE_NAME),o=c("getOption",[i]),n="yes"===t(i);return o&&!n}))?(0,o.createElement)(l.Card,{size:"medium",className:L()("woocommerce-dismissable-list",c)},(0,o.createElement)(N.Provider,{value:i},t)):null};var S=c(74617),E=c(40610),y=c.n(E);const T=e=>{let{onSetupClick:t,pluginsBeingSetup:c}=e;const{createSuccessNotice:s}=(0,n.useDispatch)("core/notices"),r=(0,n.useSelect)((e=>e(m.PLUGINS_STORE_NAME).isJetpackConnected()));return(0,o.createElement)("div",{className:"woocommerce-list__item-inner woocommerce-services-item"},(0,o.createElement)("div",{className:"woocommerce-list__item-before"},(0,o.createElement)("img",{className:"woocommerce-services-item__logo",src:y(),alt:""})),(0,o.createElement)("div",{className:"woocommerce-list__item-text"},(0,o.createElement)("span",{className:"woocommerce-list__item-title"},(0,i.__)("WooCommerce Shipping","woocommerce"),(0,o.createElement)(u.Pill,null,(0,i.__)("Recommended","woocommerce"))),(0,o.createElement)("span",{className:"woocommerce-list__item-content"},(0,i.__)("Print USPS and DHL Express labels straight from your WooCommerce dashboard and save on shipping.","woocommerce"),(0,o.createElement)("br",null),(0,o.createElement)(l.ExternalLink,{href:"https://woocommerce.com/woocommerce-shipping/"},(0,i.__)("Learn more","woocommerce")))),(0,o.createElement)("div",{className:"woocommerce-list__item-after"},(0,o.createElement)(l.Button,{isSecondary:!0,onClick:()=>{t(["woocommerce-services"]).then((()=>{const e=[];r||e.push({url:(0,S.getAdminLink)("plugins.php"),label:(0,i.__)("Finish the setup by connecting your store to Jetpack.","woocommerce")}),s((0,i.__)("🎉 WooCommerce Shipping is installed!","woocommerce"),{actions:e})}))},isBusy:c.includes("woocommerce-services"),disabled:c.length>0},(0,i.__)("Get started","woocommerce"))))},d=e=>{let{children:t}=e;return(0,o.createElement)(g,{className:"woocommerce-recommended-shipping-extensions",dismissOptionName:"woocommerce_settings_shipping_recommendations_hidden"},(0,o.createElement)(j,null,(0,o.createElement)(s.Text,{variant:"title.small",as:"p",size:"20",lineHeight:"28px"},(0,i.__)("Recommended shipping solutions","woocommerce")),(0,o.createElement)(s.Text,{className:"woocommerce-recommended-shipping__header-heading",variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,i.__)('We recommend adding one of the following shipping extensions to your store. The extension will be installed and activated for you when you click "Get started".',"woocommerce"))),(0,o.createElement)("ul",{className:"woocommerce-list"},o.Children.map(t,(e=>(0,o.createElement)("li",{className:"woocommerce-list__item"},e)))),(0,o.createElement)(l.CardFooter,null,(0,o.createElement)(l.Button,{className:"woocommerce-recommended-shipping-extensions__more_options_cta",href:"https://woocommerce.com/product-category/woocommerce-extensions/shipping-methods/?utm_source=shipping_recommendations",target:"_blank",isTertiary:!0},(0,i.__)("See more options","woocommerce"),(0,o.createElement)(l.VisuallyHidden,null,(0,i.__)("(opens in a new tab)","woocommerce")),(0,o.createElement)(r.Z,{size:18}))))},I=()=>{const[e,t]=(()=>{const[e,t]=(0,o.useState)([]),{installAndActivatePlugins:c}=(0,n.useDispatch)(m.PLUGINS_STORE_NAME);return[e,o=>e.length>0?Promise.resolve():(t(o),c(o).then((()=>{t([])})).catch((e=>((0,a.a)(e),t([]),Promise.reject()))))]})();return(0,n.useSelect)((e=>e(m.PLUGINS_STORE_NAME).getActivePlugins())).includes("woocommerce-services")?null:(0,o.createElement)(d,null,(0,o.createElement)(T,{pluginsBeingSetup:e,onSetupClick:t}))}},40610:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjAgMTIwIj48cGF0aCBmaWxsPSIjN2Q1N2E0IiBkPSJNMCAwaDEyMHYxMjBIMHoiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNjcuNDggNTMuNTVjLTEuMTktLjI2LTIuMzMuNDItMy40MyAyLjAzLS44NyAxLjI2LTEuNDUgMi41Ni0xLjc0IDMuOTEtLjE2Ljc3LS4yNCAxLjU4LS4yNCAyLjQxIDAgLjk3LjE5IDEuOTYuNTggMi45OS40OCAxLjI2IDEuMTMgMS45NiAxLjkzIDIuMTIuOC4xNiAxLjY5LS4xOSAyLjY2LTEuMDYgMS4yMi0xLjA5IDIuMDYtMi43MiAyLjUxLTQuODguMTYtLjc3LjI0LTEuNTguMjQtMi40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