芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/public_html/wp-content/plugins/google-listings-and-ads/js/build/blocks.js
(()=>{"use strict";var e={1020:(e,t,s)=>{var o=s(1609),n=Symbol.for("react.element"),l=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function i(e,t,s){var o,i={},p=null,c=null;for(o in void 0!==s&&(p=""+s),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(c=t.ref),t)l.call(t,o)&&!r.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:p,ref:c,props:i,_owner:a.current}}t.jsx=i,t.jsxs=i},1609:e=>{e.exports=window.React},4848:(e,t,s)=>{e.exports=s(1020)}},t={};const s=window.wc.productEditor,o=window.wp.i18n,n=window.wc.blockTemplates,l=window.wp.components;var a=function s(o){var n=t[o];if(void 0!==n)return n.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,s),l.exports}(4848);const r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"google-listings-and-ads/product-onboarding-prompt","title":"Product onboarding prompt","textdomain":"google-listings-and-ads","attributes":{"startUrl":{"type":"string","__experimentalRole":"content"}},"supports":{"html":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}'),i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"google-listings-and-ads/product-channel-visibility","title":"Product channel visibility","textdomain":"google-listings-and-ads","attributes":{"property":{"type":"string","__experimentalRole":"content"},"options":{"type":"array","items":{"type":"object"},"default":[]},"valueOfSync":{"type":"string"},"valueOfDontSync":{"type":"string"},"statusOfSynced":{"type":"string"},"statusOfHasErrors":{"type":"string"}},"supports":{"html":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}'),p=window.wp.date,c=window.wp.element,d=window.wc.wcSettings;async function u(e,t){const s=e.current;if(!s.validity.valid)return(0,d.isWcVersion)("9.2.0","<")?s.validationMessage:{message:s.validationMessage,context:t}}const g=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"google-listings-and-ads/product-date-time-field","title":"Product date and time fields","textdomain":"google-listings-and-ads","attributes":{"label":{"type":"string"},"tooltip":{"type":"string"},"property":{"type":"string","__experimentalRole":"content"}},"supports":{"html":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}'),y=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"google-listings-and-ads/product-select-field","title":"Product select field","textdomain":"google-listings-and-ads","attributes":{"label":{"type":"string"},"tooltip":{"type":"string"},"property":{"type":"string","__experimentalRole":"content"},"options":{"type":"array","items":{"type":"object"},"default":[]}},"supports":{"html":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}'),f=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"google-listings-and-ads/product-select-with-text-field","title":"Product select with text field","textdomain":"google-listings-and-ads","attributes":{"label":{"type":"string"},"tooltip":{"type":"string"},"property":{"type":"string","__experimentalRole":"content"},"options":{"type":"array","items":{"type":"object"},"default":[]},"customInputValue":{"type":"string"}},"supports":{"html":false,"inserter":false,"lock":false,"__experimentalToolbar":false}}');function m({name:e,...t},o){(0,s.registerProductEditorBlockType)({name:e,metadata:t,settings:{edit:o}})}m(r,function({attributes:e}){const t=(0,n.useWooBlockProps)(e);return(0,a.jsx)("div",{...t,children:(0,a.jsxs)("div",{className:"Dz8NM01hSQyVP7lytEaS",children:[(0,a.jsx)("p",{className:"iKH0I_4hIpw3xXPSFYR4",children:(0,o.__)("Complete setup to get your products listed on Google for free.","google-listings-and-ads")}),(0,a.jsx)(l.Button,{isPrimary:!0,href:e.startUrl,children:(0,o.__)("Get Started","google-listings-and-ads")})]})})}),m(i,function({attributes:e,context:t}){const{valueOfSync:r,valueOfDontSync:i,statusOfSynced:p,statusOfHasErrors:c}=e,d=(0,n.useWooBlockProps)(e),[u,g]=(0,s.__experimentalUseProductEntityProp)(e.property,{postType:t.postType}),{is_visible:y,sync_status:f,issues:m}=u,x=y?u.channel_visibility:i;let h=null;f===c?h=(0,o.__)("Issues detected","google-listings-and-ads"):f&&(h=f.replace("-"," "));const _=y?"":(0,o.__)("This product cannot be shown on any channel because it is hidden from your store catalog. To enable this option, please change this product to be shown in the product catalog, and save the changes.","google-listings-and-ads"),b=y&&null!==h&&x===r&&f!==p,v=m.length>0;return(0,a.jsxs)("div",{...d,children:[(0,a.jsx)(l.SelectControl,{disabled:!y,options:e.options,value:x,onChange:e=>{g({...u,channel_visibility:e})},help:_}),b&&(0,a.jsxs)(l.Notice,{className:"xrM9YQcns2lLIJoZocoC",status:v?"warning":"info",isDismissible:!1,children:[(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{children:(0,o.__)("Google sync status","google-listings-and-ads")}),(0,a.jsx)("p",{className:"FNzfRIMkTNDr5hdJSQJS",children:h})]}),v&&(0,a.jsxs)("section",{children:[(0,a.jsx)("h2",{children:(0,o.__)("Issues","google-listings-and-ads")}),(0,a.jsx)("ul",{children:m.map((e,t)=>(0,a.jsx)("li",{children:e},t))})]})]})]})}),m(g,function({attributes:e,context:t,clientId:o}){const{property:r}=e,i=(0,n.useWooBlockProps)(e),[d,g]=(0,s.__experimentalUseProductEntityProp)(r,{postType:t.postType,fallbackValue:""}),y=(0,c.useRef)(null),f=(0,c.useRef)(null),[m,x]=(0,c.useState)(()=>d?(0,p.date)("Y-m-d",d):""),[h,_]=(0,c.useState)(()=>d?(0,p.date)("H:i",d):""),b=(e,t)=>{let s="";if(e){const o=`${e}T${t||"00:00:00"}`,n=(0,p.getDate)(o);s=(0,p.date)("c",n,"UTC")}x(e),_(t),d!==s&&g(s)},v=(0,s.useValidation)(`${r}-date`,()=>u(y,o)),w=(0,s.useValidation)(`${r}-time`,()=>u(f,o));return(0,a.jsx)("div",{...i,children:(0,a.jsxs)(l.Flex,{align:"flex-start",children:[(0,a.jsx)(l.FlexBlock,{children:(0,a.jsx)(s.__experimentalTextControl,{ref:y,type:"date",pattern:"\\d{4}-\\d{2}-\\d{2}",label:e.label,tooltip:e.tooltip,value:m,error:v.error,onChange:e=>b(e,h),onBlur:v.validate})}),(0,a.jsx)(l.FlexBlock,{children:(0,a.jsx)(s.__experimentalTextControl,{className:"p9THnpoXkzl3X4b4PYpg",label:" ",tooltip:" ",ref:f,type:"time",pattern:"[0-9]{2}:[0-9]{2}",value:h,error:w.error,onChange:e=>b(m,e),onBlur:w.validate})})]})})}),m(y,function({attributes:e,context:t}){const o=(0,n.useWooBlockProps)(e),[r,i]=(0,s.__experimentalUseProductEntityProp)(e.property,{postType:t.postType});return(0,a.jsx)("div",{...o,children:(0,a.jsx)(l.SelectControl,{label:(0,a.jsx)(s.__experimentalLabel,{label:e.label,tooltip:e.tooltip}),options:e.options,value:r,onChange:i})})}),m(f,function({attributes:e,context:t}){const{options:o,customInputValue:r}=e,i=(0,n.useWooBlockProps)(e),[p,d]=(0,s.__experimentalUseProductEntityProp)(e.property,{postType:t.postType,fallbackValue:""}),[u,g]=(0,c.useState)(()=>{var e;const t=null!=p?p:"",s=o.find(e=>e.value===t);return null!==(e=s?.value)&&void 0!==e?e:r}),y=u===r,[f,m]=(0,c.useState)(y?p:"");return(0,a.jsxs)("div",{...i,children:[(0,a.jsx)(l.SelectControl,{label:(0,a.jsx)(s.__experimentalLabel,{label:e.label,tooltip:e.tooltip}),options:o,value:u,onChange:e=>{g(e),d(e===r?f:e)},disabled:e.disabled}),y&&(0,a.jsx)(s.__experimentalTextControl,{type:"text",value:f,onChange:e=>{m(e),d(e)},disabled:e.disabled})]})})})();