lightning_scheduler-8.x-1.x-dev/js/dist/index.js

js/dist/index.js
!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=35)}([function(t,e,n){"use strict";(function(e){var n=function(t){return t&&t.Math===Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()}).call(e,n(40))},function(t,e,n){"use strict";var r="object"==typeof document&&document.all;t.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},function(t,e,n){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";var r=n(13),o=Function.prototype,i=o.call,u=r&&o.bind.bind(i,i);t.exports=r?u:function(t){return function(){return i.apply(t,arguments)}}},function(t,e,n){"use strict";var r=n(2);t.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(t,e,n){"use strict";var r=n(3),o=n(24),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},function(t,e,n){"use strict";var r=n(41),o=n(16);t.exports=function(t){return r(o(t))}},function(t,e,n){"use strict";var r=n(13),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},function(t,e,n){"use strict";var r=n(52),o=n(0),i=n(10),u=t.exports=o["__core-js_shared__"]||i("__core-js_shared__",{});(u.versions||(u.versions=[])).push({version:"3.38.0",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,e,n){"use strict";var r=n(0),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},function(t,e,n){"use strict";var r=n(4),o=n(26),i=n(54),u=n(28),a=n(18),c=TypeError,s=Object.defineProperty,f=Object.getOwnPropertyDescriptor;e.f=r?i?function(t,e,n){if(u(t),e=a(e),u(n),"function"==typeof t&&"prototype"===e&&"value"in n&&"writable"in n&&!n.writable){var r=f(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return s(t,e,n)}:s:function(t,e,n){if(u(t),e=a(e),u(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";var r=n(4),o=n(8),i=n(14),u=n(15),a=n(7),c=n(18),s=n(5),f=n(26),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=a(t),e=c(e),f)try{return l(t,e)}catch(t){}if(s(t,e))return u(!o(i.f,t,e),t[e])}},function(t,e,n){"use strict";var r=n(2);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e,n){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(17),o=TypeError;t.exports=function(t){if(r(t))throw new o("Can't call method on "+t);return t}},function(t,e,n){"use strict";t.exports=function(t){return null===t||void 0===t}},function(t,e,n){"use strict";var r=n(43),o=n(19);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},function(t,e,n){"use strict";var r=n(20),o=n(1),i=n(44),u=n(21),a=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},function(t,e,n){"use strict";var r=n(0),o=n(1),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},function(t,e,n){"use strict";var r=n(22);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){"use strict";var r=n(45),o=n(2),i=n(0),u=i.String;t.exports=!!Object.getOwnPropertySymbols&&!o(function(){var t=Symbol("symbol detection");return!u(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})},function(t,e,n){"use strict";var r=n(9);t.exports=function(t,e){return r[t]||(r[t]=e||{})}},function(t,e,n){"use strict";var r=n(16),o=Object;t.exports=function(t){return o(r(t))}},function(t,e,n){"use strict";var r=n(3),o=0,i=Math.random(),u=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},function(t,e,n){"use strict";var r=n(4),o=n(2),i=n(53);t.exports=!r&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(4),o=n(11),i=n(15);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";var r=n(6),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not an object")}},function(t,e,n){"use strict";var r=n(23),o=n(25),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var r=n(3),o=n(5),i=n(7),u=n(64).indexOf,a=n(30),c=r([].push);t.exports=function(t,e){var n,r=i(t),s=0,f=[];for(n in r)!o(a,n)&&o(r,n)&&c(f,n);for(;e.length>s;)o(r,n=e[s++])&&(~u(f,n)||c(f,n));return f}},function(t,e,n){"use strict";var r=n(66);t.exports=function(t){var e=+t;return e!==e||0===e?0:r(e)}},function(t,e,n){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e){t.exports=React},function(t,e,n){n(36),t.exports=n(76)},function(t,e,n){"use strict";var r=n(37);t.exports=r},function(t,e,n){"use strict";n(38);var r=n(75);t.exports=r.Object.entries},function(t,e,n){"use strict";var r=n(39),o=n(71).entries;r({target:"Object",stat:!0},{entries:function(t){return o(t)}})},function(t,e,n){"use strict";var r=n(0),o=n(12).f,i=n(27),u=n(55),a=n(10),c=n(61),s=n(70);t.exports=function(t,e){var n,f,l,p,m,d=t.target,y=t.global,v=t.stat;if(n=y?r:v?r[d]||a(d,{}):r[d]&&r[d].prototype)for(f in e){if(p=e[f],t.dontCallGetSet?(m=o(n,f),l=m&&m.value):l=n[f],!s(y?f:d+(v?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;c(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),u(n,f,p,t)}}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(3),o=n(2),i=n(42),u=Object,a=r("".split);t.exports=o(function(){return!u("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?a(t,""):u(t)}:u},function(t,e,n){"use strict";var r=n(3),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},function(t,e,n){"use strict";var r=n(8),o=n(6),i=n(19),u=n(47),a=n(50),c=n(51),s=TypeError,f=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,c=u(t,f);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!o(n)||i(n))return n;throw new s("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},function(t,e,n){"use strict";var r=n(3);t.exports=r({}.isPrototypeOf)},function(t,e,n){"use strict";var r,o,i=n(0),u=n(46),a=i.process,c=i.Deno,s=a&&a.versions||c&&c.version,f=s&&s.v8;f&&(r=f.split("."),o=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&u&&(!(r=u.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=u.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},function(t,e,n){"use strict";var r=n(0),o=r.navigator,i=o&&o.userAgent;t.exports=i?String(i):""},function(t,e,n){"use strict";var r=n(48),o=n(17);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},function(t,e,n){"use strict";var r=n(1),o=n(49),i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not a function")}},function(t,e,n){"use strict";var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},function(t,e,n){"use strict";var r=n(8),o=n(1),i=n(6),u=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw new u("Can't convert object to primitive value")}},function(t,e,n){"use strict";var r=n(0),o=n(23),i=n(5),u=n(25),a=n(22),c=n(21),s=r.Symbol,f=o("wks"),l=c?s.for||s:s&&s.withoutSetter||u;t.exports=function(t){return i(f,t)||(f[t]=a&&i(s,t)?s[t]:l("Symbol."+t)),f[t]}},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";var r=n(0),o=n(6),i=r.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(4),o=n(2);t.exports=r&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},function(t,e,n){"use strict";var r=n(1),o=n(11),i=n(56),u=n(10);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,s=void 0!==a.name?a.name:e;if(r(n)&&i(n,s,a),a.global)c?t[e]=n:u(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},function(t,e,n){"use strict";var r=n(3),o=n(2),i=n(1),u=n(5),a=n(4),c=n(57).CONFIGURABLE,s=n(58),f=n(59),l=f.enforce,p=f.get,m=String,d=Object.defineProperty,y=r("".slice),v=r("".replace),h=r([].join),b=a&&!o(function(){return 8!==d(function(){},"length",{value:8}).length}),g=String(String).split("String"),w=t.exports=function(t,e,n){"Symbol("===y(m(e),0,7)&&(e="["+v(m(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!u(t,"name")||c&&t.name!==e)&&(a?d(t,"name",{value:e,configurable:!0}):t.name=e),b&&n&&u(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&u(n,"constructor")&&n.constructor?a&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=l(t);return u(r,"source")||(r.source=h(g,"string"==typeof e?e:"")),t};Function.prototype.toString=w(function(){return i(this)&&p(this).source||s(this)},"toString")},function(t,e,n){"use strict";var r=n(4),o=n(5),i=Function.prototype,u=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,s=a&&(!r||r&&u(i,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:s}},function(t,e,n){"use strict";var r=n(3),o=n(1),i=n(9),u=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},function(t,e,n){"use strict";var r,o,i,u=n(60),a=n(0),c=n(6),s=n(27),f=n(5),l=n(9),p=n(29),m=n(30),d=a.TypeError,y=a.WeakMap,v=function(t){return i(t)?o(t):r(t,{})},h=function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw new d("Incompatible receiver, "+t+" required");return n}};if(u||l.state){var b=l.state||(l.state=new y);b.get=b.get,b.has=b.has,b.set=b.set,r=function(t,e){if(b.has(t))throw new d("Object already initialized");return e.facade=t,b.set(t,e),e},o=function(t){return b.get(t)||{}},i=function(t){return b.has(t)}}else{var g=p("state");m[g]=!0,r=function(t,e){if(f(t,g))throw new d("Object already initialized");return e.facade=t,s(t,g,e),e},o=function(t){return f(t,g)?t[g]:{}},i=function(t){return f(t,g)}}t.exports={set:r,get:o,has:i,enforce:v,getterFor:h}},function(t,e,n){"use strict";var r=n(0),o=n(1),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},function(t,e,n){"use strict";var r=n(5),o=n(62),i=n(12),u=n(11);t.exports=function(t,e,n){for(var a=o(e),c=u.f,s=i.f,f=0;f<a.length;f++){var l=a[f];r(t,l)||n&&r(n,l)||c(t,l,s(e,l))}}},function(t,e,n){"use strict";var r=n(20),o=n(3),i=n(63),u=n(69),a=n(28),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=u.f;return n?c(e,n(t)):e}},function(t,e,n){"use strict";var r=n(31),o=n(33),i=o.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){"use strict";var r=n(7),o=n(65),i=n(67),u=function(t){return function(e,n,u){var a=r(e),c=i(a);if(0===c)return!t&&-1;var s,f=o(u,c);if(t&&n!==n){for(;c>f;)if((s=a[f++])!==s)return!0}else for(;c>f;f++)if((t||f in a)&&a[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},function(t,e,n){"use strict";var r=n(32),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},function(t,e,n){"use strict";var r=Math.ceil,o=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?o:r)(e)}},function(t,e,n){"use strict";var r=n(68);t.exports=function(t){return r(t.length)}},function(t,e,n){"use strict";var r=n(32),o=Math.min;t.exports=function(t){var e=r(t);return e>0?o(e,9007199254740991):0}},function(t,e,n){"use strict";e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(2),o=n(1),i=/#|\.prototype\./,u=function(t,e){var n=c[a(t)];return n===f||n!==s&&(o(e)?r(e):!!e)},a=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=u.data={},s=u.NATIVE="N",f=u.POLYFILL="P";t.exports=u},function(t,e,n){"use strict";var r=n(4),o=n(2),i=n(3),u=n(72),a=n(74),c=n(7),s=n(14).f,f=i(s),l=i([].push),p=r&&o(function(){var t=Object.create(null);return t[2]=2,!f(t,2)}),m=function(t){return function(e){for(var n,o=c(e),i=a(o),s=p&&null===u(o),m=i.length,d=0,y=[];m>d;)n=i[d++],r&&!(s?n in o:f(o,n))||l(y,t?[n,o[n]]:o[n]);return y}};t.exports={entries:m(!0),values:m(!1)}},function(t,e,n){"use strict";var r=n(5),o=n(1),i=n(24),u=n(29),a=n(73),c=u("IE_PROTO"),s=Object,f=s.prototype;t.exports=a?s.getPrototypeOf:function(t){var e=i(t);if(r(e,c))return e[c];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof s?f:null}},function(t,e,n){"use strict";var r=n(2);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},function(t,e,n){"use strict";var r=n(31),o=n(33);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){"use strict";var r=n(0);t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});for(var r=n(34),o=(n.n(r),n(77)),i=(n.n(o),n(78)),u=document.getElementsByTagName("TransitionSet"),a=0;a<u.length;a++){var c=u[a],s=c.querySelector('input[ type="hidden" ]'),f=Object(r.createElement)(i.a,{states:JSON.parse(c.getAttribute("states")),transitions:JSON.parse(s.value),input:s.name,step:c.getAttribute("step")||60});Object(o.render)(f,c)}},function(t,e){t.exports=ReactDOM},function(t,e,n){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(34),c=(n.n(a),n(79)),s=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=function(t){function e(t){o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),r=t.transitions||[],u=Object.entries(t.states);return n.state={transitions:r.map(function(t){return"number"==typeof t.when&&(t.when=1e3*t.when),t.when=new Date(t.when),t})},n.defaultState=u[0][0],n.stateOptions=u.map(function(t){var e=s(t,2),n=e[0],r=e[1];return React.createElement("option",{key:n,value:n},r)}),n}return u(e,t),f(e,[{key:"renderSaved",value:function(t,e){var n=this,r=this.props.states[t.state],o=this.localizeDate(document.documentElement.lang,t.when),i=function(t){t.preventDefault(),n.setState(function(t){return t.transitions.splice(e,1),t})},u=Drupal.t("Remove transition to @state on @date",{"@state":r,"@date":o}),a=["scheduled-transition"];return React.createElement("div",{className:a.join(" ")},Drupal.t("Change to")," ",React.createElement("b",null,r)," ",Drupal.t("on")," ",o," ",React.createElement("a",{title:u,href:"#",onClick:i},Drupal.t("remove")))}},{key:"localizeDate",value:function(t,e){return new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)}},{key:"renderForm",value:function(){return Object(a.createElement)("div",{className:"scheduled-transition"},Drupal.t("Change to"),this.renderStateControl(),Drupal.t("on"),this.renderDateControl(),Drupal.t("at"),this.renderTimeControl(),this.renderFormActions())}},{key:"renderStateControl",value:function(){var t=this,e=function(e){var n=e.target;t.setState(function(t){return t.edit.state=n.options[n.selectedIndex].value,t})},n=this.state.edit.state;return React.createElement("label",null,React.createElement("span",{hidden:!0},Drupal.t("Scheduled moderation state")),React.createElement("select",{defaultValue:n,onChange:e,class:"form-select form-element form-element--type-select"},this.stateOptions))}},{key:"renderDateControl",value:function(){var t=this,e=function(e){var n=e.target;n.checkValidity()&&t.setState(function(t){var e,o=n.value.split("-");return o[1]--,(e=t.edit.when).setFullYear.apply(e,r(o)),t})},n=Object(c.a)(this.state.edit.when,"isoDate"),o="";if(!drupalSettings.lightning_scheduler.allow_past_dates){var i=void 0;i=new Date,o=i.getFullYear()+"-"+("0"+(i.getMonth()+1)).slice(-2)+"-"+("0"+i.getDate()).slice(-2)}return React.createElement("label",null,React.createElement("span",{hidden:!0},Drupal.t("Scheduled transition date")),React.createElement("input",{required:!0,min:o,defaultValue:n,type:"date",onChange:e,class:"form-date form-element form-element--type-date form-element--api-date"}))}},{key:"renderTimeControl",value:function(){var t=this,e=function(e){var n=e.target;t.setState(function(t){var e;return(e=t.edit.when).setHours.apply(e,r(n.value.split(":"))),t})},n=void 0;n=this.props.step>=3600?"HH:00":this.props.step>=60?"HH:MM":"isoTime";var o=Object(c.a)(this.state.edit.when,n);return React.createElement("label",null,React.createElement("span",{hidden:!0},Drupal.t("Scheduled transition time")),React.createElement("input",{required:!0,defaultValue:o,type:"time",onChange:e,step:this.props.step,class:"form-time form-element form-element--type-time form-element--api-date"}))}},{key:"renderFormActions",value:function(){var t=this,e=function(e){e.preventDefault(),t.setState(function(t){return t.edit=null,t})},n=function(e){e.preventDefault(),t.setState(function(t){return t.transitions.push(t.edit),t.edit=null,t})};return React.createElement("span",null,React.createElement("button",{className:"button",title:Drupal.t("Save transition"),onClick:n},Drupal.t("Save"))," ",Drupal.t("or")," ",React.createElement("a",{title:Drupal.t("Cancel transition"),href:"#",onClick:e},Drupal.t("cancel")))}},{key:"render",value:function(){var t=this,e=[Object(a.createElement)("input",{type:"hidden",name:this.props.input,value:JSON.stringify(this)}),this.state.transitions.map(function(e,n){return t.renderSaved(e,n)})];return e.push(this.state.edit?this.renderForm():this.renderAddLink()),e}},{key:"toJSON",value:function(){var t=parseInt(this.props.step);return this.state.transitions.map(function(e){var n=e.when.getTime()/1e3;return!isNaN(t)&&t>=60&&(n-=n%60),{when:Math.floor(n),state:e.state}})}},{key:"renderAddLink",value:function(){var t=this,e=function(e){e.preventDefault(),t.add()},n=this.state.transitions.length?Drupal.t("add another"):Drupal.t("Schedule a status change");return React.createElement("a",{href:"#",onClick:e},n)}},{key:"add",value:function(){var t=this,e=parseInt(this.props.step);this.setState(function(n){var r=new Date,o=r.getTime()/1e3;!isNaN(e)&&e>=60&&(o-=o%60),n.edit={state:t.defaultState,when:new Date(1e3*Math.floor(o))};var i=n.transitions.slice(-1).shift();return i&&n.edit.when.setTime(i.when.getTime()),n})}}]),e}(a.Component);e.a=l},function(t,e,n){"use strict";function r(t,e,n,r){if(1!==arguments.length||"string"!=typeof t||/\d/.test(t)||(e=t,t=void 0),t=t||0===t?t:new Date,t instanceof Date||(t=new Date(t)),isNaN(t))throw TypeError("Invalid date");e=String(a[e]||e||a.default);var i=e.slice(0,4);"UTC:"!==i&&"GMT:"!==i||(e=e.slice(4),n=!0,"GMT:"===i&&(r=!0));var u=function(){return n?"getUTC":"get"},d=function(){return t[u()+"Date"]()},y=function(){return t[u()+"Day"]()},v=function(){return t[u()+"Month"]()},h=function(){return t[u()+"FullYear"]()},b=function(){return t[u()+"Hours"]()},g=function(){return t[u()+"Minutes"]()},w=function(){return t[u()+"Seconds"]()},S=function(){return t[u()+"Milliseconds"]()},O=function(){return n?0:t.getTimezoneOffset()},x=function(){return l(t)},D=function(){return p(t)},M={d:function(){return d()},dd:function(){return s(d())},ddd:function(){return c.dayNames[y()]},DDD:function(){return f({y:h(),m:v(),d:d(),_:u(),dayName:c.dayNames[y()],short:!0})},dddd:function(){return c.dayNames[y()+7]},DDDD:function(){return f({y:h(),m:v(),d:d(),_:u(),dayName:c.dayNames[y()+7]})},m:function(){return v()+1},mm:function(){return s(v()+1)},mmm:function(){return c.monthNames[v()]},mmmm:function(){return c.monthNames[v()+12]},yy:function(){return String(h()).slice(2)},yyyy:function(){return s(h(),4)},h:function(){return b()%12||12},hh:function(){return s(b()%12||12)},H:function(){return b()},HH:function(){return s(b())},M:function(){return g()},MM:function(){return s(g())},s:function(){return w()},ss:function(){return s(w())},l:function(){return s(S(),3)},L:function(){return s(Math.floor(S()/10))},t:function(){return b()<12?c.timeNames[0]:c.timeNames[1]},tt:function(){return b()<12?c.timeNames[2]:c.timeNames[3]},T:function(){return b()<12?c.timeNames[4]:c.timeNames[5]},TT:function(){return b()<12?c.timeNames[6]:c.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":m(t)},o:function(){return(O()>0?"-":"+")+s(100*Math.floor(Math.abs(O())/60)+Math.abs(O())%60,4)},p:function(){return(O()>0?"-":"+")+s(Math.floor(Math.abs(O())/60),2)+":"+s(Math.floor(Math.abs(O())%60),2)},S:function(){return["th","st","nd","rd"][d()%10>3?0:(d()%100-d()%10!=10)*d()%10]},W:function(){return x()},WW:function(){return s(x())},N:function(){return D()}};return e.replace(o,function(t){return t in M?M[t]():t.slice(1,t.length-1)})}e.a=r;var o=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,i=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,u=/[^-+\dA-Z]/g,a={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},c={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(t).padStart(e,"0")},f=function(t){var e=t.y,n=t.m,r=t.d,o=t._,i=t.dayName,u=t.short,a=void 0!==u&&u,c=new Date,s=new Date;s.setDate(s[o+"Date"]()-1);var f=new Date;f.setDate(f[o+"Date"]()+1);return function(){return c[o+"FullYear"]()}()===e&&function(){return c[o+"Month"]()}()===n&&function(){return c[o+"Date"]()}()===r?a?"Tdy":"Today":function(){return s[o+"FullYear"]()}()===e&&function(){return s[o+"Month"]()}()===n&&function(){return s[o+"Date"]()}()===r?a?"Ysd":"Yesterday":function(){return f[o+"FullYear"]()}()===e&&function(){return f[o+"Month"]()}()===n&&function(){return f[o+"Date"]()}()===r?a?"Tmw":"Tomorrow":i},l=function(t){var e=new Date(t.getFullYear(),t.getMonth(),t.getDate());e.setDate(e.getDate()-(e.getDay()+6)%7+3);var n=new Date(e.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=e.getTimezoneOffset()-n.getTimezoneOffset();e.setHours(e.getHours()-r);var o=(e-n)/6048e5;return 1+Math.floor(o)},p=function(t){var e=t.getDay();return 0===e&&(e=7),e},m=function(t){return(String(t).match(i)||[""]).pop().replace(u,"").replace(/GMT\+0000/g,"UTC")}}]);
//# sourceMappingURL=index.js.map

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc