navasena/wp-content/plugins/woocommerce/assets/client/admin/chunks/1565.js

2 lines
7.6 KiB
JavaScript
Raw Normal View History

2024-07-31 13:12:38 +07:00
/*! For license information please see 1565.js.LICENSE.txt */
(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[1565],{61565:(e,n,t)=>{"use strict";t.d(n,{inspect:()=>m});var i=function(){return i=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},i.apply(this,arguments)},r=t(25094),o=t(83572),s=t(38469),a=t(7872),c=t(4329),u=t.n(c);function d(e){return"function"==typeof e?e():e}function l(e,n){try{return JSON.stringify(e,n)}catch(t){return u()(e,n)}}function f(e,n,t){var r,o,s={};try{for(var a=function(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],i=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),c=a.next();!c.done;c=a.next()){var u=c.value;s[u]=e[u]}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}var d=JSON.parse(l(s,t));return l(i(i({},e),d))}function v(e,n){return e.machine,e.configuration,e.history,f(function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t}(e,["machine","configuration","history"]),["context","event","_event"],n)}function p(e,n){return f(e.definition,["context"],n)}var g=new Map,y={url:"https://stately.ai/viz?inspect",iframe:function(){return document.querySelector("iframe[data-xstate]")},devTools:function(){var e,n,t=(e=new Set,n=new Set,{services:e,register:function(t){e.add(t),g.set(t.sessionId,t),n.forEach((function(e){return e(t)})),t.onStop((function(){e.delete(t),g.delete(t.sessionId)}))},unregister:function(n){e.delete(n),g.delete(n.sessionId)},onRegister:function(t){return n.add(t),e.forEach((function(e){return t(e)})),{unsubscribe:function(){n.delete(t)}}}});return globalThis.__xstate__=t,t},serialize:void 0,targetWindow:void 0},h=function(e){var n=i(i({},y),e);return i(i({},n),{url:new URL(n.url),iframe:d(n.iframe),devTools:d(n.devTools)})},b=new Set;function m(e){var n=h(e),t=n.iframe,c=n.url,u=n.devTools;if(null===(null==e?void 0:e.targetWindow))throw new Error("Received a nullable `targetWindow`.");var d=n.targetWindow;if(null!==t||d){var f,g=function(e,n){void 0===e&&(e=globalThis.__xstate__);var t=new Map,i=e.onRegister((function(e){t.set(e.sessionId,e)}));return(0,s.C)({predictableActionArguments:!0,initial:"pendingConnection",context:{client:void 0},states:{pendingConnection:{},connected:{on:{"service.state":{actions:function(e,n){return e.client.send(n)}},"service.event":{actions:function(e,n){return e.client.send(n)}},"service.register":{actions:function(e,n){return e.client.send(n)}},"service.stop":{actions:function(e,n){return e.client.send(n)}},"xstate.event":{actions:function(e,n){var i=n.event,r=JSON.parse(i),o=t.get(r.origin);null==o||o.send(r)}},unload:{actions:function(e){e.client.send({type:"xstate.disconnect"})}},disconnect:"disconnected"}},disconnected:{entry:function(){i.unsubscribe()},type:"final"}},on:{"xstate.inspecting":{target:".connected",actions:[(0,a.assign)({client:function(e,n){return n.client}}),function(t){e.services.forEach((function(e){var i;null===(i=t.client)||void 0===i||i.send({type:"service.register",machine:p(e.machine,null==n?void 0:n.serialize),state:v(e.state||e.initialState,null==n?void 0:n.serialize),sessionId:e.sessionId})}))}]}}})}(u,e),y=(0,r.kJ)(g).start(),m=new Set,w=y.subscribe((function(e){m.forEach((function(n){return n.next(e)}))})),O=function(e){if("object"==typeof e.data&&null!==e.data&&"type"in e.data){t&&!d&&(d=t.contentWindow),f||(f={send:function(e){d.postMessage(e,c.origin)}});var n=i(i({},e.data),{client:f});y.send(n)}};window.addEventListener("message",O),window.addEventListener("unload",(function(){y.send({type:"unloa