(()=>{var e,t,r,o={3774:(e,t,r)=>{"use strict";const o=window.wp.blocks;var n=r(7071);const i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"woocommerce/product-review-date","title":"Review Date","category":"woocommerce","ancestor":["woocommerce/product-reviews"],"description":"Displays the date on which the review was posted.","textdomain":"woocommerce","attributes":{"format":{"type":"string"},"isLink":{"type":"boolean","default":true}},"usesContext":["commentId"],"supports":{"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}}}'),a=window.wp.coreData,s=window.wp.date,c=window.wp.components;var l=r(7723);const u=window.wp.blockEditor;var p=r(790);r(3425),(0,o.registerBlockType)(i,{icon:n.A,edit:function({attributes:{format:e,isLink:t},context:{commentId:r},setAttributes:o}){const n=(0,u.useBlockProps)();let[i]=(0,a.useEntityProp)("root","comment","date",r);const[d=(0,s.getSettings)().formats.date]=(0,a.useEntityProp)("root","site","date_format");r&&i||(i=(0,l._x)("Review Date","block title","woocommerce"));let m=i instanceof Date?(0,p.jsx)("time",{dateTime:(0,s.dateI18n)("c",i,!0),children:"human-diff"===e?(0,s.humanTimeDiff)(i,new Date):(0,s.dateI18n)(e||d,i,!0)}):(0,p.jsx)("time",{children:i});return t&&(m=(0,p.jsx)("a",{href:"#review-date-pseudo-link",onClick:e=>e.preventDefault(),children:m})),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u.InspectorControls,{children:(0,p.jsxs)(c.PanelBody,{title:(0,l.__)("Settings","woocommerce"),children:[(0,p.jsx)(u.__experimentalDateFormatPicker,{format:e,defaultFormat:d,onChange:e=>o({format:e})}),(0,p.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,l.__)("Link to review","woocommerce"),onChange:()=>o({isLink:!t}),checked:t})]})}),(0,p.jsx)("div",{...n,children:m})]})}})},3425:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e].call(r.exports,r,r.exports,i),r.exports}i.m=o,e=[],i.O=(t,r,o,n)=>{if(!r){var a=1/0;for(u=0;u<e.length;u++){for(var[r,o,n]=e[u],s=!0,c=0;c<r.length;c++)(!1&n||a>=n)&&Object.keys(i.O).every((e=>i.O[e](r[c])))?r.splice(c--,1):(s=!1,n<a&&(a=n));if(s){e.splice(u--,1);var l=o();void 0!==l&&(t=l)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[r,o,n]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var a={};t=t||[null,r({}),r([]),r(r)];for(var s=2&o&&e;"object"==typeof s&&!~t.indexOf(s);s=r(s))Object.getOwnPropertyNames(s).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,i.d(n,a),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=2146,(()=>{var e={2146:0};i.O.j=t=>0===e[t];var t=(t,r)=>{var o,n,[a,s,c]=r,l=0;if(a.some((t=>0!==e[t]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(c)var u=c(i)}for(t&&t(r);l<a.length;l++)n=a[l],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(u)},r=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a=i.O(void 0,[94],(()=>i(3774)));a=i.O(a),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-review-date"]=a})();