@plone/volto 15.0.0 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +8 -5
- package/dist/assets.json +1 -1
- package/dist/chunks.json +22 -22
- package/dist/loadable-stats.json +56 -56
- package/dist/public/static/css/{client.7ff60f09.chunk.css → client.75e09347.chunk.css} +1 -1
- package/dist/public/static/css/{plone-volto-components-manage-Widgets-DatetimeWidget.77a7ad0d.chunk.css → plone-volto-components-manage-Widgets-DatetimeWidget.c6a47163.chunk.css} +1 -1
- package/dist/public/static/js/client.75e09347.chunk.js +2 -0
- package/dist/public/static/js/{plone-volto-components-manage-Widgets-DatetimeWidget.77a7ad0d.chunk.js → plone-volto-components-manage-Widgets-DatetimeWidget.c6a47163.chunk.js} +2 -2
- package/dist/public/static/js/{plone-volto-components-theme-View-EventView.c500936a.chunk.js → plone-volto-components-theme-View-EventView.d0a7e38a.chunk.js} +2 -2
- package/dist/public/static/js/{react-select.43f17559.chunk.js → react-select.6ac1d612.chunk.js} +2 -2
- package/dist/public/static/js/{runtime~client.c5015e27.js → runtime~client.5ca655c6.js} +2 -2
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/src/components/index.js +2 -0
- package/src/components/manage/Blocks/Listing/SummaryTemplate.jsx +2 -11
- package/src/components/theme/PreviewImage/PreviewImage.jsx +30 -0
- package/src/components/theme/PreviewImage/PreviewImage.test.js +65 -0
- package/src/config/Components.jsx +5 -0
- package/src/config/index.js +2 -0
- package/src/reducers/querystringsearch/querystringsearch.js +2 -0
- package/dist/public/static/js/client.7ff60f09.chunk.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[9],{"f/pJ":function(e,t,s){"use strict";s.r(t),s.d(t,"DatetimeWidgetComponent",(function(){return G}));var n=s("lSNA"),i=s.n(n),o=s("q1tI"),a=s.n(o),r=s("ANjH"),l=s("17x9"),c=s.n(l),d=s("lHu7"),p=s.n(d),u=s("zSVi"),h=s("MKeS"),m=s("TSYQ"),b=s.n(m),O=s("Kvkj"),
|
|
2
|
-
//# sourceMappingURL=plone-volto-components-manage-Widgets-DatetimeWidget.
|
|
1
|
+
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[9],{"f/pJ":function(e,t,s){"use strict";s.r(t),s.d(t,"DatetimeWidgetComponent",(function(){return G}));var n=s("lSNA"),i=s.n(n),o=s("q1tI"),a=s.n(o),r=s("ANjH"),l=s("17x9"),c=s.n(l),d=s("lHu7"),p=s.n(d),u=s("zSVi"),h=s("MKeS"),m=s("TSYQ"),b=s.n(m),O=s("Kvkj"),j=s("zpb6"),f=s("Lf35"),g=s("GWVt"),v=s.n(g),D=s("6fhb"),x=s.n(D),y=s("1Jxj"),S=s.n(y),C=s("gX4G"),w=s.n(C),P=s("GG7f"),_=s.n(P),A=s("P+y9"),I=s.n(A),N=s("nKUr"),L=s.n(N);function M(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function k(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?M(Object(s),!0).forEach((function(t){i()(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):M(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}const T=Object(h.a)({resolved:{},chunkName:()=>"rc-time-picker",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!s.m[t]},importAsync:()=>Promise.all([s.e(4),s.e(6),s.e(5)]).then(s.bind(null,"+sk9")),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){const t=this.resolve(e);return s(t)},resolve(){return"+sk9"}}),E=Object(d.defineMessages)({date:{id:"Date",defaultMessage:"Date"},time:{id:"Time",defaultMessage:"Time"}}),V=()=>Object(N.jsx)("div",{style:{color:"#000",left:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0",children:Object(N.jsx)(O.jb,{name:v.a,size:"30px"})}),F=()=>Object(N.jsx)("div",{style:{color:"#000",right:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0",children:Object(N.jsx)(O.jb,{name:x.a,size:"30px"})}),z={hour:12,minute:0,second:0};class G extends o.Component{constructor(e){var t;super(e),i()(this,"onDateChange",e=>{if(e){const t=this.props.moment.default,s=this.getDateOnly(),n=(this.getInternalValue()||t()).set(k({year:e.year(),month:e.month(),date:e.date()},s?z:{})),i=s?n.format("YYYY-MM-DD"):n.toISOString();this.props.onChange(this.props.id,i)}this.setState({isDefault:!1})}),i()(this,"onTimeChange",e=>{const t=this.props.moment.default;if(e){var s,n;const i=(this.getInternalValue()||t()).set({hours:null!==(s=null===e||void 0===e?void 0:e.hours())&&void 0!==s?s:0,minutes:null!==(n=null===e||void 0===e?void 0:e.minutes())&&void 0!==n?n:0,seconds:0}).toISOString();this.props.onChange(this.props.id,i)}}),i()(this,"onResetDates",()=>{this.setState({isDefault:!1}),this.props.onChange(this.props.id,null)}),i()(this,"onFocusChange",({focused:e})=>this.setState({focused:e})),this.moment=e.moment.default,this.state={focused:!1,isDefault:(null===(t=Object(j.T)(this.props.intl.locale,this.props.value,void 0,this.moment))||void 0===t?void 0:t.toISOString())===this.moment().utc().toISOString()}}getInternalValue(){return Object(j.T)(this.props.intl.locale,this.props.value,void 0,this.moment)}getDateOnly(){return this.props.dateOnly||"date"===this.props.widget}render(){var e;const{id:t,resettable:s,intl:n,reactDates:i,widgetOptions:o}=this.props,a=this.props.noPastDates||(null===o||void 0===o||null===(e=o.pattern_options)||void 0===e?void 0:e.noPastDates),r=this.props.moment.default,l=this.getInternalValue(),c=this.getDateOnly(),{SingleDatePicker:d}=i;return Object(N.jsx)(O.db,k(k({},this.props),{},{children:Object(N.jsxs)("div",{className:"date-time-widget-wrapper",children:[Object(N.jsx)("div",{className:b()("ui input date-input",{"default-date":this.state.isDefault}),children:Object(N.jsx)(d,k(k({date:l,disabled:this.props.isDisabled,onDateChange:this.onDateChange,focused:this.state.focused,numberOfMonths:1},a?{}:{isOutsideRange:()=>!1}),{},{onFocusChange:this.onFocusChange,noBorder:!0,displayFormat:r.localeData(n.locale).longDateFormat("L"),navPrev:Object(N.jsx)(V,{}),navNext:Object(N.jsx)(F,{}),id:t+"-date",placeholder:n.formatMessage(E.date)}))}),!c&&Object(N.jsx)("div",{className:b()("ui input time-input",{"default-date":this.state.isDefault}),children:Object(N.jsx)(T,{disabled:this.props.isDisabled,defaultValue:l,value:l,onChange:this.onTimeChange,allowEmpty:!1,showSecond:!1,use12Hours:"en"===n.locale,id:t+"-time",format:r.localeData(n.locale).longDateFormat("LT"),placeholder:n.formatMessage(E.time),focusOnOpen:!0,placement:"bottomRight"})}),s&&Object(N.jsx)("button",{disabled:this.props.isDisabled||!l,onClick:()=>this.onResetDates(),className:"item ui noborder button",children:Object(N.jsx)(O.jb,{name:S.a,size:"24px",className:"close"})})]})}))}}G.defaultProps={description:null,required:!1,error:[],dateOnly:!1,noPastDates:!1,value:null,resettable:!0},t.default=Object(r.compose)(Object(f.a)(["reactDates","moment"]),u.c)(G)},gX4G:function(e,t,s){}}]);
|
|
2
|
+
//# sourceMappingURL=plone-volto-components-manage-Widgets-DatetimeWidget.c6a47163.chunk.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[10],{dHAx:function(e,t,c){"use strict";c.r(t);var n=c("lSNA"),s=c.n(n),r=c("q1tI"),i=c.n(r),o=(c("17x9"),c("zpb6")),a=c("5XkN"),j=c("+6Dn"),l=c("2j9a"),b=c("Kvkj"),O=c("nKUr");function d(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function m(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?d(Object(c),!0).forEach((function(t){s()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}const u=({content:e})=>Object(O.jsxs)(i.a.Fragment,{children:[e.title&&Object(O.jsx)("h1",{className:"documentFirstHeading",children:e.title}),e.description&&Object(O.jsx)("p",{className:"documentDescription",children:e.description}),e.image&&Object(O.jsx)(a.a,{className:"document-image",src:e.image.scales.thumb.download,floated:"right"}),e.text&&Object(O.jsx)("div",{dangerouslySetInnerHTML:{__html:Object(o.p)(e.text.data)}})]});t.default=e=>{const{content:t}=e;return Object(O.jsx)("div",{id:"page-document",className:"ui container viewwrapper event-view",children:Object(O.jsxs)(j.a,{children:[Object(O.jsx)(j.a.Column,{width:7,className:"mobile hidden",children:Object(o.I)(t)?Object(O.jsx)(l.a,m({},e)):Object(O.jsx)(u,m({},e))}),Object(O.jsx)(j.a.Column,{width:5,className:"mobile hidden",children:Object(O.jsx)(b.
|
|
2
|
-
//# sourceMappingURL=plone-volto-components-theme-View-EventView.
|
|
1
|
+
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[10],{dHAx:function(e,t,c){"use strict";c.r(t);var n=c("lSNA"),s=c.n(n),r=c("q1tI"),i=c.n(r),o=(c("17x9"),c("zpb6")),a=c("5XkN"),j=c("+6Dn"),l=c("2j9a"),b=c("Kvkj"),O=c("nKUr");function d(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}function m(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?d(Object(c),!0).forEach((function(t){s()(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}const u=({content:e})=>Object(O.jsxs)(i.a.Fragment,{children:[e.title&&Object(O.jsx)("h1",{className:"documentFirstHeading",children:e.title}),e.description&&Object(O.jsx)("p",{className:"documentDescription",children:e.description}),e.image&&Object(O.jsx)(a.a,{className:"document-image",src:e.image.scales.thumb.download,floated:"right"}),e.text&&Object(O.jsx)("div",{dangerouslySetInnerHTML:{__html:Object(o.p)(e.text.data)}})]});t.default=e=>{const{content:t}=e;return Object(O.jsx)("div",{id:"page-document",className:"ui container viewwrapper event-view",children:Object(O.jsxs)(j.a,{children:[Object(O.jsx)(j.a.Column,{width:7,className:"mobile hidden",children:Object(o.I)(t)?Object(O.jsx)(l.a,m({},e)):Object(O.jsx)(u,m({},e))}),Object(O.jsx)(j.a.Column,{width:5,className:"mobile hidden",children:Object(O.jsx)(b.Y,{content:t})}),Object(O.jsx)(j.a.Column,{width:12,only:"mobile",children:Object(o.I)(t)?Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)(l.a,m(m({},e),{},{content:m(m({},t),{},{blocks_layout:{items:e.content.blocks_layout.items.slice(0,1)}})})),Object(O.jsx)(b.Y,{content:t,display_as:"div"}),Object(O.jsx)(l.a,m(m({},e),{},{content:m(m({},t),{},{blocks_layout:{items:e.content.blocks_layout.items.slice(1)}})}))]}):Object(O.jsx)(u,m({},e))})]})})}}}]);
|
|
2
|
+
//# sourceMappingURL=plone-volto-components-theme-View-EventView.d0a7e38a.chunk.js.map
|
package/dist/public/static/js/{react-select.43f17559.chunk.js → react-select.6ac1d612.chunk.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[2],{"f/pJ":function(e,t,a){"use strict";a.r(t),a.d(t,"DatetimeWidgetComponent",(function(){return q}));var s=a("lSNA"),n=a.n(s),r=a("q1tI"),l=a.n(r),i=a("ANjH"),d=a("17x9"),o=a.n(d),c=a("lHu7"),u=a.n(c),h=a("zSVi"),b=a("MKeS"),y=a("TSYQ"),j=a.n(y),m=a("Kvkj"),f=a("zpb6"),O=a("Lf35"),p=a("GWVt"),g=a.n(p),v=a("6fhb"),x=a.n(v),M=a("1Jxj"),w=a.n(M),k=a("gX4G"),D=a.n(k),E=a("GG7f"),C=a.n(E),S=a("P+y9"),F=a.n(S),T=a("nKUr"),Y=a.n(T);function _(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function R(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?_(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):_(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const A=Object(b.a)({resolved:{},chunkName:()=>"rc-time-picker",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.all([a.e(4),a.e(6),a.e(5)]).then(a.bind(null,"+sk9")),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){const t=this.resolve(e);return a(t)},resolve(){return"+sk9"}}),N=Object(c.defineMessages)({date:{id:"Date",defaultMessage:"Date"},time:{id:"Time",defaultMessage:"Time"}}),P=()=>Object(T.jsx)("div",{style:{color:"#000",left:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0",children:Object(T.jsx)(m.ib,{name:g.a,size:"30px"})}),I=()=>Object(T.jsx)("div",{style:{color:"#000",right:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0",children:Object(T.jsx)(m.ib,{name:x.a,size:"30px"})}),L={hour:12,minute:0,second:0};class q extends r.Component{constructor(e){var t;super(e),n()(this,"onDateChange",e=>{if(e){const t=this.props.moment.default,a=this.getDateOnly(),s=(this.getInternalValue()||t()).set(R({year:e.year(),month:e.month(),date:e.date()},a?L:{})),n=a?s.format("YYYY-MM-DD"):s.toISOString();this.props.onChange(this.props.id,n)}this.setState({isDefault:!1})}),n()(this,"onTimeChange",e=>{const t=this.props.moment.default;if(e){var a,s;const n=(this.getInternalValue()||t()).set({hours:null!==(a=null===e||void 0===e?void 0:e.hours())&&void 0!==a?a:0,minutes:null!==(s=null===e||void 0===e?void 0:e.minutes())&&void 0!==s?s:0,seconds:0}).toISOString();this.props.onChange(this.props.id,n)}}),n()(this,"onResetDates",()=>{this.setState({isDefault:!1}),this.props.onChange(this.props.id,null)}),n()(this,"onFocusChange",({focused:e})=>this.setState({focused:e})),this.moment=e.moment.default,this.state={focused:!1,isDefault:(null===(t=Object(f.T)(this.props.intl.locale,this.props.value,void 0,this.moment))||void 0===t?void 0:t.toISOString())===this.moment().utc().toISOString()}}getInternalValue(){return Object(f.T)(this.props.intl.locale,this.props.value,void 0,this.moment)}getDateOnly(){return this.props.dateOnly||"date"===this.props.widget}render(){var e;const{id:t,resettable:a,intl:s,reactDates:n,widgetOptions:r}=this.props,l=this.props.noPastDates||(null===r||void 0===r||null===(e=r.pattern_options)||void 0===e?void 0:e.noPastDates),i=this.props.moment.default,d=this.getInternalValue(),o=this.getDateOnly(),{SingleDatePicker:c}=n;return Object(T.jsx)(m.cb,R(R({},this.props),{},{children:Object(T.jsxs)("div",{className:"date-time-widget-wrapper",children:[Object(T.jsx)("div",{className:j()("ui input date-input",{"default-date":this.state.isDefault}),children:Object(T.jsx)(c,R(R({date:d,disabled:this.props.isDisabled,onDateChange:this.onDateChange,focused:this.state.focused,numberOfMonths:1},l?{}:{isOutsideRange:()=>!1}),{},{onFocusChange:this.onFocusChange,noBorder:!0,displayFormat:i.localeData(s.locale).longDateFormat("L"),navPrev:Object(T.jsx)(P,{}),navNext:Object(T.jsx)(I,{}),id:t+"-date",placeholder:s.formatMessage(N.date)}))}),!o&&Object(T.jsx)("div",{className:j()("ui input time-input",{"default-date":this.state.isDefault}),children:Object(T.jsx)(A,{disabled:this.props.isDisabled,defaultValue:d,value:d,onChange:this.onTimeChange,allowEmpty:!1,showSecond:!1,use12Hours:"en"===s.locale,id:t+"-time",format:i.localeData(s.locale).longDateFormat("LT"),placeholder:s.formatMessage(N.time),focusOnOpen:!0,placement:"bottomRight"})}),a&&Object(T.jsx)("button",{disabled:this.props.isDisabled||!d,onClick:()=>this.onResetDates(),className:"item ui noborder button",children:Object(T.jsx)(m.ib,{name:w.a,size:"24px",className:"close"})})]})}))}}q.defaultProps={description:null,required:!1,error:[],dateOnly:!1,noPastDates:!1,value:null,resettable:!0},t.default=Object(i.compose)(Object(O.a)(["reactDates","moment"]),h.c)(q)},vaF2:function(e,t,a){"use strict";a.r(t);var s=a("lSNA"),n=a.n(s),r=a("wEy/"),l=a.n(r),i=a("NIJN"),d=a.n(i),o=a("J2m7"),c=a.n(o),u=a("3WF5"),h=a.n(u),b=a("Y+p1"),y=a.n(b),j=a("q1tI"),m=a("17x9"),f=a.n(m),O=a("ANjH"),p=a("VbRK"),g=a("TSYQ"),v=a.n(g),x=a("lHu7"),M=a("zSVi"),w=a("vFsZ"),k=a("+6Dn"),D=a("MqQV"),E=a("3mGJ"),C=a("QetY"),S=a("fuXp"),F=a("aQu0"),T=a("Kvkj"),Y=a("Lf35"),_=a("Z5Td"),R=a.n(_),A=a("YIVY"),N=a.n(A),P=a("DQaE"),I=a.n(P);const L={MO:p.a.MO,TU:p.a.TU,WE:p.a.WE,TH:p.a.TH,FR:p.a.FR,SA:p.a.SA,SU:p.a.SU},q=[L.MO,L.TU,L.WE,L.TH,L.FR],W=[L.MO,L.FR],V={DAILY:"daily",MONDAYFRIDAY:"mondayfriday",WEEKDAYS:"weekdays",WEEKLY:"weekly",MONTHLY:"monthly",YEARLY:"yearly"},K={frequences:{[V.DAILY]:{rrule:p.a.DAILY,interval:!0},[V.MONDAYFRIDAY]:{rrule:p.a.WEEKLY},[V.WEEKDAYS]:{rrule:p.a.WEEKLY},[V.WEEKLY]:{rrule:p.a.WEEKLY,interval:!0,byday:!0},[V.MONTHLY]:{rrule:p.a.MONTHLY,interval:!0,bymonth:!0},[V.YEARLY]:{rrule:p.a.YEARLY,interval:!0,byyear:!0}}},U=e=>e.toISOString().split("T")[0],H=(e,t)=>{t.locale(e.locale);const a=Object(x.defineMessages)({every:{id:"rrule_every",defaultMessage:"every"},until:{id:"rrule_until",defaultMessage:"until"},for:{id:"rrule_for",defaultMessage:"for"},time:{id:"rrule_time",defaultMessage:"time"},times:{id:"rrule_times",defaultMessage:"times"},"(~ approximate)":{id:"rrule_approximate",defaultMessage:"(~approximate)"},hour:{id:"rrule_hour",defaultMessage:"hour"},hours:{id:"rrule_hours",defaultMessage:"hours"},minutes:{id:"rrule_minutes",defaultMessage:"minutes"},weekdays:{id:"rrule_weekdays",defaultMessage:"weekdays"},weekday:{id:"rrule_weekday",defaultMessage:"weekday"},day:{id:"rrule_day",defaultMessage:"day"},days:{id:"rrule_days",defaultMessage:"days"},in:{id:"rrule_in",defaultMessage:"in"},week:{id:"rrule_week",defaultMessage:"week"},weeks:{id:"rrule_weeks",defaultMessage:"weeks"},month:{id:"rrule_month",defaultMessage:"month"},months:{id:"rrule_months",defaultMessage:"months"},on:{id:"rrule_on",defaultMessage:"on"},year:{id:"rrule_year",defaultMessage:"year"},years:{id:"rrule_years",defaultMessage:"years"},"on the":{id:"rrule_on the",defaultMessage:"on the"},the:{id:"rrule_the",defaultMessage:"the"},and:{id:"rrule_and",defaultMessage:"and"},or:{id:"rrule_or",defaultMessage:"or"},at:{id:"rrule_at",defaultMessage:"at"},last:{id:"rrule_last",defaultMessage:"last"},st:{id:"rrule_st",defaultMessage:"st"},nd:{id:"rrule_nd",defaultMessage:"nd"},rd:{id:"rrule_rd",defaultMessage:"rd"},th:{id:"rrule_th",defaultMessage:"th"},dateFormat:{id:"rrule_dateFormat",defaultMessage:"[month] [day], [year]"}});let s={};Object.keys(a).map(t=>s[t]=e.formatMessage(a[t]));let n=s.dateFormat.replace(new RegExp("\\[","g"),"${").replace(new RegExp("\\]","g"),"}");return{dayNames:t.weekdays(),monthNames:t.months(),strings:s,dateFormatter:(e,t,a)=>n.replace(/\$\{year\}/g,e).replace(/\$\{month\}/g,t).replace(/\$\{day\}/g,a)}};var G=a("umxb"),z=a("nKUr");const $=({label:e,labelAfter:t,value:a,onChange:s})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"interval",children:e})})}),Object(z.jsx)(k.a.Column,{width:"8",children:Object(z.jsxs)(w.a.Field,{inline:!0,children:[Object(z.jsx)(G.a,{id:"interval",name:"interval",value:a||"",onChange:({target:e})=>{s(e.id,""===e.value?void 0:parseInt(e.value))}}),t&&Object(z.jsx)("span",{children:t})]})})]})})});$.defaultProps={label:null,labelAfter:null,onChange:null};var J=$,Q=a("52Oh");const Z=({label:e,value:t,onChange:a,moment:s})=>{const n=Object(Q.a)(),r=s.default;r.locale(n.locale);return Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"byday",children:e})})}),Object(z.jsx)(k.a.Column,{width:"8",children:Object(z.jsx)(C.a.Group,{basic:!0,className:"byday-field",children:Object.keys(L).map(e=>Object(z.jsx)(C.a,{active:(null===t||void 0===t?void 0:t.indexOf(L[e]))>=0,type:"button",content:r.weekdaysShort(L[e].weekday+1),onClick:()=>{(e=>{var s=L[e],n=t?[...t]:[],r=n.indexOf(s);r>=0?n.splice(r,1):n.push(s),a("byweekday",n)})(e)}},e))})})]})})})};Z.defaultProps={label:null,value:null,onChange:null};var B=Object(Y.a)(["moment"])(Z),X=a("/fAC"),ee=a("f/pJ");const te=Object(x.defineMessages)({recurrenceEnds:{id:"Recurrence ends",defaultMessage:"Ends"},recurrenceEndsCount:{id:"Recurrence ends after",defaultMessage:"after"},recurrenceEndsUntil:{id:"Recurrence ends on",defaultMessage:"on"},occurrences:{id:"Occurences",defaultMessage:"occurrence(s)"}}),ae=({value:e,count:t,until:a,onChange:s,intl:n})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"recurrenceEnds",children:n.formatMessage(te.recurrenceEnds)})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"recurrenceEnds",id:"recurrenceEndsCount",value:"count",checked:"count"===e,onChange:(e,{value:t})=>s("recurrenceEnds",t)})}),Object(z.jsx)(w.a.Field,{disabled:"count"!==e,children:n.formatMessage(te.recurrenceEndsCount)}),Object(z.jsx)(w.a.Field,{disabled:"count"!==e,children:Object(z.jsx)(G.a,{id:"count",name:"count",value:t||"",onChange:({target:e})=>{s(e.id,""===e.value?void 0:e.value)}})}),Object(z.jsx)(w.a.Field,{disabled:"count"!==e,children:n.formatMessage(te.occurrences)})]}),Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{id:"recurrenceEndsUntil",label:"",name:"recurrenceEnds",value:"until",checked:"until"===e,onChange:(e,{value:t})=>s("recurrenceEnds",t)})}),Object(z.jsx)(w.a.Field,{disabled:"until"!==e,children:Object(z.jsx)(ee.default,{id:"until",title:n.formatMessage(te.recurrenceEndsUntil),dateOnly:!0,value:a||"",resettable:!1,onChange:(e,t)=>{s(e,""===t?void 0:t)}})})]})]})]})})});ae.defaultProps={value:null,count:null,until:null,onChange:null};var se=Object(M.c)(ae);const ne=Object(x.defineMessages)({bymonthDay:{id:"Month day",defaultMessage:"Day"},ofTheMonth:{id:"of the month",defaultMessage:"of the month"}}),re=({value:e,disabled:t,onChange:a,hideAfterLabel:s,intl:n})=>Object(z.jsxs)(z.Fragment,{children:[Object(z.jsx)(w.a.Field,{inline:!0,disabled:t,children:n.formatMessage(ne.bymonthDay)}),Object(z.jsx)(w.a.Field,{inline:!0,disabled:t,children:Object(z.jsx)(G.a,{type:"number",id:"bymonthday",name:"bymonthday",value:e||"",onChange:({target:e})=>{a(e.id,""===e.value?void 0:[parseInt(e.value)])}})}),!s&&Object(z.jsx)(w.a.Field,{inline:!0,disabled:t,children:n.formatMessage(ne.ofTheMonth)})]});re.defaultProps={disabled:!1,value:null,onChange:null,hideAfterLabel:!1};var le=Object(M.c)(re),ie=a("y2Vs"),de=a("cuOu");function oe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function ce(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):oe(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const ue=({name:e,disabled:t,options:a,value:s,onChange:n})=>{const r=ce(ce({},de.g),{},{control:(e,t)=>ce(ce({},de.g.control(e,t)),{},{minWidth:"130px"})}),l=(e,t)=>{const a=c()(e,e=>e.value===t);return a||{}};return Object(z.jsx)(ie.default,{isDisabled:t,id:e,name:e,className:"react-select-container",classNamePrefix:"react-select",defaultValue:l(a,s),value:l(a,s),options:a,styles:r,theme:de.h,components:{DropdownIndicator:de.b,Option:de.d},onChange:t=>n(e,t.value)})};ue.defaultProps={name:"select",options:[],disabled:!1,value:null,onChange:null};var he=ue;function be(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function ye(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?be(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):be(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const je=Object(x.defineMessages)({bymonthDayNumber:{id:"Weeek day of month",defaultMessage:"The"},first:{id:"First",defaultMessage:"First"},second:{id:"Second",defaultMessage:"Second"},third:{id:"Third",defaultMessage:"Third"},fourth:{id:"Fourth",defaultMessage:"Fourth"},last:{id:"Last",defaultMessage:"Last"}}),me={1:"first",2:"second",3:"third",4:"fourth","-1":"last"};class fe extends j.Component{render(){const{intl:e,disabled:t}=this.props,a=[...h()(Object.keys(me),t=>({value:parseInt(t),label:e.formatMessage(je[me[t]])}))];return Object(z.jsxs)(z.Fragment,{children:[Object(z.jsx)(w.a.Field,{disabled:t,children:e.formatMessage(je.bymonthDayNumber)}),Object(z.jsx)(w.a.Field,{disabled:t,children:Object(z.jsx)(he,ye({name:"weekdayOfTheMonthIndex",options:a},this.props))})]})}}n()(fe,"defaultProps",{disabled:!1,value:null,onChange:null});var Oe=Object(M.c)(fe);function pe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function ge(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):pe(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var ve=Object(Y.a)(["moment"])(e=>{const{disabled:t=!1,moment:a}=e,s=Object(Q.a)(),n=a.default;n.locale(s.locale);const r=[...h()(Object.keys(L),e=>({value:L[e].weekday,label:n.weekdays(L[e].weekday+1)}))];return Object(z.jsx)(w.a.Field,{disabled:t,children:Object(z.jsx)(he,ge({name:"weekdayOfTheMonth",options:r},e))})});const xe=({label:e,value:t,bymonthday:a,weekdayOfTheMonthIndex:s,weekdayOfTheMonth:n,onChange:r,intl:l})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"monthly",children:e})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"monthly",id:"monthly-bymonthday",value:"bymonthday",checked:"bymonthday"===t,onChange:(e,{value:t})=>r("monthly",t)})}),Object(z.jsx)(le,{value:a,disabled:"bymonthday"!==t,onChange:r})]}),Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"monthly",id:"monthly-byweekday",value:"byweekday",checked:"byweekday"===t,onChange:(e,{value:t})=>r("monthly",t)})}),Object(z.jsx)(Oe,{disabled:"byweekday"!==t,value:s,onChange:r}),Object(z.jsx)(ve,{disabled:"byweekday"!==t,value:n,onChange:r})]})]})]})})});xe.defaultProps={label:null,value:null,bymonthday:null,weekdayOfTheMonthIndex:null,weekdayOfTheMonth:null,onChange:null};var Me=Object(M.c)(xe);const we=({value:e,disabled:t,inline:a,onChange:s,moment:n})=>{const r=n.default,l=Object(Q.a)();r.locale(l.locale);const i=[...h()(r.months(),(e,t)=>({value:t+1,label:e}))];return Object(z.jsx)(w.a.Field,{inline:a,disabled:t,children:Object(z.jsx)(he,{name:"monthOfTheYear",disabled:t,options:i,value:e,onChange:s})})};we.defaultProps={value:null,disabled:!1,inline:!1,onChange:null};var ke=Object(Y.a)(["moment"])(we);const De=Object(x.defineMessages)({ofTheMonth:{id:"of the month",defaultMessage:"of the month"}}),Ee=({label:e,value:t,bymonthday:a,monthOfTheYear:s,weekdayOfTheMonthIndex:n,weekdayOfTheMonth:r,onChange:l,intl:i})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text byyear-field",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"yearly",children:e})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[Object(z.jsxs)(w.a.Group,{inline:!0,className:"byyear-bymonthday",children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"yearly",value:"bymonthday",id:"yearly-bymonthday",checked:"bymonthday"===t,onChange:(e,{value:t})=>l("yearly",t)})}),Object(z.jsx)(le,{value:a,disabled:"bymonthday"!==t,onChange:l,hideAfterLabel:!0}),Object(z.jsx)(ke,{value:s,disabled:"bymonthday"!==t,onChange:l})]}),Object(z.jsxs)(w.a.Group,{inline:!0,className:"byyear-byday",children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"yearly",id:"yearly-byday",value:"byday",checked:"byday"===t,onChange:(e,{value:t})=>l("yearly",t)})}),Object(z.jsx)(Oe,{disabled:"byday"!==t,value:n,onChange:l}),Object(z.jsx)(ve,{disabled:"byday"!==t,value:r,onChange:l}),Object(z.jsx)(w.a.Field,{disabled:"byday"!==t,children:i.formatMessage(De.ofTheMonth)}),Object(z.jsx)(ke,{value:s,disabled:"byday"!==t,onChange:l,inline:!1})]})]})]})})});Ee.defaultProps={label:null,value:null,bymonthday:null,monthOfTheYear:null,weekdayOfTheMonthIndex:null,weekdayOfTheMonth:null,onChange:null};var Ce=Object(M.c)(Ee),Se=a("WYlG"),Fe=a("lV3b"),Te=a.n(Fe);const Ye=Object(x.defineMessages)({selected_dates:{id:"Selected dates",defaultMessage:"Selected dates"},start_of_recurrence:{id:"Start of the recurrence",defaultMessage:"Start of the recurrence"},additional_date:{id:"Additional date",defaultMessage:"Additional date"},other_items:{id:"others",defaultMessage:"others"},no_occurences:{id:"No occurences set",defaultMessage:"No occurences set"},exclude:{id:"Exclude this occurence",defaultMessage:"Exclude this occurence"},include:{id:"Include this occurence",defaultMessage:"Include this occurence"}}),_e=(e,t)=>{const a=t(e);return a.format("dddd")+", "+a.format("LL")},Re=Object(Y.a)(["moment"])(({rruleSet:e,exclude:t,undoExclude:a,intl:s,showTitle:n,editOccurences:r,moment:l})=>{const i=l.default;i.locale(s.locale);let d=[];const o=t=>{var a=U(t),s=!1;return e.rdates().forEach(e=>{U(e)===a&&(s=!0)}),s};e&&(d=e.all(),e.exdates().forEach(e=>{d.indexOf(e)<0&&d.push(e)}),d.sort((e,t)=>e>t?1:-1));const c=d.splice(100);return Object(z.jsxs)("div",{className:"occurences",children:[0===d.length&&Object(z.jsx)(z.Fragment,{children:s.formatMessage(Ye.no_occurences)}),n&&Object(z.jsx)(F.a,{as:"h2",children:s.formatMessage(Ye.selected_dates)}),Object(z.jsxs)(Se.a,{divided:!0,verticalAlign:"middle",children:[d.map((n,l)=>{const d=(t=>{var a=U(t),s=!1;return e.exdates().forEach(e=>{U(e)===a&&(s=!0)}),s})(n);return Object(z.jsxs)(Se.a.Item,{children:[r&&Object(z.jsx)(Se.a.Content,{floated:"right",children:l>0?Object(z.jsxs)(z.Fragment,{children:[!d&&Object(z.jsx)(C.a,{basic:!0,icon:!0,className:"exclude-button",onClick:()=>{t(n)},"aria-label":s.formatMessage(Ye.exclude),children:Object(z.jsx)(T.ib,{name:I.a,size:"18px"})}),d&&Object(z.jsx)(C.a,{basic:!0,icon:!0,className:"include-button",onClick:()=>{a(n)},"aria-label":s.formatMessage(Ye.include),children:Object(z.jsx)(T.ib,{name:Te.a,size:"24px"})})]}):s.formatMessage(Ye.start_of_recurrence)}),Object(z.jsxs)(Se.a.Content,{className:v()({excluded:d}),children:[_e(n,i),o(n)&&Object(z.jsx)(D.a,{pointing:"left",size:"small",color:d?"grey":"green",children:s.formatMessage(Ye.additional_date)})]})]},n.toString())}),c.length>0&&Object(z.jsx)(Se.a.Item,{children:Object(z.jsx)(Se.a.Content,{children:`... ${s.formatMessage(Ye.other_items)} ${c.length}`})})]})]})});Re.propTypes={rruleSet:f.a.any,showTitle:f.a.bool,editOccurences:f.a.bool},Re.defaultProps={rruleSet:null,showTitle:!0,editOccurences:!0};var Ae=Object(M.c)(Re);function Ne(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function Pe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ne(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const Ie=Object(x.defineMessages)({editRecurrence:{id:"Edit recurrence",defaultMessage:"Edit recurrence"},save:{id:"Save recurrence",defaultMessage:"Save"},remove:{id:"Remove recurrence",defaultMessage:"Remove"},repeat:{id:"Repeat",defaultMessage:"Repeat"},daily:{id:"Daily",defaultMessage:"Daily"},mondayfriday:{id:"Monday and Friday",defaultMessage:"Monday and Friday"},weekdays:{id:"Weekday",defaultMessage:"Weekday"},weekly:{id:"Weekly",defaultMessage:"Weekly"},monthly:{id:"Monthly",defaultMessage:"Monthly"},yearly:{id:"Yearly",defaultMessage:"Yearly"},repeatEvery:{id:"Repeat every",defaultMessage:"Repeat every"},repeatOn:{id:"Repeat on",defaultMessage:"Repeat on"},interval_daily:{id:"Interval Daily",defaultMessage:"days"},interval_weekly:{id:"Interval Weekly",defaultMessage:"week(s)"},interval_monthly:{id:"Interval Monthly",defaultMessage:"Month(s)"},interval_yearly:{id:"Interval Yearly",defaultMessage:"year(s)"},add_date:{id:"Add date",defaultMessage:"Add date"},select_date_to_add_to_recurrence:{id:"Select a date to add to recurrence",defaultMessage:"Select a date to add to recurrence"}}),Le=["recurrenceEnds","monthly","weekdayOfTheMonthIndex","weekdayOfTheMonth","yearly","monthOfTheYear","byhour","byminute","bysecond","bynmonthday","exdates","rdates"];class qe extends j.Component{constructor(e,t){super(e),n()(this,"editRecurrence",()=>{this.setRecurrenceStartEnd()}),n()(this,"setRecurrenceStartEnd",()=>{var e;const t=null===(e=this.props.formData)||void 0===e?void 0:e.start;let a=this.getUTCDate(t).startOf("day").toDate();this.setState(e=>{let t=e.rruleSet;const s=this.getFormValues(t);return t=this.updateRruleSet(t,s,"dtstart",a),Pe(Pe({},e),{},{rruleSet:t,formValues:s})})}),n()(this,"getUTCDate",e=>e.match(/T(.)*(-|\+|Z)/g)?this.moment(e).utc():this.moment(e+"Z").utc()),n()(this,"show",e=>()=>{this.setState({dimmer:e,open:!0}),this.editRecurrence()}),n()(this,"close",()=>this.setState({open:!1})),n()(this,"getFreq",(e,t)=>{let a=V.DAILY;return Object.entries(K.frequences).forEach(([t,s])=>{s.rrule===e&&(a=t)}),a===V.WEEKLY&&t&&y()(t.sort(),q.map(e=>e.weekday).sort())&&(a=V.WEEKDAYS),a}),n()(this,"getWeekday",e=>{var t=null;const a=-1===e?6:e;return Object.keys(L).forEach(e=>{L[e].weekday===a&&(t=L[e])}),t}),n()(this,"getFormValues",e=>{var t;let a={freq:V.DAILY,interval:1};a=this.changeField(a,"recurrenceEnds",null!==(t=this.props.formData)&&void 0!==t&&t.end?"until":"count");const s=e.rrules()[0];if(s){var n=this.getFreq(s.options.freq,s.options.byweekday);Object.entries(s.options).forEach(([e,t])=>{switch(e){case"freq":a[e]=n;break;case"count":null!=t&&(a.recurrenceEnds=e,a[e]=t);break;case"until":null!=t&&(a.recurrenceEnds=e,a[e]=U(t));break;case"byweekday":t&&t.length>0&&(y()(t,q)&&(a.freq=V.WEEKDAYS),y()(t,W)&&(a.freq=V.MONDAYFRIDAY)),a[e]=t?t.map(e=>this.getWeekday(e)):[];break;case"bymonthday":t&&t.length>0?(n===V.MONTHLY&&(a.monthly=e),n===V.YEARLY&&(a.yearly=e)):(n===V.MONTHLY&&(a.monthly=null),n===V.YEARLY&&(a.yearly=null)),a[e]=t;break;case"bynweekday":t&&t.length>0&&(n===V.SMONTHLY&&(a.monthly="byweekday"),n===V.YEARLY&&(a.yearly="byday"),a.weekdayOfTheMonth=t[0][0],a.weekdayOfTheMonthIndex=t[0][1]);break;case"bymonth":n===V.YEARLY&&(a.yearly="byday"),a.monthOfTheYear=t?t[0]:null;break;default:a[e]=t}})}return a}),n()(this,"formValuesToRRuleOptions",e=>{var t=Object.assign({},e);return Le.forEach(e=>{delete t[e]}),Object.keys(t).forEach(e=>{var a=t[e];switch(e){case"freq":a&&(a=K.frequences[a].rrule);break;case"until":a=a?this.moment(new Date(a)).utc().toDate():null}a?t[e]=a:delete t[e]}),t}),n()(this,"updateRruleSet",(e,t,a,s)=>{var n=this.formValuesToRRuleOptions(t),r="dtstart"===a?s:e.dtstart()?e.dtstart():this.moment().utc().toDate(),l="exdates"===a?s:Object.assign([],e.exdates()),i="rdates"===a?s:Object.assign([],e.rdates());n.dtstart=r;let d=new p.b;return d.rrule(new p.a(n)),l.map(e=>d.exdate(e)),i.map(e=>d.rdate(e)),d}),n()(this,"getDefaultUntil",e=>{var t;const a=this.moment;var s=null!==(t=this.props.formData)&&void 0!==t&&t.end?U(this.getUTCDate(this.props.formData.end).toDate()):null,n=U(a().add(1,"days").utc().toDate()),r=U(a().add(7,"days").utc().toDate()),l=U(a().add(1,"months").utc().toDate()),i=U(a().add(1,"years").utc().toDate()),d=s;switch(e){case V.DAILY:d=s||n;break;case V.WEEKLY:case V.WEEKDAYS:case V.MONDAYFRIDAY:d=s||r;break;case V.MONTHLY:d=s||l;break;case V.YEARLY:d=s||i}return d}),n()(this,"changeField",(e,t,a)=>{var s,n,r,l,i;const d=this.moment,o=(null===(s=this.state)||void 0===s||null===(n=s.rruleSet)||void 0===n?void 0:n.rrules().length)>0?this.state.rruleSet.rrules()[0].origOptions.byweekday:null,c=this.getWeekday(d().day()-1),u=d().month()+1,h=null!==(r=this.props.formData)&&void 0!==r&&r.start?d(this.props.formData.start).month()+1:u,b=null!==(l=this.props.formData)&&void 0!==l&&l.start?this.getWeekday(d(this.props.formData.start).day()-1):c;e[t]=a;const y=null!==(i=this.props.formData)&&void 0!==i&&i.start?d(this.props.formData.start).date():d().date();switch(t){case"freq":e.interval=1;switch(K.frequences[a].interval||(e.interval=null),e=this.changeField(e,"byweekday",null),e=this.changeField(e,"yearly",null),e=this.changeField(e,"bymonthday",null),e=this.changeField(e,"byweekday",null),(e=this.changeField(e,"monthOfTheYear",null)).until||(e.until=this.getDefaultUntil(a)),a){case V.DAILY:break;case V.WEEKDAYS:e=this.changeField(e,"byweekday",q);break;case V.MONDAYFRIDAY:e=this.changeField(e,"byweekday",W);break;case V.WEEKLY:e=this.changeField(e,"byweekday",[b]);break;case V.MONTHLY:e=this.changeField(e,"monthly","bymonthday");break;case V.YEARLY:e=this.changeField(e,"yearly","bymonthday")}break;case"recurrenceEnds":"count"===a&&(e.count=1,e.until=null),"until"===a&&(e.until=this.getDefaultUntil(e.freq),e.count=null);break;case"byweekday":e.byweekday=a,V.WEEKLY!==e.freq?(e.weekdayOfTheMonth=a?a[0].weekday:null,e.weekdayOfTheMonthIndex=a?a[0].n:null):(delete e.weekdayOfTheMonth,delete e.weekdayOfTheMonthIndex);break;case"weekdayOfTheMonth":var j=this.getWeekday(a),m=o?o[0].n:1;e.byweekday=j?[j.nth(m)]:null;break;case"weekdayOfTheMonthIndex":var f=o?o[0]:c;e.byweekday=a?[f.nth(a)]:null;break;case"monthOfTheYear":null===a||void 0===a?delete e.bymonth:e.bymonth=[a];break;case"monthly":"bymonthday"===a&&(e.bymonthday=[y],e=this.changeField(e,"byweekday",null)),"byweekday"===a&&(e.bymonthday=null,e=this.changeField(e,"byweekday",[c.nth(1)])),null===a&&(e=this.changeField(e,"bymonthday",null),e=this.changeField(e,"byweekday",null));break;case"yearly":"bymonthday"===a&&(e.bymonthday=[y],e=this.changeField(e,"monthOfTheYear",h),e=this.changeField(e,"byweekday",null)),"byday"===a&&(e=this.changeField(e,"bymonthday",null),e=this.changeField(e,"byweekday",[b.nth(1)]),e=this.changeField(e,"monthOfTheYear",h))}return e}),n()(this,"onChangeRule",(e,t)=>{var a=Object.assign({},this.state.formValues);a=this.changeField(a,e,t),this.setState(s=>{var n=s.rruleSet;return n=this.updateRruleSet(n,a,e,t),Pe(Pe({},s),{},{rruleSet:n,formValues:a})})}),n()(this,"exclude",e=>{let t=this.state.rruleSet.exdates().slice(0);t.push(e),this.onChangeRule("exdates",t)}),n()(this,"undoExclude",e=>{let t=this.state.rruleSet.exdates().slice(0);l()(t,t=>t.getTime()===e.getTime()),this.onChangeRule("exdates",t)}),n()(this,"addDate",e=>{const t=this.moment;let a=d()(this.state.rruleSet.all(),this.state.rruleSet.exdates());var s=t(new Date(e)).startOf("day").toDate().getTime();if(!c()(a,e=>t(e).startOf("day").toDate().getTime()===s)){let t=this.state.rruleSet.rdates().slice(0);t.push(new Date(e)),this.onChangeRule("rdates",t)}}),n()(this,"save",()=>{var e=this.state.rruleSet.toString();this.props.onChange(this.props.id,e),this.close()}),n()(this,"remove",()=>{this.props.onChange(this.props.id,null);let e=new p.b;this.setState({rruleSet:e,formValues:this.getFormValues(e)})}),this.moment=this.props.moment.default,this.moment.locale(this.props.intl.locale);let a=this.props.value?Object(p.d)(e.value,{compatible:!0,forceset:!0}):new p.b;this.state={open:!1,rruleSet:a,formValues:this.getFormValues(a),RRULE_LANGUAGE:H(this.props.intl,this.moment)}}componentDidMount(){this.props.value&&this.setRecurrenceStartEnd()}componentDidUpdate(e){var t,a;if(this.props.value&&(null===(t=e.formData)||void 0===t?void 0:t.start)!==(null===(a=this.props.formData)||void 0===a?void 0:a.start)){var s;let e=this.getUTCDate(null===(s=this.props.formData)||void 0===s?void 0:s.start).startOf("day").toDate();this.setState(t=>{let a=t.rruleSet;return a=this.updateRruleSet(a,t.formValues,"dtstart",e),Pe(Pe({},t),{},{rruleSet:a})})}}render(){var e;const{open:t,dimmer:a,rruleSet:s,formValues:n,RRULE_LANGUAGE:r}=this.state,{id:l,title:i,required:d,description:o,error:c,fieldSet:u,intl:b}=this.props;return Object(z.jsx)(w.a.Field,{inline:!0,required:d,error:c.length>0,className:v()("recurrence-widget",o?"help":""),id:`${u||"field"}-${l}`,children:Object(z.jsxs)(k.a,{children:[Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"field-"+l,children:i})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[s.rrules()[0]&&Object(z.jsxs)(z.Fragment,{children:[Object(z.jsx)(D.a,{children:null===(e=s.rrules()[0])||void 0===e?void 0:e.toText(e=>r.strings[e],r,r.dateFormatter)}),Object(z.jsx)(E.a,{children:Object(z.jsx)(Ae,{rruleSet:s,exclude:this.exclude,undoExclude:this.undoExclude,showTitle:!1,editOccurences:!1})})]}),Object(z.jsxs)("div",{children:[Object(z.jsx)(C.a,{basic:!0,disabled:this.props.isDisabled,color:"blue",className:"edit-recurrence",onClick:this.show("blurring"),type:"button","aria-label":b.formatMessage(Ie.editRecurrence),children:Object(z.jsx)(T.ib,{name:N.a,size:"20px",title:b.formatMessage(Ie.editRecurrence)})}),this.props.value&&Object(z.jsx)(C.a,{basic:!0,color:"pink",className:"remove-recurrence",onClick:()=>{this.remove()},type:"button","aria-label":b.formatMessage(Ie.remove),children:Object(z.jsx)(T.ib,{name:I.a,size:"20px",title:b.formatMessage(Ie.remove)})})]}),Object(z.jsxs)(S.a,{dimmer:a,open:t,onClose:this.close,className:"recurrence-form",closeIcon:!0,children:[Object(z.jsxs)(S.a.Header,{children:[b.formatMessage(Ie.editRecurrence)," "]}),Object(z.jsx)(S.a.Content,{scrolling:!0,children:s.rrules().length>0&&Object(z.jsxs)(S.a.Description,{children:[Object(z.jsx)(E.a,{children:Object(z.jsxs)(w.a,{children:[Object(z.jsx)(T.Kb,{id:"freq",title:b.formatMessage(Ie.repeat),getVocabulary:()=>{},getVocabularyTokenTitle:()=>{},choices:Object.keys(K.frequences).map(e=>[e,b.formatMessage(Ie[e])]),value:n.freq,onChange:this.onChangeRule}),K.frequences[n.freq].interval&&Object(z.jsx)(J,{label:b.formatMessage(Ie.repeatEvery),labelAfter:n.freq&&b.formatMessage(Ie["interval_"+n.freq]),value:n.interval,onChange:this.onChangeRule}),K.frequences[n.freq].byday&&Object(z.jsx)(B,{label:b.formatMessage(Ie.repeatOn),value:n.byweekday,onChange:this.onChangeRule}),K.frequences[n.freq].bymonth&&Object(z.jsx)(Me,{label:b.formatMessage(Ie.repeatOn),value:n.monthly,bymonthday:n.bymonthday,weekdayOfTheMonthIndex:n.weekdayOfTheMonthIndex,weekdayOfTheMonth:n.weekdayOfTheMonth,onChange:this.onChangeRule}),K.frequences[n.freq].byyear&&Object(z.jsx)(Ce,{label:b.formatMessage(Ie.repeatOn),value:n.yearly,bymonthday:n.bymonthday,monthOfTheYear:n.monthOfTheYear,weekdayOfTheMonthIndex:n.weekdayOfTheMonthIndex,weekdayOfTheMonth:n.weekdayOfTheMonth,onChange:this.onChangeRule}),Object(z.jsx)(se,{value:n.recurrenceEnds,count:n.count,until:n.until,onChange:this.onChangeRule})]})}),Object(z.jsx)(E.a,{children:Object(z.jsx)(Ae,{rruleSet:s,exclude:this.exclude,undoExclude:this.undoExclude})}),Object(z.jsxs)(E.a,{children:[Object(z.jsx)(F.a,{as:"h2",children:b.formatMessage(Ie.add_date)}),Object(z.jsx)(T.O,{id:"addDate",title:b.formatMessage(Ie.select_date_to_add_to_recurrence),dateOnly:!0,noPastDates:!0,onChange:(e,t)=>{this.addDate(""===t?void 0:t)}})]})]})}),Object(z.jsx)(S.a.Actions,{children:Object(z.jsx)(C.a,{className:"save",basic:!0,onClick:()=>{this.save()},"aria-label":b.formatMessage(Ie.save),children:Object(z.jsx)(T.ib,{name:R.a,className:"circled",size:"30px",title:b.formatMessage(Ie.save)})})})]}),h()(c,e=>Object(z.jsx)(D.a,{basic:!0,color:"red",pointing:!0,children:e},e))]})]}),o&&Object(z.jsx)(k.a.Row,{stretched:!0,children:Object(z.jsx)(k.a.Column,{stretched:!0,width:"12",children:Object(z.jsx)("p",{className:"help",children:o})})})]})})}}n()(qe,"defaultProps",{description:null,required:!1,error:[],value:null});t.default=Object(O.compose)(Object(Y.a)(["moment"]),M.c)(qe)}}]);
|
|
2
|
-
//# sourceMappingURL=react-select.
|
|
1
|
+
(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[2],{"f/pJ":function(e,t,a){"use strict";a.r(t),a.d(t,"DatetimeWidgetComponent",(function(){return q}));var s=a("lSNA"),n=a.n(s),r=a("q1tI"),l=a.n(r),i=a("ANjH"),d=a("17x9"),o=a.n(d),c=a("lHu7"),u=a.n(c),h=a("zSVi"),b=a("MKeS"),y=a("TSYQ"),j=a.n(y),m=a("Kvkj"),f=a("zpb6"),O=a("Lf35"),p=a("GWVt"),g=a.n(p),v=a("6fhb"),x=a.n(v),M=a("1Jxj"),w=a.n(M),k=a("gX4G"),D=a.n(k),E=a("GG7f"),C=a.n(E),S=a("P+y9"),F=a.n(S),T=a("nKUr"),Y=a.n(T);function _(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function R(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?_(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):_(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const A=Object(b.a)({resolved:{},chunkName:()=>"rc-time-picker",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.all([a.e(4),a.e(6),a.e(5)]).then(a.bind(null,"+sk9")),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then(e=>(this.resolved[t]=!0,e))},requireSync(e){const t=this.resolve(e);return a(t)},resolve(){return"+sk9"}}),N=Object(c.defineMessages)({date:{id:"Date",defaultMessage:"Date"},time:{id:"Time",defaultMessage:"Time"}}),P=()=>Object(T.jsx)("div",{style:{color:"#000",left:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0",children:Object(T.jsx)(m.jb,{name:g.a,size:"30px"})}),I=()=>Object(T.jsx)("div",{style:{color:"#000",right:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0",children:Object(T.jsx)(m.jb,{name:x.a,size:"30px"})}),L={hour:12,minute:0,second:0};class q extends r.Component{constructor(e){var t;super(e),n()(this,"onDateChange",e=>{if(e){const t=this.props.moment.default,a=this.getDateOnly(),s=(this.getInternalValue()||t()).set(R({year:e.year(),month:e.month(),date:e.date()},a?L:{})),n=a?s.format("YYYY-MM-DD"):s.toISOString();this.props.onChange(this.props.id,n)}this.setState({isDefault:!1})}),n()(this,"onTimeChange",e=>{const t=this.props.moment.default;if(e){var a,s;const n=(this.getInternalValue()||t()).set({hours:null!==(a=null===e||void 0===e?void 0:e.hours())&&void 0!==a?a:0,minutes:null!==(s=null===e||void 0===e?void 0:e.minutes())&&void 0!==s?s:0,seconds:0}).toISOString();this.props.onChange(this.props.id,n)}}),n()(this,"onResetDates",()=>{this.setState({isDefault:!1}),this.props.onChange(this.props.id,null)}),n()(this,"onFocusChange",({focused:e})=>this.setState({focused:e})),this.moment=e.moment.default,this.state={focused:!1,isDefault:(null===(t=Object(f.T)(this.props.intl.locale,this.props.value,void 0,this.moment))||void 0===t?void 0:t.toISOString())===this.moment().utc().toISOString()}}getInternalValue(){return Object(f.T)(this.props.intl.locale,this.props.value,void 0,this.moment)}getDateOnly(){return this.props.dateOnly||"date"===this.props.widget}render(){var e;const{id:t,resettable:a,intl:s,reactDates:n,widgetOptions:r}=this.props,l=this.props.noPastDates||(null===r||void 0===r||null===(e=r.pattern_options)||void 0===e?void 0:e.noPastDates),i=this.props.moment.default,d=this.getInternalValue(),o=this.getDateOnly(),{SingleDatePicker:c}=n;return Object(T.jsx)(m.db,R(R({},this.props),{},{children:Object(T.jsxs)("div",{className:"date-time-widget-wrapper",children:[Object(T.jsx)("div",{className:j()("ui input date-input",{"default-date":this.state.isDefault}),children:Object(T.jsx)(c,R(R({date:d,disabled:this.props.isDisabled,onDateChange:this.onDateChange,focused:this.state.focused,numberOfMonths:1},l?{}:{isOutsideRange:()=>!1}),{},{onFocusChange:this.onFocusChange,noBorder:!0,displayFormat:i.localeData(s.locale).longDateFormat("L"),navPrev:Object(T.jsx)(P,{}),navNext:Object(T.jsx)(I,{}),id:t+"-date",placeholder:s.formatMessage(N.date)}))}),!o&&Object(T.jsx)("div",{className:j()("ui input time-input",{"default-date":this.state.isDefault}),children:Object(T.jsx)(A,{disabled:this.props.isDisabled,defaultValue:d,value:d,onChange:this.onTimeChange,allowEmpty:!1,showSecond:!1,use12Hours:"en"===s.locale,id:t+"-time",format:i.localeData(s.locale).longDateFormat("LT"),placeholder:s.formatMessage(N.time),focusOnOpen:!0,placement:"bottomRight"})}),a&&Object(T.jsx)("button",{disabled:this.props.isDisabled||!d,onClick:()=>this.onResetDates(),className:"item ui noborder button",children:Object(T.jsx)(m.jb,{name:w.a,size:"24px",className:"close"})})]})}))}}q.defaultProps={description:null,required:!1,error:[],dateOnly:!1,noPastDates:!1,value:null,resettable:!0},t.default=Object(i.compose)(Object(O.a)(["reactDates","moment"]),h.c)(q)},vaF2:function(e,t,a){"use strict";a.r(t);var s=a("lSNA"),n=a.n(s),r=a("wEy/"),l=a.n(r),i=a("NIJN"),d=a.n(i),o=a("J2m7"),c=a.n(o),u=a("3WF5"),h=a.n(u),b=a("Y+p1"),y=a.n(b),j=a("q1tI"),m=a("17x9"),f=a.n(m),O=a("ANjH"),p=a("VbRK"),g=a("TSYQ"),v=a.n(g),x=a("lHu7"),M=a("zSVi"),w=a("vFsZ"),k=a("+6Dn"),D=a("MqQV"),E=a("3mGJ"),C=a("QetY"),S=a("fuXp"),F=a("aQu0"),T=a("Kvkj"),Y=a("Lf35"),_=a("Z5Td"),R=a.n(_),A=a("YIVY"),N=a.n(A),P=a("DQaE"),I=a.n(P);const L={MO:p.a.MO,TU:p.a.TU,WE:p.a.WE,TH:p.a.TH,FR:p.a.FR,SA:p.a.SA,SU:p.a.SU},q=[L.MO,L.TU,L.WE,L.TH,L.FR],W=[L.MO,L.FR],V={DAILY:"daily",MONDAYFRIDAY:"mondayfriday",WEEKDAYS:"weekdays",WEEKLY:"weekly",MONTHLY:"monthly",YEARLY:"yearly"},U={frequences:{[V.DAILY]:{rrule:p.a.DAILY,interval:!0},[V.MONDAYFRIDAY]:{rrule:p.a.WEEKLY},[V.WEEKDAYS]:{rrule:p.a.WEEKLY},[V.WEEKLY]:{rrule:p.a.WEEKLY,interval:!0,byday:!0},[V.MONTHLY]:{rrule:p.a.MONTHLY,interval:!0,bymonth:!0},[V.YEARLY]:{rrule:p.a.YEARLY,interval:!0,byyear:!0}}},K=e=>e.toISOString().split("T")[0],H=(e,t)=>{t.locale(e.locale);const a=Object(x.defineMessages)({every:{id:"rrule_every",defaultMessage:"every"},until:{id:"rrule_until",defaultMessage:"until"},for:{id:"rrule_for",defaultMessage:"for"},time:{id:"rrule_time",defaultMessage:"time"},times:{id:"rrule_times",defaultMessage:"times"},"(~ approximate)":{id:"rrule_approximate",defaultMessage:"(~approximate)"},hour:{id:"rrule_hour",defaultMessage:"hour"},hours:{id:"rrule_hours",defaultMessage:"hours"},minutes:{id:"rrule_minutes",defaultMessage:"minutes"},weekdays:{id:"rrule_weekdays",defaultMessage:"weekdays"},weekday:{id:"rrule_weekday",defaultMessage:"weekday"},day:{id:"rrule_day",defaultMessage:"day"},days:{id:"rrule_days",defaultMessage:"days"},in:{id:"rrule_in",defaultMessage:"in"},week:{id:"rrule_week",defaultMessage:"week"},weeks:{id:"rrule_weeks",defaultMessage:"weeks"},month:{id:"rrule_month",defaultMessage:"month"},months:{id:"rrule_months",defaultMessage:"months"},on:{id:"rrule_on",defaultMessage:"on"},year:{id:"rrule_year",defaultMessage:"year"},years:{id:"rrule_years",defaultMessage:"years"},"on the":{id:"rrule_on the",defaultMessage:"on the"},the:{id:"rrule_the",defaultMessage:"the"},and:{id:"rrule_and",defaultMessage:"and"},or:{id:"rrule_or",defaultMessage:"or"},at:{id:"rrule_at",defaultMessage:"at"},last:{id:"rrule_last",defaultMessage:"last"},st:{id:"rrule_st",defaultMessage:"st"},nd:{id:"rrule_nd",defaultMessage:"nd"},rd:{id:"rrule_rd",defaultMessage:"rd"},th:{id:"rrule_th",defaultMessage:"th"},dateFormat:{id:"rrule_dateFormat",defaultMessage:"[month] [day], [year]"}});let s={};Object.keys(a).map(t=>s[t]=e.formatMessage(a[t]));let n=s.dateFormat.replace(new RegExp("\\[","g"),"${").replace(new RegExp("\\]","g"),"}");return{dayNames:t.weekdays(),monthNames:t.months(),strings:s,dateFormatter:(e,t,a)=>n.replace(/\$\{year\}/g,e).replace(/\$\{month\}/g,t).replace(/\$\{day\}/g,a)}};var G=a("umxb"),z=a("nKUr");const $=({label:e,labelAfter:t,value:a,onChange:s})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"interval",children:e})})}),Object(z.jsx)(k.a.Column,{width:"8",children:Object(z.jsxs)(w.a.Field,{inline:!0,children:[Object(z.jsx)(G.a,{id:"interval",name:"interval",value:a||"",onChange:({target:e})=>{s(e.id,""===e.value?void 0:parseInt(e.value))}}),t&&Object(z.jsx)("span",{children:t})]})})]})})});$.defaultProps={label:null,labelAfter:null,onChange:null};var J=$,Q=a("52Oh");const Z=({label:e,value:t,onChange:a,moment:s})=>{const n=Object(Q.a)(),r=s.default;r.locale(n.locale);return Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"byday",children:e})})}),Object(z.jsx)(k.a.Column,{width:"8",children:Object(z.jsx)(C.a.Group,{basic:!0,className:"byday-field",children:Object.keys(L).map(e=>Object(z.jsx)(C.a,{active:(null===t||void 0===t?void 0:t.indexOf(L[e]))>=0,type:"button",content:r.weekdaysShort(L[e].weekday+1),onClick:()=>{(e=>{var s=L[e],n=t?[...t]:[],r=n.indexOf(s);r>=0?n.splice(r,1):n.push(s),a("byweekday",n)})(e)}},e))})})]})})})};Z.defaultProps={label:null,value:null,onChange:null};var B=Object(Y.a)(["moment"])(Z),X=a("/fAC"),ee=a("f/pJ");const te=Object(x.defineMessages)({recurrenceEnds:{id:"Recurrence ends",defaultMessage:"Ends"},recurrenceEndsCount:{id:"Recurrence ends after",defaultMessage:"after"},recurrenceEndsUntil:{id:"Recurrence ends on",defaultMessage:"on"},occurrences:{id:"Occurences",defaultMessage:"occurrence(s)"}}),ae=({value:e,count:t,until:a,onChange:s,intl:n})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"recurrenceEnds",children:n.formatMessage(te.recurrenceEnds)})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"recurrenceEnds",id:"recurrenceEndsCount",value:"count",checked:"count"===e,onChange:(e,{value:t})=>s("recurrenceEnds",t)})}),Object(z.jsx)(w.a.Field,{disabled:"count"!==e,children:n.formatMessage(te.recurrenceEndsCount)}),Object(z.jsx)(w.a.Field,{disabled:"count"!==e,children:Object(z.jsx)(G.a,{id:"count",name:"count",value:t||"",onChange:({target:e})=>{s(e.id,""===e.value?void 0:e.value)}})}),Object(z.jsx)(w.a.Field,{disabled:"count"!==e,children:n.formatMessage(te.occurrences)})]}),Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{id:"recurrenceEndsUntil",label:"",name:"recurrenceEnds",value:"until",checked:"until"===e,onChange:(e,{value:t})=>s("recurrenceEnds",t)})}),Object(z.jsx)(w.a.Field,{disabled:"until"!==e,children:Object(z.jsx)(ee.default,{id:"until",title:n.formatMessage(te.recurrenceEndsUntil),dateOnly:!0,value:a||"",resettable:!1,onChange:(e,t)=>{s(e,""===t?void 0:t)}})})]})]})]})})});ae.defaultProps={value:null,count:null,until:null,onChange:null};var se=Object(M.c)(ae);const ne=Object(x.defineMessages)({bymonthDay:{id:"Month day",defaultMessage:"Day"},ofTheMonth:{id:"of the month",defaultMessage:"of the month"}}),re=({value:e,disabled:t,onChange:a,hideAfterLabel:s,intl:n})=>Object(z.jsxs)(z.Fragment,{children:[Object(z.jsx)(w.a.Field,{inline:!0,disabled:t,children:n.formatMessage(ne.bymonthDay)}),Object(z.jsx)(w.a.Field,{inline:!0,disabled:t,children:Object(z.jsx)(G.a,{type:"number",id:"bymonthday",name:"bymonthday",value:e||"",onChange:({target:e})=>{a(e.id,""===e.value?void 0:[parseInt(e.value)])}})}),!s&&Object(z.jsx)(w.a.Field,{inline:!0,disabled:t,children:n.formatMessage(ne.ofTheMonth)})]});re.defaultProps={disabled:!1,value:null,onChange:null,hideAfterLabel:!1};var le=Object(M.c)(re),ie=a("y2Vs"),de=a("cuOu");function oe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function ce(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):oe(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const ue=({name:e,disabled:t,options:a,value:s,onChange:n})=>{const r=ce(ce({},de.g),{},{control:(e,t)=>ce(ce({},de.g.control(e,t)),{},{minWidth:"130px"})}),l=(e,t)=>{const a=c()(e,e=>e.value===t);return a||{}};return Object(z.jsx)(ie.default,{isDisabled:t,id:e,name:e,className:"react-select-container",classNamePrefix:"react-select",defaultValue:l(a,s),value:l(a,s),options:a,styles:r,theme:de.h,components:{DropdownIndicator:de.b,Option:de.d},onChange:t=>n(e,t.value)})};ue.defaultProps={name:"select",options:[],disabled:!1,value:null,onChange:null};var he=ue;function be(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function ye(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?be(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):be(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const je=Object(x.defineMessages)({bymonthDayNumber:{id:"Weeek day of month",defaultMessage:"The"},first:{id:"First",defaultMessage:"First"},second:{id:"Second",defaultMessage:"Second"},third:{id:"Third",defaultMessage:"Third"},fourth:{id:"Fourth",defaultMessage:"Fourth"},last:{id:"Last",defaultMessage:"Last"}}),me={1:"first",2:"second",3:"third",4:"fourth","-1":"last"};class fe extends j.Component{render(){const{intl:e,disabled:t}=this.props,a=[...h()(Object.keys(me),t=>({value:parseInt(t),label:e.formatMessage(je[me[t]])}))];return Object(z.jsxs)(z.Fragment,{children:[Object(z.jsx)(w.a.Field,{disabled:t,children:e.formatMessage(je.bymonthDayNumber)}),Object(z.jsx)(w.a.Field,{disabled:t,children:Object(z.jsx)(he,ye({name:"weekdayOfTheMonthIndex",options:a},this.props))})]})}}n()(fe,"defaultProps",{disabled:!1,value:null,onChange:null});var Oe=Object(M.c)(fe);function pe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function ge(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):pe(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var ve=Object(Y.a)(["moment"])(e=>{const{disabled:t=!1,moment:a}=e,s=Object(Q.a)(),n=a.default;n.locale(s.locale);const r=[...h()(Object.keys(L),e=>({value:L[e].weekday,label:n.weekdays(L[e].weekday+1)}))];return Object(z.jsx)(w.a.Field,{disabled:t,children:Object(z.jsx)(he,ge({name:"weekdayOfTheMonth",options:r},e))})});const xe=({label:e,value:t,bymonthday:a,weekdayOfTheMonthIndex:s,weekdayOfTheMonth:n,onChange:r,intl:l})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"monthly",children:e})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"monthly",id:"monthly-bymonthday",value:"bymonthday",checked:"bymonthday"===t,onChange:(e,{value:t})=>r("monthly",t)})}),Object(z.jsx)(le,{value:a,disabled:"bymonthday"!==t,onChange:r})]}),Object(z.jsxs)(w.a.Group,{inline:!0,children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"monthly",id:"monthly-byweekday",value:"byweekday",checked:"byweekday"===t,onChange:(e,{value:t})=>r("monthly",t)})}),Object(z.jsx)(Oe,{disabled:"byweekday"!==t,value:s,onChange:r}),Object(z.jsx)(ve,{disabled:"byweekday"!==t,value:n,onChange:r})]})]})]})})});xe.defaultProps={label:null,value:null,bymonthday:null,weekdayOfTheMonthIndex:null,weekdayOfTheMonth:null,onChange:null};var Me=Object(M.c)(xe);const we=({value:e,disabled:t,inline:a,onChange:s,moment:n})=>{const r=n.default,l=Object(Q.a)();r.locale(l.locale);const i=[...h()(r.months(),(e,t)=>({value:t+1,label:e}))];return Object(z.jsx)(w.a.Field,{inline:a,disabled:t,children:Object(z.jsx)(he,{name:"monthOfTheYear",disabled:t,options:i,value:e,onChange:s})})};we.defaultProps={value:null,disabled:!1,inline:!1,onChange:null};var ke=Object(Y.a)(["moment"])(we);const De=Object(x.defineMessages)({ofTheMonth:{id:"of the month",defaultMessage:"of the month"}}),Ee=({label:e,value:t,bymonthday:a,monthOfTheYear:s,weekdayOfTheMonthIndex:n,weekdayOfTheMonth:r,onChange:l,intl:i})=>Object(z.jsx)(w.a.Field,{inline:!0,className:"text byyear-field",children:Object(z.jsx)(k.a,{children:Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"yearly",children:e})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[Object(z.jsxs)(w.a.Group,{inline:!0,className:"byyear-bymonthday",children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"yearly",value:"bymonthday",id:"yearly-bymonthday",checked:"bymonthday"===t,onChange:(e,{value:t})=>l("yearly",t)})}),Object(z.jsx)(le,{value:a,disabled:"bymonthday"!==t,onChange:l,hideAfterLabel:!0}),Object(z.jsx)(ke,{value:s,disabled:"bymonthday"!==t,onChange:l})]}),Object(z.jsxs)(w.a.Group,{inline:!0,className:"byyear-byday",children:[Object(z.jsx)(w.a.Field,{children:Object(z.jsx)(X.a,{label:"",name:"yearly",id:"yearly-byday",value:"byday",checked:"byday"===t,onChange:(e,{value:t})=>l("yearly",t)})}),Object(z.jsx)(Oe,{disabled:"byday"!==t,value:n,onChange:l}),Object(z.jsx)(ve,{disabled:"byday"!==t,value:r,onChange:l}),Object(z.jsx)(w.a.Field,{disabled:"byday"!==t,children:i.formatMessage(De.ofTheMonth)}),Object(z.jsx)(ke,{value:s,disabled:"byday"!==t,onChange:l,inline:!1})]})]})]})})});Ee.defaultProps={label:null,value:null,bymonthday:null,monthOfTheYear:null,weekdayOfTheMonthIndex:null,weekdayOfTheMonth:null,onChange:null};var Ce=Object(M.c)(Ee),Se=a("WYlG"),Fe=a("lV3b"),Te=a.n(Fe);const Ye=Object(x.defineMessages)({selected_dates:{id:"Selected dates",defaultMessage:"Selected dates"},start_of_recurrence:{id:"Start of the recurrence",defaultMessage:"Start of the recurrence"},additional_date:{id:"Additional date",defaultMessage:"Additional date"},other_items:{id:"others",defaultMessage:"others"},no_occurences:{id:"No occurences set",defaultMessage:"No occurences set"},exclude:{id:"Exclude this occurence",defaultMessage:"Exclude this occurence"},include:{id:"Include this occurence",defaultMessage:"Include this occurence"}}),_e=(e,t)=>{const a=t(e);return a.format("dddd")+", "+a.format("LL")},Re=Object(Y.a)(["moment"])(({rruleSet:e,exclude:t,undoExclude:a,intl:s,showTitle:n,editOccurences:r,moment:l})=>{const i=l.default;i.locale(s.locale);let d=[];const o=t=>{var a=K(t),s=!1;return e.rdates().forEach(e=>{K(e)===a&&(s=!0)}),s};e&&(d=e.all(),e.exdates().forEach(e=>{d.indexOf(e)<0&&d.push(e)}),d.sort((e,t)=>e>t?1:-1));const c=d.splice(100);return Object(z.jsxs)("div",{className:"occurences",children:[0===d.length&&Object(z.jsx)(z.Fragment,{children:s.formatMessage(Ye.no_occurences)}),n&&Object(z.jsx)(F.a,{as:"h2",children:s.formatMessage(Ye.selected_dates)}),Object(z.jsxs)(Se.a,{divided:!0,verticalAlign:"middle",children:[d.map((n,l)=>{const d=(t=>{var a=K(t),s=!1;return e.exdates().forEach(e=>{K(e)===a&&(s=!0)}),s})(n);return Object(z.jsxs)(Se.a.Item,{children:[r&&Object(z.jsx)(Se.a.Content,{floated:"right",children:l>0?Object(z.jsxs)(z.Fragment,{children:[!d&&Object(z.jsx)(C.a,{basic:!0,icon:!0,className:"exclude-button",onClick:()=>{t(n)},"aria-label":s.formatMessage(Ye.exclude),children:Object(z.jsx)(T.jb,{name:I.a,size:"18px"})}),d&&Object(z.jsx)(C.a,{basic:!0,icon:!0,className:"include-button",onClick:()=>{a(n)},"aria-label":s.formatMessage(Ye.include),children:Object(z.jsx)(T.jb,{name:Te.a,size:"24px"})})]}):s.formatMessage(Ye.start_of_recurrence)}),Object(z.jsxs)(Se.a.Content,{className:v()({excluded:d}),children:[_e(n,i),o(n)&&Object(z.jsx)(D.a,{pointing:"left",size:"small",color:d?"grey":"green",children:s.formatMessage(Ye.additional_date)})]})]},n.toString())}),c.length>0&&Object(z.jsx)(Se.a.Item,{children:Object(z.jsx)(Se.a.Content,{children:`... ${s.formatMessage(Ye.other_items)} ${c.length}`})})]})]})});Re.propTypes={rruleSet:f.a.any,showTitle:f.a.bool,editOccurences:f.a.bool},Re.defaultProps={rruleSet:null,showTitle:!0,editOccurences:!0};var Ae=Object(M.c)(Re);function Ne(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function Pe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ne(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const Ie=Object(x.defineMessages)({editRecurrence:{id:"Edit recurrence",defaultMessage:"Edit recurrence"},save:{id:"Save recurrence",defaultMessage:"Save"},remove:{id:"Remove recurrence",defaultMessage:"Remove"},repeat:{id:"Repeat",defaultMessage:"Repeat"},daily:{id:"Daily",defaultMessage:"Daily"},mondayfriday:{id:"Monday and Friday",defaultMessage:"Monday and Friday"},weekdays:{id:"Weekday",defaultMessage:"Weekday"},weekly:{id:"Weekly",defaultMessage:"Weekly"},monthly:{id:"Monthly",defaultMessage:"Monthly"},yearly:{id:"Yearly",defaultMessage:"Yearly"},repeatEvery:{id:"Repeat every",defaultMessage:"Repeat every"},repeatOn:{id:"Repeat on",defaultMessage:"Repeat on"},interval_daily:{id:"Interval Daily",defaultMessage:"days"},interval_weekly:{id:"Interval Weekly",defaultMessage:"week(s)"},interval_monthly:{id:"Interval Monthly",defaultMessage:"Month(s)"},interval_yearly:{id:"Interval Yearly",defaultMessage:"year(s)"},add_date:{id:"Add date",defaultMessage:"Add date"},select_date_to_add_to_recurrence:{id:"Select a date to add to recurrence",defaultMessage:"Select a date to add to recurrence"}}),Le=["recurrenceEnds","monthly","weekdayOfTheMonthIndex","weekdayOfTheMonth","yearly","monthOfTheYear","byhour","byminute","bysecond","bynmonthday","exdates","rdates"];class qe extends j.Component{constructor(e,t){super(e),n()(this,"editRecurrence",()=>{this.setRecurrenceStartEnd()}),n()(this,"setRecurrenceStartEnd",()=>{var e;const t=null===(e=this.props.formData)||void 0===e?void 0:e.start;let a=this.getUTCDate(t).startOf("day").toDate();this.setState(e=>{let t=e.rruleSet;const s=this.getFormValues(t);return t=this.updateRruleSet(t,s,"dtstart",a),Pe(Pe({},e),{},{rruleSet:t,formValues:s})})}),n()(this,"getUTCDate",e=>e.match(/T(.)*(-|\+|Z)/g)?this.moment(e).utc():this.moment(e+"Z").utc()),n()(this,"show",e=>()=>{this.setState({dimmer:e,open:!0}),this.editRecurrence()}),n()(this,"close",()=>this.setState({open:!1})),n()(this,"getFreq",(e,t)=>{let a=V.DAILY;return Object.entries(U.frequences).forEach(([t,s])=>{s.rrule===e&&(a=t)}),a===V.WEEKLY&&t&&y()(t.sort(),q.map(e=>e.weekday).sort())&&(a=V.WEEKDAYS),a}),n()(this,"getWeekday",e=>{var t=null;const a=-1===e?6:e;return Object.keys(L).forEach(e=>{L[e].weekday===a&&(t=L[e])}),t}),n()(this,"getFormValues",e=>{var t;let a={freq:V.DAILY,interval:1};a=this.changeField(a,"recurrenceEnds",null!==(t=this.props.formData)&&void 0!==t&&t.end?"until":"count");const s=e.rrules()[0];if(s){var n=this.getFreq(s.options.freq,s.options.byweekday);Object.entries(s.options).forEach(([e,t])=>{switch(e){case"freq":a[e]=n;break;case"count":null!=t&&(a.recurrenceEnds=e,a[e]=t);break;case"until":null!=t&&(a.recurrenceEnds=e,a[e]=K(t));break;case"byweekday":t&&t.length>0&&(y()(t,q)&&(a.freq=V.WEEKDAYS),y()(t,W)&&(a.freq=V.MONDAYFRIDAY)),a[e]=t?t.map(e=>this.getWeekday(e)):[];break;case"bymonthday":t&&t.length>0?(n===V.MONTHLY&&(a.monthly=e),n===V.YEARLY&&(a.yearly=e)):(n===V.MONTHLY&&(a.monthly=null),n===V.YEARLY&&(a.yearly=null)),a[e]=t;break;case"bynweekday":t&&t.length>0&&(n===V.SMONTHLY&&(a.monthly="byweekday"),n===V.YEARLY&&(a.yearly="byday"),a.weekdayOfTheMonth=t[0][0],a.weekdayOfTheMonthIndex=t[0][1]);break;case"bymonth":n===V.YEARLY&&(a.yearly="byday"),a.monthOfTheYear=t?t[0]:null;break;default:a[e]=t}})}return a}),n()(this,"formValuesToRRuleOptions",e=>{var t=Object.assign({},e);return Le.forEach(e=>{delete t[e]}),Object.keys(t).forEach(e=>{var a=t[e];switch(e){case"freq":a&&(a=U.frequences[a].rrule);break;case"until":a=a?this.moment(new Date(a)).utc().toDate():null}a?t[e]=a:delete t[e]}),t}),n()(this,"updateRruleSet",(e,t,a,s)=>{var n=this.formValuesToRRuleOptions(t),r="dtstart"===a?s:e.dtstart()?e.dtstart():this.moment().utc().toDate(),l="exdates"===a?s:Object.assign([],e.exdates()),i="rdates"===a?s:Object.assign([],e.rdates());n.dtstart=r;let d=new p.b;return d.rrule(new p.a(n)),l.map(e=>d.exdate(e)),i.map(e=>d.rdate(e)),d}),n()(this,"getDefaultUntil",e=>{var t;const a=this.moment;var s=null!==(t=this.props.formData)&&void 0!==t&&t.end?K(this.getUTCDate(this.props.formData.end).toDate()):null,n=K(a().add(1,"days").utc().toDate()),r=K(a().add(7,"days").utc().toDate()),l=K(a().add(1,"months").utc().toDate()),i=K(a().add(1,"years").utc().toDate()),d=s;switch(e){case V.DAILY:d=s||n;break;case V.WEEKLY:case V.WEEKDAYS:case V.MONDAYFRIDAY:d=s||r;break;case V.MONTHLY:d=s||l;break;case V.YEARLY:d=s||i}return d}),n()(this,"changeField",(e,t,a)=>{var s,n,r,l,i;const d=this.moment,o=(null===(s=this.state)||void 0===s||null===(n=s.rruleSet)||void 0===n?void 0:n.rrules().length)>0?this.state.rruleSet.rrules()[0].origOptions.byweekday:null,c=this.getWeekday(d().day()-1),u=d().month()+1,h=null!==(r=this.props.formData)&&void 0!==r&&r.start?d(this.props.formData.start).month()+1:u,b=null!==(l=this.props.formData)&&void 0!==l&&l.start?this.getWeekday(d(this.props.formData.start).day()-1):c;e[t]=a;const y=null!==(i=this.props.formData)&&void 0!==i&&i.start?d(this.props.formData.start).date():d().date();switch(t){case"freq":e.interval=1;switch(U.frequences[a].interval||(e.interval=null),e=this.changeField(e,"byweekday",null),e=this.changeField(e,"yearly",null),e=this.changeField(e,"bymonthday",null),e=this.changeField(e,"byweekday",null),(e=this.changeField(e,"monthOfTheYear",null)).until||(e.until=this.getDefaultUntil(a)),a){case V.DAILY:break;case V.WEEKDAYS:e=this.changeField(e,"byweekday",q);break;case V.MONDAYFRIDAY:e=this.changeField(e,"byweekday",W);break;case V.WEEKLY:e=this.changeField(e,"byweekday",[b]);break;case V.MONTHLY:e=this.changeField(e,"monthly","bymonthday");break;case V.YEARLY:e=this.changeField(e,"yearly","bymonthday")}break;case"recurrenceEnds":"count"===a&&(e.count=1,e.until=null),"until"===a&&(e.until=this.getDefaultUntil(e.freq),e.count=null);break;case"byweekday":e.byweekday=a,V.WEEKLY!==e.freq?(e.weekdayOfTheMonth=a?a[0].weekday:null,e.weekdayOfTheMonthIndex=a?a[0].n:null):(delete e.weekdayOfTheMonth,delete e.weekdayOfTheMonthIndex);break;case"weekdayOfTheMonth":var j=this.getWeekday(a),m=o?o[0].n:1;e.byweekday=j?[j.nth(m)]:null;break;case"weekdayOfTheMonthIndex":var f=o?o[0]:c;e.byweekday=a?[f.nth(a)]:null;break;case"monthOfTheYear":null===a||void 0===a?delete e.bymonth:e.bymonth=[a];break;case"monthly":"bymonthday"===a&&(e.bymonthday=[y],e=this.changeField(e,"byweekday",null)),"byweekday"===a&&(e.bymonthday=null,e=this.changeField(e,"byweekday",[c.nth(1)])),null===a&&(e=this.changeField(e,"bymonthday",null),e=this.changeField(e,"byweekday",null));break;case"yearly":"bymonthday"===a&&(e.bymonthday=[y],e=this.changeField(e,"monthOfTheYear",h),e=this.changeField(e,"byweekday",null)),"byday"===a&&(e=this.changeField(e,"bymonthday",null),e=this.changeField(e,"byweekday",[b.nth(1)]),e=this.changeField(e,"monthOfTheYear",h))}return e}),n()(this,"onChangeRule",(e,t)=>{var a=Object.assign({},this.state.formValues);a=this.changeField(a,e,t),this.setState(s=>{var n=s.rruleSet;return n=this.updateRruleSet(n,a,e,t),Pe(Pe({},s),{},{rruleSet:n,formValues:a})})}),n()(this,"exclude",e=>{let t=this.state.rruleSet.exdates().slice(0);t.push(e),this.onChangeRule("exdates",t)}),n()(this,"undoExclude",e=>{let t=this.state.rruleSet.exdates().slice(0);l()(t,t=>t.getTime()===e.getTime()),this.onChangeRule("exdates",t)}),n()(this,"addDate",e=>{const t=this.moment;let a=d()(this.state.rruleSet.all(),this.state.rruleSet.exdates());var s=t(new Date(e)).startOf("day").toDate().getTime();if(!c()(a,e=>t(e).startOf("day").toDate().getTime()===s)){let t=this.state.rruleSet.rdates().slice(0);t.push(new Date(e)),this.onChangeRule("rdates",t)}}),n()(this,"save",()=>{var e=this.state.rruleSet.toString();this.props.onChange(this.props.id,e),this.close()}),n()(this,"remove",()=>{this.props.onChange(this.props.id,null);let e=new p.b;this.setState({rruleSet:e,formValues:this.getFormValues(e)})}),this.moment=this.props.moment.default,this.moment.locale(this.props.intl.locale);let a=this.props.value?Object(p.d)(e.value,{compatible:!0,forceset:!0}):new p.b;this.state={open:!1,rruleSet:a,formValues:this.getFormValues(a),RRULE_LANGUAGE:H(this.props.intl,this.moment)}}componentDidMount(){this.props.value&&this.setRecurrenceStartEnd()}componentDidUpdate(e){var t,a;if(this.props.value&&(null===(t=e.formData)||void 0===t?void 0:t.start)!==(null===(a=this.props.formData)||void 0===a?void 0:a.start)){var s;let e=this.getUTCDate(null===(s=this.props.formData)||void 0===s?void 0:s.start).startOf("day").toDate();this.setState(t=>{let a=t.rruleSet;return a=this.updateRruleSet(a,t.formValues,"dtstart",e),Pe(Pe({},t),{},{rruleSet:a})})}}render(){var e;const{open:t,dimmer:a,rruleSet:s,formValues:n,RRULE_LANGUAGE:r}=this.state,{id:l,title:i,required:d,description:o,error:c,fieldSet:u,intl:b}=this.props;return Object(z.jsx)(w.a.Field,{inline:!0,required:d,error:c.length>0,className:v()("recurrence-widget",o?"help":""),id:`${u||"field"}-${l}`,children:Object(z.jsxs)(k.a,{children:[Object(z.jsxs)(k.a.Row,{stretched:!0,children:[Object(z.jsx)(k.a.Column,{width:"4",children:Object(z.jsx)("div",{className:"wrapper",children:Object(z.jsx)("label",{htmlFor:"field-"+l,children:i})})}),Object(z.jsxs)(k.a.Column,{width:"8",children:[s.rrules()[0]&&Object(z.jsxs)(z.Fragment,{children:[Object(z.jsx)(D.a,{children:null===(e=s.rrules()[0])||void 0===e?void 0:e.toText(e=>r.strings[e],r,r.dateFormatter)}),Object(z.jsx)(E.a,{children:Object(z.jsx)(Ae,{rruleSet:s,exclude:this.exclude,undoExclude:this.undoExclude,showTitle:!1,editOccurences:!1})})]}),Object(z.jsxs)("div",{children:[Object(z.jsx)(C.a,{basic:!0,disabled:this.props.isDisabled,color:"blue",className:"edit-recurrence",onClick:this.show("blurring"),type:"button","aria-label":b.formatMessage(Ie.editRecurrence),children:Object(z.jsx)(T.jb,{name:N.a,size:"20px",title:b.formatMessage(Ie.editRecurrence)})}),this.props.value&&Object(z.jsx)(C.a,{basic:!0,color:"pink",className:"remove-recurrence",onClick:()=>{this.remove()},type:"button","aria-label":b.formatMessage(Ie.remove),children:Object(z.jsx)(T.jb,{name:I.a,size:"20px",title:b.formatMessage(Ie.remove)})})]}),Object(z.jsxs)(S.a,{dimmer:a,open:t,onClose:this.close,className:"recurrence-form",closeIcon:!0,children:[Object(z.jsxs)(S.a.Header,{children:[b.formatMessage(Ie.editRecurrence)," "]}),Object(z.jsx)(S.a.Content,{scrolling:!0,children:s.rrules().length>0&&Object(z.jsxs)(S.a.Description,{children:[Object(z.jsx)(E.a,{children:Object(z.jsxs)(w.a,{children:[Object(z.jsx)(T.Mb,{id:"freq",title:b.formatMessage(Ie.repeat),getVocabulary:()=>{},getVocabularyTokenTitle:()=>{},choices:Object.keys(U.frequences).map(e=>[e,b.formatMessage(Ie[e])]),value:n.freq,onChange:this.onChangeRule}),U.frequences[n.freq].interval&&Object(z.jsx)(J,{label:b.formatMessage(Ie.repeatEvery),labelAfter:n.freq&&b.formatMessage(Ie["interval_"+n.freq]),value:n.interval,onChange:this.onChangeRule}),U.frequences[n.freq].byday&&Object(z.jsx)(B,{label:b.formatMessage(Ie.repeatOn),value:n.byweekday,onChange:this.onChangeRule}),U.frequences[n.freq].bymonth&&Object(z.jsx)(Me,{label:b.formatMessage(Ie.repeatOn),value:n.monthly,bymonthday:n.bymonthday,weekdayOfTheMonthIndex:n.weekdayOfTheMonthIndex,weekdayOfTheMonth:n.weekdayOfTheMonth,onChange:this.onChangeRule}),U.frequences[n.freq].byyear&&Object(z.jsx)(Ce,{label:b.formatMessage(Ie.repeatOn),value:n.yearly,bymonthday:n.bymonthday,monthOfTheYear:n.monthOfTheYear,weekdayOfTheMonthIndex:n.weekdayOfTheMonthIndex,weekdayOfTheMonth:n.weekdayOfTheMonth,onChange:this.onChangeRule}),Object(z.jsx)(se,{value:n.recurrenceEnds,count:n.count,until:n.until,onChange:this.onChangeRule})]})}),Object(z.jsx)(E.a,{children:Object(z.jsx)(Ae,{rruleSet:s,exclude:this.exclude,undoExclude:this.undoExclude})}),Object(z.jsxs)(E.a,{children:[Object(z.jsx)(F.a,{as:"h2",children:b.formatMessage(Ie.add_date)}),Object(z.jsx)(T.P,{id:"addDate",title:b.formatMessage(Ie.select_date_to_add_to_recurrence),dateOnly:!0,noPastDates:!0,onChange:(e,t)=>{this.addDate(""===t?void 0:t)}})]})]})}),Object(z.jsx)(S.a.Actions,{children:Object(z.jsx)(C.a,{className:"save",basic:!0,onClick:()=>{this.save()},"aria-label":b.formatMessage(Ie.save),children:Object(z.jsx)(T.jb,{name:R.a,className:"circled",size:"30px",title:b.formatMessage(Ie.save)})})})]}),h()(c,e=>Object(z.jsx)(D.a,{basic:!0,color:"red",pointing:!0,children:e},e))]})]}),o&&Object(z.jsx)(k.a.Row,{stretched:!0,children:Object(z.jsx)(k.a.Column,{stretched:!0,width:"12",children:Object(z.jsx)("p",{className:"help",children:o})})})]})})}}n()(qe,"defaultProps",{description:null,required:!1,error:[],value:null});t.default=Object(O.compose)(Object(Y.a)(["moment"]),M.c)(qe)}}]);
|
|
2
|
+
//# sourceMappingURL=react-select.6ac1d612.chunk.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var n,a,f=t[0],i=t[1],d=t[2],l=0,s=[];l<f.length;l++)a=f[l],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(u&&u(t);s.length;)s.shift()();return c.push.apply(c,d||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var i=r[a];0!==o[i]&&(n=!1)}n&&(c.splice(t--,1),e=f(f.s=r[0]))}return e}var n={},a={13:0},o={13:0},c=[];function f(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.e=function(e){var t=[];a[e]?t.push(a[e]):0!==a[e]&&{3:1,9:1}[e]&&t.push(a[e]=new Promise((function(t,r){for(var n="static/css/"+({2:"react-select",5:"moment",8:"draft-js-lib-isSoftNewlineEvent",9:"plone-volto-components-manage-Widgets-DatetimeWidget",10:"plone-volto-components-theme-View-EventView",11:"react-dates",12:"react-simple-code-editor"}[e]||e)+"."+{0:"3e794c57",1:"fece2b93",2:"
|
|
2
|
-
//# sourceMappingURL=runtime~client.
|
|
1
|
+
!function(e){function t(t){for(var n,a,f=t[0],i=t[1],d=t[2],l=0,s=[];l<f.length;l++)a=f[l],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(u&&u(t);s.length;)s.shift()();return c.push.apply(c,d||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var i=r[a];0!==o[i]&&(n=!1)}n&&(c.splice(t--,1),e=f(f.s=r[0]))}return e}var n={},a={13:0},o={13:0},c=[];function f(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.e=function(e){var t=[];a[e]?t.push(a[e]):0!==a[e]&&{3:1,9:1}[e]&&t.push(a[e]=new Promise((function(t,r){for(var n="static/css/"+({2:"react-select",5:"moment",8:"draft-js-lib-isSoftNewlineEvent",9:"plone-volto-components-manage-Widgets-DatetimeWidget",10:"plone-volto-components-theme-View-EventView",11:"react-dates",12:"react-simple-code-editor"}[e]||e)+"."+{0:"3e794c57",1:"fece2b93",2:"6ac1d612",3:"a3490306",4:"bdc4a5c5",5:"dfd83abb",6:"69ba4792",8:"ad4b1307",9:"c6a47163",10:"d0a7e38a",11:"d94a34ee",12:"484ec69f",15:"c1eb25b4",16:"70e24cba",17:"f03d2a82",18:"0f0b1dfa",19:"61ef8815",20:"6b37f925",21:"8704b265",22:"5a2b56ff",23:"a53c8d7b",24:"d44c620a",25:"455376b6",26:"a821045d",27:"efbb318a",28:"b4840d60",29:"690d4b54",30:"5f174f94",31:"4a7cf109",32:"2247dcf7",33:"87874f33",34:"aec37d56",35:"73887e02",36:"19d2e05a",37:"96925a5f",38:"701a2e85",39:"4cbf0549"}[e]+".chunk.css",o=f.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var d=(u=c[i]).getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(d===n||d===o))return t()}var l=document.getElementsByTagName("style");for(i=0;i<l.length;i++){var u;if((d=(u=l[i]).getAttribute("data-href"))===n||d===o)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||o,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete a[e],s.parentNode.removeChild(s),r(c)},s.href=o,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){a[e]=0})));var r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,f.nc&&i.setAttribute("nonce",f.nc),i.src=function(e){return f.p+"static/js/"+({2:"react-select",5:"moment",8:"draft-js-lib-isSoftNewlineEvent",9:"plone-volto-components-manage-Widgets-DatetimeWidget",10:"plone-volto-components-theme-View-EventView",11:"react-dates",12:"react-simple-code-editor"}[e]||e)+"."+{0:"3e794c57",1:"fece2b93",2:"6ac1d612",3:"a3490306",4:"bdc4a5c5",5:"dfd83abb",6:"69ba4792",8:"ad4b1307",9:"c6a47163",10:"d0a7e38a",11:"d94a34ee",12:"484ec69f",15:"c1eb25b4",16:"70e24cba",17:"f03d2a82",18:"0f0b1dfa",19:"61ef8815",20:"6b37f925",21:"8704b265",22:"5a2b56ff",23:"a53c8d7b",24:"d44c620a",25:"455376b6",26:"a821045d",27:"efbb318a",28:"b4840d60",29:"690d4b54",30:"5f174f94",31:"4a7cf109",32:"2247dcf7",33:"87874f33",34:"aec37d56",35:"73887e02",36:"19d2e05a",37:"96925a5f",38:"701a2e85",39:"4cbf0549"}[e]+".chunk.js"}(e);var d=new Error;c=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",d.name="ChunkLoadError",d.type=n,d.request=a,r[1](d)}o[e]=void 0}};var l=setTimeout((function(){c({type:"timeout",target:i})}),12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(t)},f.m=e,f.c=n,f.d=function(e,t,r){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(f.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)f.d(r,n,function(t){return e[t]}.bind(null,n));return r},f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="/",f.oe=function(e){throw console.error(e),e};var i=window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[],d=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=d;r()}([]);
|
|
2
|
+
//# sourceMappingURL=runtime~client.5ca655c6.js.map
|