openstack-uicore-foundation 5.0.2 → 5.0.3-beta.1

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.
Files changed (223) hide show
  1. package/.claude/settings.local.json +12 -0
  2. package/lib/components/ajaxloader.js.map +1 -1
  3. package/lib/components/attendance-tracker.js +1 -1
  4. package/lib/components/attendance-tracker.js.map +1 -1
  5. package/lib/components/bulk-actions-selector.js.map +1 -1
  6. package/lib/components/circle-button.js.map +1 -1
  7. package/lib/components/clock.js +1 -1
  8. package/lib/components/clock.js.map +1 -1
  9. package/lib/components/exclusive-wrapper.js.map +1 -1
  10. package/lib/components/extra-questions-mui.js.map +1 -1
  11. package/lib/components/extra-questions.js +1 -1
  12. package/lib/components/extra-questions.js.map +1 -1
  13. package/lib/components/form-validation.js.map +1 -1
  14. package/lib/components/forms/rsvp-form.js.map +1 -1
  15. package/lib/components/forms/simple-form.js +1 -1
  16. package/lib/components/forms/simple-form.js.map +1 -1
  17. package/lib/components/free-text-search.js +1 -1
  18. package/lib/components/free-text-search.js.map +1 -1
  19. package/lib/components/google-map.js +1 -1
  20. package/lib/components/google-map.js.map +1 -1
  21. package/lib/components/index.js +1 -1
  22. package/lib/components/index.js.map +1 -1
  23. package/lib/components/inputs/access-levels-input.js +1 -1
  24. package/lib/components/inputs/access-levels-input.js.map +1 -1
  25. package/lib/components/inputs/action-dropdown.js.map +1 -1
  26. package/lib/components/inputs/attendee-input.js +1 -1
  27. package/lib/components/inputs/attendee-input.js.map +1 -1
  28. package/lib/components/inputs/checkbox-list.js.map +1 -1
  29. package/lib/components/inputs/company-input-v2.js +1 -1
  30. package/lib/components/inputs/company-input-v2.js.map +1 -1
  31. package/lib/components/inputs/company-input.js +1 -1
  32. package/lib/components/inputs/company-input.js.map +1 -1
  33. package/lib/components/inputs/country-dropdown.js +1 -1
  34. package/lib/components/inputs/country-dropdown.js.map +1 -1
  35. package/lib/components/inputs/country-input.js +1 -1
  36. package/lib/components/inputs/country-input.js.map +1 -1
  37. package/lib/components/inputs/datetimepicker.js.map +1 -1
  38. package/lib/components/inputs/dropdown.js.map +1 -1
  39. package/lib/components/inputs/editor-input-v2.js.map +1 -1
  40. package/lib/components/inputs/editor-input-v3.js.map +1 -1
  41. package/lib/components/inputs/editor-input.js.map +1 -1
  42. package/lib/components/inputs/event-input.js +1 -1
  43. package/lib/components/inputs/event-input.js.map +1 -1
  44. package/lib/components/inputs/free-multi-text-input.js.map +1 -1
  45. package/lib/components/inputs/group-input.js +1 -1
  46. package/lib/components/inputs/group-input.js.map +1 -1
  47. package/lib/components/inputs/grouped-dropdown.js.map +1 -1
  48. package/lib/components/inputs/language-input.js +1 -1
  49. package/lib/components/inputs/language-input.js.map +1 -1
  50. package/lib/components/inputs/member-input.js +1 -1
  51. package/lib/components/inputs/member-input.js.map +1 -1
  52. package/lib/components/inputs/operator-input.js.map +1 -1
  53. package/lib/components/inputs/organization-input.js +1 -1
  54. package/lib/components/inputs/organization-input.js.map +1 -1
  55. package/lib/components/inputs/promocode-input.js +1 -1
  56. package/lib/components/inputs/promocode-input.js.map +1 -1
  57. package/lib/components/inputs/radio-list.js.map +1 -1
  58. package/lib/components/inputs/registration-company-input.js +1 -1
  59. package/lib/components/inputs/registration-company-input.js.map +1 -1
  60. package/lib/components/inputs/speaker-input.js +1 -1
  61. package/lib/components/inputs/speaker-input.js.map +1 -1
  62. package/lib/components/inputs/sponsor-input.js +1 -1
  63. package/lib/components/inputs/sponsor-input.js.map +1 -1
  64. package/lib/components/inputs/stepped-select.js.map +1 -1
  65. package/lib/components/inputs/summit-days-select.js.map +1 -1
  66. package/lib/components/inputs/summit-input.js +1 -1
  67. package/lib/components/inputs/summit-input.js.map +1 -1
  68. package/lib/components/inputs/summit-venues-select.js.map +1 -1
  69. package/lib/components/inputs/tag-input.js +1 -1
  70. package/lib/components/inputs/tag-input.js.map +1 -1
  71. package/lib/components/inputs/text-input.js.map +1 -1
  72. package/lib/components/inputs/textarea-input.js.map +1 -1
  73. package/lib/components/inputs/ticket-types-input.js +1 -1
  74. package/lib/components/inputs/ticket-types-input.js.map +1 -1
  75. package/lib/components/inputs/upload-input-v2.js +1 -1
  76. package/lib/components/inputs/upload-input-v2.js.map +1 -1
  77. package/lib/components/inputs/upload-input-v3.js +1 -1
  78. package/lib/components/inputs/upload-input-v3.js.map +1 -1
  79. package/lib/components/inputs/upload-input.js.map +1 -1
  80. package/lib/components/mui/alert-button.js +2 -0
  81. package/lib/components/mui/alert-button.js.map +1 -0
  82. package/lib/components/mui/alert-modal.js +2 -0
  83. package/lib/components/mui/alert-modal.js.map +1 -0
  84. package/lib/components/mui/auth-button.js +2 -0
  85. package/lib/components/mui/auth-button.js.map +1 -0
  86. package/lib/components/mui/cart-button.js +2 -0
  87. package/lib/components/mui/cart-button.js.map +1 -0
  88. package/lib/components/mui/checkbox-list.js.map +1 -1
  89. package/lib/components/mui/chip-list.js.map +1 -1
  90. package/lib/components/mui/chip-notify.js +1 -1
  91. package/lib/components/mui/chip-notify.js.map +1 -1
  92. package/lib/components/mui/chip-select-input.js.map +1 -1
  93. package/lib/components/mui/confirm-delete-dialog.js +2 -0
  94. package/lib/components/mui/confirm-delete-dialog.js.map +1 -0
  95. package/lib/components/mui/confirm-dialog.js.map +1 -1
  96. package/lib/components/mui/custom-alert.js.map +1 -1
  97. package/lib/components/mui/dashboard-card.js +2 -0
  98. package/lib/components/mui/dashboard-card.js.map +1 -0
  99. package/lib/components/mui/dnd-list.js.map +1 -1
  100. package/lib/components/mui/download-btn.js +2 -0
  101. package/lib/components/mui/download-btn.js.map +1 -0
  102. package/lib/components/mui/dropdown-checkbox.js.map +1 -1
  103. package/lib/components/mui/editable-table.js.map +1 -1
  104. package/lib/components/mui/form-item-table.js +1 -1
  105. package/lib/components/mui/form-item-table.js.map +1 -1
  106. package/lib/components/mui/formik-inputs/additional-input-list.js.map +1 -1
  107. package/lib/components/mui/formik-inputs/additional-input.js.map +1 -1
  108. package/lib/components/mui/formik-inputs/async-select.js.map +1 -1
  109. package/lib/components/mui/formik-inputs/checkbox-group.js.map +1 -1
  110. package/lib/components/mui/formik-inputs/checkbox.js.map +1 -1
  111. package/lib/components/mui/formik-inputs/company-input.js +1 -1
  112. package/lib/components/mui/formik-inputs/company-input.js.map +1 -1
  113. package/lib/components/mui/formik-inputs/datepicker.js.map +1 -1
  114. package/lib/components/mui/formik-inputs/discount-field.js.map +1 -1
  115. package/lib/components/mui/formik-inputs/dropdown-checkbox.js.map +1 -1
  116. package/lib/components/mui/formik-inputs/dropdown-radio.js.map +1 -1
  117. package/lib/components/mui/formik-inputs/file-size-field.js.map +1 -1
  118. package/lib/components/mui/formik-inputs/item-price-tiers.js +1 -1
  119. package/lib/components/mui/formik-inputs/item-price-tiers.js.map +1 -1
  120. package/lib/components/mui/formik-inputs/price-field.js.map +1 -1
  121. package/lib/components/mui/formik-inputs/quantity-field.js.map +1 -1
  122. package/lib/components/mui/formik-inputs/radio-group.js.map +1 -1
  123. package/lib/components/mui/formik-inputs/select-group.js.map +1 -1
  124. package/lib/components/mui/formik-inputs/select.js.map +1 -1
  125. package/lib/components/mui/formik-inputs/sponsor-input.js +1 -1
  126. package/lib/components/mui/formik-inputs/sponsor-input.js.map +1 -1
  127. package/lib/components/mui/formik-inputs/sponsorship-input.js +1 -1
  128. package/lib/components/mui/formik-inputs/sponsorship-input.js.map +1 -1
  129. package/lib/components/mui/formik-inputs/sponsorship-summit-select.js +1 -1
  130. package/lib/components/mui/formik-inputs/sponsorship-summit-select.js.map +1 -1
  131. package/lib/components/mui/formik-inputs/summit-addon-select.js +1 -1
  132. package/lib/components/mui/formik-inputs/summit-addon-select.js.map +1 -1
  133. package/lib/components/mui/formik-inputs/switch.js.map +1 -1
  134. package/lib/components/mui/formik-inputs/textfield.js.map +1 -1
  135. package/lib/components/mui/formik-inputs/timepicker.js.map +1 -1
  136. package/lib/components/mui/formik-inputs/upload.js +1 -1
  137. package/lib/components/mui/formik-inputs/upload.js.map +1 -1
  138. package/lib/components/mui/infinite-table.js.map +1 -1
  139. package/lib/components/mui/item-settings-modal.js +1 -1
  140. package/lib/components/mui/item-settings-modal.js.map +1 -1
  141. package/lib/components/mui/loading-overlay.js +2 -0
  142. package/lib/components/mui/loading-overlay.js.map +1 -0
  143. package/lib/components/mui/menu-button.js.map +1 -1
  144. package/lib/components/mui/nav-bar.js +2 -0
  145. package/lib/components/mui/nav-bar.js.map +1 -0
  146. package/lib/components/mui/notes-modal.js +1 -1
  147. package/lib/components/mui/notes-modal.js.map +1 -1
  148. package/lib/components/mui/order-summary.js +2 -0
  149. package/lib/components/mui/order-summary.js.map +1 -0
  150. package/lib/components/mui/search-input.js +1 -1
  151. package/lib/components/mui/search-input.js.map +1 -1
  152. package/lib/components/mui/show-confirm-dialog.js.map +1 -1
  153. package/lib/components/mui/snackbar-notification.js +1 -1
  154. package/lib/components/mui/snackbar-notification.js.map +1 -1
  155. package/lib/components/mui/sortable-table.js.map +1 -1
  156. package/lib/components/mui/sponsor-addon-select.js +1 -1
  157. package/lib/components/mui/sponsor-addon-select.js.map +1 -1
  158. package/lib/components/mui/status-chip.js +2 -0
  159. package/lib/components/mui/status-chip.js.map +1 -0
  160. package/lib/components/mui/stripe-payment.js +2 -0
  161. package/lib/components/mui/stripe-payment.js.map +1 -0
  162. package/lib/components/mui/summit-addon-select.js +1 -1
  163. package/lib/components/mui/summit-addon-select.js.map +1 -1
  164. package/lib/components/mui/summits-dropdown.js +1 -1
  165. package/lib/components/mui/summits-dropdown.js.map +1 -1
  166. package/lib/components/mui/table.js +1 -1
  167. package/lib/components/mui/table.js.map +1 -1
  168. package/lib/components/mui/upload-btn.js +2 -0
  169. package/lib/components/mui/upload-btn.js.map +1 -0
  170. package/lib/components/mui/upload-dialog.js +2 -0
  171. package/lib/components/mui/upload-dialog.js.map +1 -0
  172. package/lib/components/progressive-img.js.map +1 -1
  173. package/lib/components/raw-html.js.map +1 -1
  174. package/lib/components/schedule-builder-view.js +1 -1
  175. package/lib/components/schedule-builder-view.js.map +1 -1
  176. package/lib/components/sections/panel.js.map +1 -1
  177. package/lib/components/simple-link-list.js.map +1 -1
  178. package/lib/components/sponsored-project-input.js +1 -1
  179. package/lib/components/sponsored-project-input.js.map +1 -1
  180. package/lib/components/summit-dropdown.js.map +1 -1
  181. package/lib/components/table-editable.js +1 -1
  182. package/lib/components/table-editable.js.map +1 -1
  183. package/lib/components/table-selectable.js.map +1 -1
  184. package/lib/components/table-sortable.js.map +1 -1
  185. package/lib/components/table.js.map +1 -1
  186. package/lib/components/video-stream.js.map +1 -1
  187. package/lib/css/components/index.css +1 -1
  188. package/lib/css/components/index.css.map +1 -1
  189. package/lib/css/components/mui/auth-button.css +1 -0
  190. package/lib/css/components/mui/nav-bar.css +1 -0
  191. package/lib/css/components/mui/upload-dialog.css +2 -0
  192. package/lib/css/components/mui/upload-dialog.css.map +1 -0
  193. package/lib/i18n.js +1 -1
  194. package/lib/i18n.js.map +1 -1
  195. package/lib/models/index.js.map +1 -1
  196. package/lib/models/summit-event.js.map +1 -1
  197. package/lib/security/abstract-auth-callback-route-v2.js +1 -1
  198. package/lib/security/abstract-auth-callback-route-v2.js.map +1 -1
  199. package/lib/security/abstract-auth-callback-route.js +1 -1
  200. package/lib/security/abstract-auth-callback-route.js.map +1 -1
  201. package/lib/security/actions.js +1 -1
  202. package/lib/security/actions.js.map +1 -1
  203. package/lib/security/methods.js +1 -1
  204. package/lib/security/methods.js.map +1 -1
  205. package/lib/security/reducers.js +1 -1
  206. package/lib/security/reducers.js.map +1 -1
  207. package/lib/security/session-checker.js +1 -1
  208. package/lib/security/session-checker.js.map +1 -1
  209. package/lib/utils/actions.js +1 -1
  210. package/lib/utils/actions.js.map +1 -1
  211. package/lib/utils/fragment-parser.js.map +1 -1
  212. package/lib/utils/methods.js +1 -1
  213. package/lib/utils/methods.js.map +1 -1
  214. package/lib/utils/money.js.map +1 -1
  215. package/lib/utils/query-actions.js +1 -1
  216. package/lib/utils/query-actions.js.map +1 -1
  217. package/lib/utils/questions-set.js +1 -1
  218. package/lib/utils/questions-set.js.map +1 -1
  219. package/lib/utils/reducers.js +1 -1
  220. package/lib/utils/reducers.js.map +1 -1
  221. package/lib/utils/use-fit-text.js.map +1 -1
  222. package/package.json +9 -1
  223. package/.codegraph/config.json +0 -140
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={8311:(e,t,i)=>{i.d(t,{default:()=>n});var s=i(1116),o=i.n(s);function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}class n{constructor(){this.originalHash="",this.hash={}}convertToHash(e){let t=(e=e.substr(1).toLowerCase()).split("&"),i={};for(let e of t){if(e=e.split("="),2!==e.length)continue;let t=e[1].trim();""!==t&&("true"!==t&&"false"!==t||(e[1]="true"==t),i[e[0]]=e[1])}return i}clearParams(){this.originalHash="",this.hash={}}getParam(e){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),this.hash.hasOwnProperty(e)?this.hash[e]:null}getParams(){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){o()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},this.hash)}deleteParam(e){var t=this.getParams();this.clearParams();for(let i in t)i!=e&&(this.hash[i]=t[i])}deleteParams(e){var t=this.getParams();this.clearParams();for(let i in t)e.includes(i)||(this.hash[i]=t[i])}setParam(e,t){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),null!==t&&""!==t?this.hash[e]=t:delete this.hash[e],this}serialize(){let e="";for(let t in this.hash){""!==e&&(e+="&"),e+=t+"="+this.hash[t]}return e}}},9558:(e,t,i)=>{i.d(t,{getTimeServiceUrl:()=>s});i(5812),i(8041);const s=()=>"undefined"!=typeof window?window.TIMEINTERVALSINCE1970_API_URL||process.env.TIMEINTERVALSINCE1970_API_URL:null},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},8041:e=>{e.exports=require("urijs")}},t={};function i(s){var o=t[s];if(void 0!==o)return o.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,i),r.exports}(()=>{i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t}})(),(()=>{i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}})(),(()=>{i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var s={};i.r(s),i.d(s,{default:()=>m});var o=i(1116),r=i.n(o),n=i(2015),a=i.n(n),h=i(5812),l=i.n(h),c=i(8311),p=i(9558);class u extends a().Component{constructor(e){super(e),r()(this,"processServerTimeResponse",((e,t)=>{const i=l()().unix();let s=i;e&&(s=e.timestamp+(i-t)),this._isMounted&&(console.log(`Clock::processServerTimeResponse setting timestamp ${s}`),this.setState({timestamp:s})),this.props.onTick&&this.props.onTick(s)})),r()(this,"processServerTimeResponseError",(()=>{let e=l()().unix();this._isMounted&&(console.log(`Clock::processServerTimeResponseError setting timestamp ${e}`),this.setState({timestamp:e})),this.props.onTick&&this.props.onTick(e)})),r()(this,"getServerTime",(()=>{const e=(0,p.getTimeServiceUrl)();return fetch(`${e}`).then((async e=>200===e.status?e.json():Promise.reject(null))).catch((e=>(console.log(e),Promise.reject(e))))})),r()(this,"tick",(()=>{const{timestamp:e}=this.state;null!==e&&(this.props.onTick&&this.props.onTick(e+1),this._isMounted&&this.setState({timestamp:e+1}))})),r()(this,"now",(()=>this.state.timestamp)),this.fragmentParser=new c.default,this.interval=null,this.state={timestamp:null,manualSet:!1},this._isMounted=!1,this.onVisibilityChange=this.onVisibilityChange.bind(this)}componentDidMount(){this._isMounted=!0;const{timezone:e="UTC",now:t}=this.props,i=this.fragmentParser.getParam("now"),s=l().tz(i,"YYYY-MM-DD,hh:mm:ss",e);let o=null,r=!1;if(s.isValid())o=s.valueOf()/1e3,console.log(`Clock::componentDidMount nowQS ${i} is valid setting timestamp ${o}`),r=!0;else if(t)o=t;else{const e=l()().unix();this.getServerTime().then((t=>this.processServerTimeResponse(t,e))).catch((()=>this.processServerTimeResponseError()))}o&&(this.setState({timestamp:o,manualSet:r}),this.props.onTick&&this.props.onTick(o)),this.interval=setInterval(this.tick,1e3),document.addEventListener("visibilitychange",this.onVisibilityChange,!1)}onVisibilityChange(){const e=document.visibilityState,{manualSet:t}=this.state;if("visible"===e){if(console.log(`Clock::onVisibilityChange manualSet ${t}`),t)return;const e=l()().unix();this.getServerTime().then((t=>this.processServerTimeResponse(t,e))).catch((()=>this.processServerTimeResponseError()))}}componentWillUnmount(){this._isMounted=!1,clearInterval(this.interval),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.interval=null}render(){const{display:e,timezone:t="UTC"}=this.props,{timestamp:i}=this.state;return e&&i?a().createElement("div",{style:{marginTop:"50px",textAlign:"center",fontSize:"20px"}},l().tz(1e3*i,t).format("YYYY-MM-DD hh:mm:ss")):null}}const m=u;return s})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={8311:(e,t,i)=>{i.d(t,{default:()=>n});var s=i(1116),r=i.n(s);function o(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}class n{constructor(){this.originalHash="",this.hash={}}convertToHash(e){let t=(e=e.substr(1).toLowerCase()).split("&"),i={};for(let e of t){if(e=e.split("="),2!==e.length)continue;let t=e[1].trim();""!==t&&("true"!==t&&"false"!==t||(e[1]="true"==t),i[e[0]]=e[1])}return i}clearParams(){this.originalHash="",this.hash={}}getParam(e){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),this.hash.hasOwnProperty(e)?this.hash[e]:null}getParams(){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach((function(t){r()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},this.hash)}deleteParam(e){var t=this.getParams();this.clearParams();for(let i in t)i!=e&&(this.hash[i]=t[i])}deleteParams(e){var t=this.getParams();this.clearParams();for(let i in t)e.includes(i)||(this.hash[i]=t[i])}setParam(e,t){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),null!==t&&""!==t?this.hash[e]=t:delete this.hash[e],this}serialize(){let e="";for(let t in this.hash){""!==e&&(e+="&"),e+=t+"="+this.hash[t]}return e}}},9128:(e,t,i)=>{i.d(t,{getTimeServiceUrl:()=>s});require("@sentry/react");i(5812),i(8041);const s=()=>"undefined"!=typeof window?window.TIMEINTERVALSINCE1970_API_URL||process.env.TIMEINTERVALSINCE1970_API_URL:null},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},8041:e=>{e.exports=require("urijs")}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,i),o.exports}(()=>{i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t}})(),(()=>{i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}})(),(()=>{i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var s={};i.r(s),i.d(s,{default:()=>m});var r=i(1116),o=i.n(r),n=i(2015),a=i.n(n),h=i(5812),l=i.n(h),c=i(8311),p=i(9128);class u extends a().Component{constructor(e){super(e),o()(this,"processServerTimeResponse",((e,t)=>{const i=l()().unix();let s=i;e&&(s=e.timestamp+(i-t)),this._isMounted&&(console.log(`Clock::processServerTimeResponse setting timestamp ${s}`),this.setState({timestamp:s})),this.props.onTick&&this.props.onTick(s)})),o()(this,"processServerTimeResponseError",(()=>{let e=l()().unix();this._isMounted&&(console.log(`Clock::processServerTimeResponseError setting timestamp ${e}`),this.setState({timestamp:e})),this.props.onTick&&this.props.onTick(e)})),o()(this,"getServerTime",(()=>{const e=(0,p.getTimeServiceUrl)();return fetch(`${e}`).then((async e=>200===e.status?e.json():Promise.reject(null))).catch((e=>(console.log(e),Promise.reject(e))))})),o()(this,"tick",(()=>{const{timestamp:e}=this.state;null!==e&&(this.props.onTick&&this.props.onTick(e+1),this._isMounted&&this.setState({timestamp:e+1}))})),o()(this,"now",(()=>this.state.timestamp)),this.fragmentParser=new c.default,this.interval=null,this.state={timestamp:null,manualSet:!1},this._isMounted=!1,this.onVisibilityChange=this.onVisibilityChange.bind(this)}componentDidMount(){this._isMounted=!0;const{timezone:e="UTC",now:t}=this.props,i=this.fragmentParser.getParam("now"),s=l().tz(i,"YYYY-MM-DD,hh:mm:ss",e);let r=null,o=!1;if(s.isValid())r=s.valueOf()/1e3,console.log(`Clock::componentDidMount nowQS ${i} is valid setting timestamp ${r}`),o=!0;else if(t)r=t;else{const e=l()().unix();this.getServerTime().then((t=>this.processServerTimeResponse(t,e))).catch((()=>this.processServerTimeResponseError()))}r&&(this.setState({timestamp:r,manualSet:o}),this.props.onTick&&this.props.onTick(r)),this.interval=setInterval(this.tick,1e3),document.addEventListener("visibilitychange",this.onVisibilityChange,!1)}onVisibilityChange(){const e=document.visibilityState,{manualSet:t}=this.state;if("visible"===e){if(console.log(`Clock::onVisibilityChange manualSet ${t}`),t)return;const e=l()().unix();this.getServerTime().then((t=>this.processServerTimeResponse(t,e))).catch((()=>this.processServerTimeResponseError()))}}componentWillUnmount(){this._isMounted=!1,clearInterval(this.interval),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.interval=null}render(){const{display:e,timezone:t="UTC"}=this.props,{timestamp:i}=this.state;return e&&i?a().createElement("div",{style:{marginTop:"50px",textAlign:"center",fontSize:"20px"}},l().tz(1e3*i,t).format("YYYY-MM-DD hh:mm:ss")):null}}const m=u;return s})()));
2
2
  //# sourceMappingURL=clock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/clock.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8B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AAMb,GAAa9D,KAAKiG,0BAA0BnC,EAAUC,KAC5DkB,OAAM,IAAMjF,KAAKkG,kCACzB,CACJ,CAEDM,oBAAAA,GACIxG,KAAKoE,YAAa,EAClBqC,cAAczG,KAAKqF,UACnBgB,SAASK,oBAAoB,mBAAoB1G,KAAKuF,oBACtDvF,KAAKqF,SAAW,IACnB,CA+BDsB,MAAAA,GACI,MAAM,QAACC,EAAD,SAAUlB,EAAW,OAAS1F,KAAK4D,OACnC,UAACO,GAAanE,KAAKmF,MAEzB,OAAKyB,GAAYzC,EAGb,yBAAK0C,MAAO,CAACC,UAAW,OAAQC,UAAW,SAAUC,SAAU,SAC1D/C,IAAAA,GAAsB,IAAZE,EAAkBuB,GAAUuB,OAAO,wBAJnB,IAOtC,EAIL,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/fragment-parser.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/clock.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","\nexport default class FragmentParser {\n\n constructor(){\n this.originalHash = '';\n this.hash = {};\n }\n\n convertToHash(strHash)\n {\n strHash = strHash.substr(1).toLowerCase();\n let params = strHash.split('&');\n let res = {};\n for(let param of params)\n {\n param = param.split('=');\n if(param.length !== 2) continue;\n let val = param[1].trim();\n if(val === '') continue;\n\n if (val === 'true' || val === 'false')\n param[1] = val == 'true';\n\n res[param[0]] = param[1];\n }\n return res;\n }\n\n clearParams(){\n this.originalHash = '';\n this.hash = {};\n }\n\n getParam(key){\n if(typeof window !== 'undefined' && this.originalHash !== window.location.hash){\n this.originalHash = window.location.hash;\n this.hash = this.convertToHash(this.originalHash);\n }\n\n if(!this.hash.hasOwnProperty(key) ) return null;\n return this.hash[key];\n }\n\n getParams(){\n if(typeof window !== 'undefined' && this.originalHash !== window.location.hash){\n this.originalHash = window.location.hash;\n this.hash = this.convertToHash(this.originalHash);\n }\n\n return { ... this.hash };\n }\n\n deleteParam(param){\n var hash = this.getParams();\n this.clearParams();\n for(let key in hash) {\n if(key == param) continue;\n this.hash[key] = hash[key];\n }\n }\n\n deleteParams(params){\n var hash = this.getParams();\n this.clearParams();\n for(let key in hash) {\n if(params.includes(key)) continue;\n this.hash[key] = hash[key];\n }\n }\n\n setParam(key, value){\n if(typeof window !== 'undefined' && this.originalHash !== window.location.hash){\n this.originalHash = window.location.hash;\n this.hash = this.convertToHash(this.originalHash);\n }\n if(value !== null && value !== '')\n this.hash[key] = value;\n else\n delete this.hash[key];\n return this;\n }\n\n serialize(){\n let res = '';\n for(let key in this.hash)\n {\n let val = this.hash[key];\n if(res !== '') res += '&';\n res += key+'='+val;\n }\n return res;\n }\n}\n","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n\nexport const isRateEnabled = (value) =>\n value !== null && value !== undefined && value !== \"\";\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2020 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\nimport React from 'react';\nimport moment from \"moment-timezone\";\nimport FragmentParser from \"./fragment-parser\";\nimport {getTimeServiceUrl} from '../utils/methods';\n\n/**\n * class Clock\n */\nclass Clock extends React.Component {\n\n constructor(props) {\n super(props);\n this.fragmentParser = new FragmentParser();\n this.interval = null;\n this.state = {\n timestamp: null,\n manualSet : false,\n }\n this._isMounted = false;\n this.onVisibilityChange = this.onVisibilityChange.bind(this);\n }\n\n /**\n * @param response\n * @param localBefore\n */\n processServerTimeResponse = (response, localBefore) => {\n const localAfter = moment().unix();\n let timestamp = localAfter;\n if (response) {\n timestamp = response.timestamp + (localAfter - localBefore);\n }\n if(this._isMounted) {\n console.log(`Clock::processServerTimeResponse setting timestamp ${timestamp}`)\n this.setState({timestamp});\n }\n if(this.props.onTick)\n this.props.onTick(timestamp);\n }\n\n processServerTimeResponseError = () => {\n const localAfter = moment().unix();\n let timestamp = localAfter;\n if(this._isMounted) {\n console.log(`Clock::processServerTimeResponseError setting timestamp ${timestamp}`)\n this.setState({timestamp});\n }\n if(this.props.onTick)\n this.props.onTick(timestamp);\n }\n\n componentDidMount() {\n this._isMounted = true;\n const {timezone = 'UTC', now} = this.props;\n const nowQS = this.fragmentParser.getParam('now');\n const momentQS = moment.tz(nowQS, 'YYYY-MM-DD,hh:mm:ss', timezone);\n let timestamp = null;\n let manualSet = false;\n if (momentQS.isValid()) {\n timestamp = momentQS.valueOf() / 1000;\n console.log(`Clock::componentDidMount nowQS ${nowQS} is valid setting timestamp ${timestamp}`);\n manualSet = true;\n } else if (now) {\n timestamp = now\n } else {\n const localBefore = moment().unix();\n this.getServerTime()\n .then((response) => this.processServerTimeResponse(response, localBefore))\n .catch(() => this.processServerTimeResponseError())\n }\n\n if(timestamp) {\n this.setState({timestamp, manualSet});\n if(this.props.onTick)\n this.props.onTick(timestamp);\n }\n\n this.interval = setInterval(this.tick, 1000);\n document.addEventListener(\"visibilitychange\", this.onVisibilityChange, false)\n }\n\n onVisibilityChange() {\n const visibilityState = document.visibilityState;\n const {manualSet} = this.state;\n if (visibilityState === \"visible\") {\n console.log(`Clock::onVisibilityChange manualSet ${manualSet}`)\n if(manualSet) return;\n const localBefore = moment().unix();\n this.getServerTime()\n .then((response) => this.processServerTimeResponse(response, localBefore))\n .catch(() => this.processServerTimeResponseError());\n }\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n clearInterval(this.interval);\n document.removeEventListener(\"visibilitychange\", this.onVisibilityChange)\n this.interval = null;\n }\n\n getServerTime = () => {\n const timeServiceUrl = getTimeServiceUrl();\n return fetch(`${timeServiceUrl}`).then(async (response) => {\n if (response.status === 200) {\n return response.json();\n }\n return Promise.reject(null);\n })\n .catch(err => {\n console.log(err);\n return Promise.reject(err);\n });\n };\n\n tick = () => {\n const {timestamp} = this.state;\n if (timestamp !== null) {\n if(this.props.onTick)\n this.props.onTick(timestamp + 1);\n if(this._isMounted)\n this.setState({timestamp: timestamp + 1})\n }\n };\n\n // epoch utc time in seconds\n now = () => {\n return this.state.timestamp;\n };\n\n render() {\n const {display, timezone = 'UTC'} = this.props;\n const {timestamp} = this.state;\n\n if (!display || !timestamp) return null;\n\n return (\n <div style={{marginTop: '50px', textAlign: 'center', fontSize: '20px'}}>\n {moment.tz(timestamp * 1000, timezone).format('YYYY-MM-DD hh:mm:ss')}\n </div>\n );\n }\n\n}\n\nexport default Clock;\n"],"names":["root","factory","exports","module","define","amd","this","FragmentParser","constructor","originalHash","hash","convertToHash","strHash","params","substr","toLowerCase","split","res","param","length","val","trim","clearParams","getParam","key","window","location","hasOwnProperty","getParams","deleteParam","deleteParams","includes","setParam","value","serialize","getTimeServiceUrl","TIMEINTERVALSINCE1970_API_URL","process","env","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","Clock","React","props","super","response","localBefore","localAfter","moment","unix","timestamp","_isMounted","console","log","setState","onTick","timeServiceUrl","fetch","then","async","status","json","Promise","reject","catch","err","state","fragmentParser","interval","manualSet","onVisibilityChange","bind","componentDidMount","timezone","now","nowQS","momentQS","isValid","valueOf","getServerTime","processServerTimeResponse","processServerTimeResponseError","setInterval","tick","document","addEventListener","visibilityState","componentWillUnmount","clearInterval","removeEventListener","render","display","style","marginTop","textAlign","fontSize","format"],"sourceRoot":""}
1
+ {"version":3,"file":"components/clock.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,qTCRM,MAAMC,EAEjBC,WAAAA,GACIF,KAAKG,aAAe,GACpBH,KAAKI,KAAe,CAAC,CACzB,CAEAC,aAAAA,CAAcC,GAGV,IAAIC,GADJD,EAAaA,EAAQE,OAAO,GAAGC,eACVC,MAAM,KACvBC,EAAM,CAAC,EACX,IAAI,IAAIC,KAASL,EACjB,CAEI,GADAK,EAAQA,EAAMF,MAAM,KACC,IAAlBE,EAAMC,OAAe,SACxB,IAAIC,EAAMF,EAAM,GAAGG,OACR,KAARD,IAES,SAARA,GAA0B,UAARA,IAClBF,EAAM,GAAY,QAAPE,GAEfH,EAAIC,EAAM,IAAMA,EAAM,GAC1B,CACA,OAAOD,CACX,CAEAK,WAAAA,GACIhB,KAAKG,aAAe,GACpBH,KAAKI,KAAe,CAAC,CACzB,CAEAa,QAAAA,CAASC,GAML,MALqB,oBAAXC,QAA0BnB,KAAKG,eAAiBgB,OAAOC,S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CAAkCsB,gCAAoCzB,KAClFmB,GAAa,OACV,GAAIK,EACPxB,EAAYwB,MACT,CACH,MAAM5B,EAAcE,MAASC,OAC7BpE,KAAKkG,gBACArB,MAAMb,GAAahE,KAAKmG,0BAA0BnC,EAAUC,KAC5DkB,OAAM,IAAMnF,KAAKoG,kCAC1B,CAEG/B,IACCrE,KAAKyE,SAAS,CAACJ,YAAWmB,cACvBxF,KAAK6D,MAAMa,QACV1E,KAAK6D,MAAMa,OAAOL,IAG1BrE,KAAKuF,SAAWc,YAAYrG,KAAKsG,KAAM,KACvCC,SAASC,iBAAiB,mBAAoBxG,KAAKyF,oBAAoB,EAC3E,CAEAA,kBAAAA,GACI,MAAMgB,EAAkBF,SAASE,iBAC3B,UAACjB,GAAaxF,KAAKqF,MACzB,GAAwB,YAApBoB,EAA+B,CAE/B,GADAlC,QAAQC,IAAI,uCAAuCgB,KAChDA,EAAW,OACd,MAAMvB,EAAcE,MAASC,OAC7BpE,KAAKkG,gBACArB,MAAMb,GAAahE,KAAKmG,0BAA0BnC,EAAUC,KAC5DkB,OAAM,IAAMnF,KAAKoG,kCAC1B,CACJ,CAEAM,oBAAAA,GACI1G,KAAKsE,YAAa,EAClBqC,cAAc3G,KAAKuF,UACnBgB,SAASK,oBAAoB,mBAAoB5G,KAAKyF,oBACtDzF,KAAKuF,SAAW,IACpB,CA+BAsB,MAAAA,GACI,MAAM,QAACC,EAAO,SAAElB,EAAW,OAAS5F,KAAK6D,OACnC,UAACQ,GAAarE,KAAKqF,MAEzB,OAAKyB,GAAYzC,EAGbT,IAAAA,cAAA,OAAKmD,MAAO,CAACC,UAAW,OAAQC,UAAW,SAAUC,SAAU,SAC1D/C,IAAAA,GAAsB,IAAZE,EAAkBuB,GAAUuB,OAAO,wBAJnB,IAOvC,EAIJ,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/fragment-parser.js","webpack://openstack-uicore-foundation/external commonjs \"@sentry/react\"","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/clock.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","\nexport default class FragmentParser {\n\n constructor(){\n this.originalHash = '';\n this.hash = {};\n }\n\n convertToHash(strHash)\n {\n strHash = strHash.substr(1).toLowerCase();\n let params = strHash.split('&');\n let res = {};\n for(let param of params)\n {\n param = param.split('=');\n if(param.length !== 2) continue;\n let val = param[1].trim();\n if(val === '') continue;\n\n if (val === 'true' || val === 'false')\n param[1] = val == 'true';\n\n res[param[0]] = param[1];\n }\n return res;\n }\n\n clearParams(){\n this.originalHash = '';\n this.hash = {};\n }\n\n getParam(key){\n if(typeof window !== 'undefined' && this.originalHash !== window.location.hash){\n this.originalHash = window.location.hash;\n this.hash = this.convertToHash(this.originalHash);\n }\n\n if(!this.hash.hasOwnProperty(key) ) return null;\n return this.hash[key];\n }\n\n getParams(){\n if(typeof window !== 'undefined' && this.originalHash !== window.location.hash){\n this.originalHash = window.location.hash;\n this.hash = this.convertToHash(this.originalHash);\n }\n\n return { ... this.hash };\n }\n\n deleteParam(param){\n var hash = this.getParams();\n this.clearParams();\n for(let key in hash) {\n if(key == param) continue;\n this.hash[key] = hash[key];\n }\n }\n\n deleteParams(params){\n var hash = this.getParams();\n this.clearParams();\n for(let key in hash) {\n if(params.includes(key)) continue;\n this.hash[key] = hash[key];\n }\n }\n\n setParam(key, value){\n if(typeof window !== 'undefined' && this.originalHash !== window.location.hash){\n this.originalHash = window.location.hash;\n this.hash = this.convertToHash(this.originalHash);\n }\n if(value !== null && value !== '')\n this.hash[key] = value;\n else\n delete this.hash[key];\n return this;\n }\n\n serialize(){\n let res = '';\n for(let key in this.hash)\n {\n let val = this.hash[key];\n if(res !== '') res += '&';\n res += key+'='+val;\n }\n return res;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@sentry/react\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport * as Sentry from \"@sentry/react\";\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n\nexport const isRateEnabled = (value) =>\n value !== null && value !== undefined && value !== \"\";\n\nconst isSentryInitialized = () => typeof window !== \"undefined\" && !!window.SENTRY_DSN;\n\nexport const handleSentryException = (err) =>\n isSentryInitialized()\n ? Sentry.captureException(err)\n : console.log(\"Error on registration: \", err);","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2020 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\nimport React from 'react';\nimport moment from \"moment-timezone\";\nimport FragmentParser from \"./fragment-parser\";\nimport {getTimeServiceUrl} from '../utils/methods';\n\n/**\n * class Clock\n */\nclass Clock extends React.Component {\n\n constructor(props) {\n super(props);\n this.fragmentParser = new FragmentParser();\n this.interval = null;\n this.state = {\n timestamp: null,\n manualSet : false,\n }\n this._isMounted = false;\n this.onVisibilityChange = this.onVisibilityChange.bind(this);\n }\n\n /**\n * @param response\n * @param localBefore\n */\n processServerTimeResponse = (response, localBefore) => {\n const localAfter = moment().unix();\n let timestamp = localAfter;\n if (response) {\n timestamp = response.timestamp + (localAfter - localBefore);\n }\n if(this._isMounted) {\n console.log(`Clock::processServerTimeResponse setting timestamp ${timestamp}`)\n this.setState({timestamp});\n }\n if(this.props.onTick)\n this.props.onTick(timestamp);\n }\n\n processServerTimeResponseError = () => {\n const localAfter = moment().unix();\n let timestamp = localAfter;\n if(this._isMounted) {\n console.log(`Clock::processServerTimeResponseError setting timestamp ${timestamp}`)\n this.setState({timestamp});\n }\n if(this.props.onTick)\n this.props.onTick(timestamp);\n }\n\n componentDidMount() {\n this._isMounted = true;\n const {timezone = 'UTC', now} = this.props;\n const nowQS = this.fragmentParser.getParam('now');\n const momentQS = moment.tz(nowQS, 'YYYY-MM-DD,hh:mm:ss', timezone);\n let timestamp = null;\n let manualSet = false;\n if (momentQS.isValid()) {\n timestamp = momentQS.valueOf() / 1000;\n console.log(`Clock::componentDidMount nowQS ${nowQS} is valid setting timestamp ${timestamp}`);\n manualSet = true;\n } else if (now) {\n timestamp = now\n } else {\n const localBefore = moment().unix();\n this.getServerTime()\n .then((response) => this.processServerTimeResponse(response, localBefore))\n .catch(() => this.processServerTimeResponseError())\n }\n\n if(timestamp) {\n this.setState({timestamp, manualSet});\n if(this.props.onTick)\n this.props.onTick(timestamp);\n }\n\n this.interval = setInterval(this.tick, 1000);\n document.addEventListener(\"visibilitychange\", this.onVisibilityChange, false)\n }\n\n onVisibilityChange() {\n const visibilityState = document.visibilityState;\n const {manualSet} = this.state;\n if (visibilityState === \"visible\") {\n console.log(`Clock::onVisibilityChange manualSet ${manualSet}`)\n if(manualSet) return;\n const localBefore = moment().unix();\n this.getServerTime()\n .then((response) => this.processServerTimeResponse(response, localBefore))\n .catch(() => this.processServerTimeResponseError());\n }\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n clearInterval(this.interval);\n document.removeEventListener(\"visibilitychange\", this.onVisibilityChange)\n this.interval = null;\n }\n\n getServerTime = () => {\n const timeServiceUrl = getTimeServiceUrl();\n return fetch(`${timeServiceUrl}`).then(async (response) => {\n if (response.status === 200) {\n return response.json();\n }\n return Promise.reject(null);\n })\n .catch(err => {\n console.log(err);\n return Promise.reject(err);\n });\n };\n\n tick = () => {\n const {timestamp} = this.state;\n if (timestamp !== null) {\n if(this.props.onTick)\n this.props.onTick(timestamp + 1);\n if(this._isMounted)\n this.setState({timestamp: timestamp + 1})\n }\n };\n\n // epoch utc time in seconds\n now = () => {\n return this.state.timestamp;\n };\n\n render() {\n const {display, timezone = 'UTC'} = this.props;\n const {timestamp} = this.state;\n\n if (!display || !timestamp) return null;\n\n return (\n <div style={{marginTop: '50px', textAlign: 'center', fontSize: '20px'}}>\n {moment.tz(timestamp * 1000, timezone).format('YYYY-MM-DD hh:mm:ss')}\n </div>\n );\n }\n\n}\n\nexport default Clock;\n"],"names":["root","factory","exports","module","define","amd","this","FragmentParser","constructor","originalHash","hash","convertToHash","strHash","params","substr","toLowerCase","split","res","param","length","val","trim","clearParams","getParam","key","window","location","hasOwnProperty","getParams","_objectSpread","deleteParam","deleteParams","includes","setParam","value","serialize","require","getTimeServiceUrl","TIMEINTERVALSINCE1970_API_URL","process","env","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","Clock","React","props","super","_defineProperty","response","localBefore","localAfter","moment","unix","timestamp","_isMounted","console","log","setState","onTick","timeServiceUrl","fetch","then","async","status","json","Promise","reject","catch","err","state","fragmentParser","interval","manualSet","onVisibilityChange","bind","componentDidMount","timezone","now","nowQS","momentQS","isValid","valueOf","getServerTime","processServerTimeResponse","processServerTimeResponseError","setInterval","tick","document","addEventListener","visibilityState","componentWillUnmount","clearInterval","removeEventListener","render","display","style","marginTop","textAlign","fontSize","format"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"components/exclusive-wrapper.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEnB,EAASkB,IAC5EE,OAAOC,eAAerB,EAASkB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAK7B,IACH,oBAAX8B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAerB,EAAS8B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAerB,EAAS,aAAc,CAAEgC,OAAO,GAAO,C,mECW/C,MAAMC,UAAkBC,IAAAA,UAEnCC,WAAAA,CAAYC,GACRC,MAAMD,GAENhC,KAAKkC,UAAYlC,KAAKkC,UAAUC,KAAKnC,KACxC,CAEDkC,SAAAA,GACI,IAAI,KAACE,GAAQpC,KAAKgC,MACdK,EAAoBC,OAAOC,mBAE/B,QAAOF,GAAoBA,EAAkBG,SAASJ,EACzD,CAEDK,MAAAA,GACI,IAAI,SAACC,GAAY1C,KAAKgC,MAEtB,OAAIhC,KAAKkC,YACEQ,EAGJ,IAEV,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/exclusive-wrapper.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2019 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react'\n\n\nexport default class Exclusive extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.showField = this.showField.bind(this);\n }\n\n showField() {\n let {name} = this.props;\n let exclusiveSections = window.EXCLUSIVE_SECTIONS;\n\n return exclusiveSections ? exclusiveSections.includes(name) : false;\n }\n\n render() {\n let {children} = this.props;\n\n if (this.showField()) {\n return children;\n }\n\n return null;\n\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Exclusive","React","constructor","props","super","showField","bind","name","exclusiveSections","window","EXCLUSIVE_SECTIONS","includes","render","children"],"sourceRoot":""}
1
+ {"version":3,"file":"components/exclusive-wrapper.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEnB,EAASkB,IAC5EE,OAAOC,eAAerB,EAASkB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAK7B,IACH,oBAAX8B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAerB,EAAS8B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAerB,EAAS,aAAc,CAAEgC,OAAO,GAAO,C,mECW/C,MAAMC,UAAkBC,IAAAA,UAEnCC,WAAAA,CAAYC,GACRC,MAAMD,GAENhC,KAAKkC,UAAYlC,KAAKkC,UAAUC,KAAKnC,KACzC,CAEAkC,SAAAA,GACI,IAAI,KAACE,GAAQpC,KAAKgC,MACdK,EAAoBC,OAAOC,mBAE/B,QAAOF,GAAoBA,EAAkBG,SAASJ,EAC1D,CAEAK,MAAAA,GACI,IAAI,SAACC,GAAY1C,KAAKgC,MAEtB,OAAIhC,KAAKkC,YACEQ,EAGJ,IAEX,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/exclusive-wrapper.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2019 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react'\n\n\nexport default class Exclusive extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.showField = this.showField.bind(this);\n }\n\n showField() {\n let {name} = this.props;\n let exclusiveSections = window.EXCLUSIVE_SECTIONS;\n\n return exclusiveSections ? exclusiveSections.includes(name) : false;\n }\n\n render() {\n let {children} = this.props;\n\n if (this.showField()) {\n return children;\n }\n\n return null;\n\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Exclusive","React","constructor","props","super","showField","bind","name","exclusiveSections","window","EXCLUSIVE_SECTIONS","includes","render","children"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"components/extra-questions-mui.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,+KCHT,EAJgB,QAAC,SAACC,EAAD,eAAWC,GAAiB,EAA5B,UAAmCC,EAAY,IAAhD,EAAuDC,EAAvD,gBACZ,8BAAMD,UAAWA,EACXE,wBAAyB,CAAEC,OAAQJ,EAAiBD,aAAH,EAAGA,EAAUM,QAAQ,MAAO,UAAYN,IAAeG,GAFlG,C,WCFhBP,EAAOD,QAAUY,QAAQ,iC,WCAzBX,EAAOD,QAAUY,QAAQ,iD,WCAzBX,EAAOD,QAAUY,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAahB,QAGrB,IAAIC,EAASY,EAAyBE,GAAY,CAGjDf,QAAS,CAAC,GAOX,OAHAkB,EAAoBH,GAAUd,EAAQA,EAAOD,QAASc,GAG/Cb,EAAOD,OACf,C,MCrBAc,EAAoBK,EAAKlB,IACxB,IAAImB,EAASnB,GAAUA,EAAOoB,WAC7B,IAAOpB,EAAiB,QACxB,IAAM,EAEP,OADAa,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACtB,EAASwB,KACjC,IAAI,IAAIC,KAAOD,EAC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ACE3G,IAAK2B,EACLJ,SAAUH,EACVI,kBAAmBA,EACnBC,WAAYA,GAERuF,GANN,UAQG5F,EAAEmG,0BARL,aAQG,EAAsB/D,KAAKkC,GAASD,EAAWC,EAAM/D,KAT1D,EAcF,OAAO,yBAAK7C,UAAWA,GAAYuG,EAAe7B,IAAI+C,GAAtD,EAGFnB,EAAkB7C,UAAY,CAC5B8C,eAAgB7C,IAAAA,MAAgBT,WAChCjD,UAAW0D,IAAAA,OACXhB,kBAAmBgB,IAAAA,OACnB+C,UAAW/C,IAAAA,KACX8C,SAAU9C,IAAAA,MAGZ,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/utils.js","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/TextQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/CheckboxQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/RadioListQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/CheckboxListQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/DropdownQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/index.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/constants.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} {...rest}/>\n\nexport default RawHTML;","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prop-types\");","import {\n QuestionType_Checkbox,\n QuestionType_CheckBoxList,\n QuestionType_ComboBox,\n QuestionType_CountryComboBox,\n QuestionType_RadioButtonList\n} from \"../constants\";\n\nexport const checkRule = (value, rule) => {\n const values = rule.answer_values;\n\n if (!value) return false;\n\n if (Array.isArray(value)) {\n if (!value.length) return false;\n let res = rule.answer_values_operator === \"And\";\n values.forEach((v) => {\n if (rule.answer_values_operator === \"And\") {\n res = res && value.includes(v);\n } else {\n // Or\n res = res || value.includes(v);\n }\n });\n return res;\n }\n return values.includes(value?.toString());\n};\n\nexport const checkVisibility = (rule, ruleResult) => {\n if (rule.visibility === \"Visible\") {\n if (rule.visibility_condition === \"Equal\") {\n return !!ruleResult;\n }\n // Non Equal\n return !ruleResult;\n }\n // not visible\n if (rule.visibility_condition === \"Equal\") {\n return !ruleResult;\n }\n return !!ruleResult;\n};\n\nexport const toSlug = (text, questionId) => {\n const textLC = text.toLowerCase();\n return `${textLC.replace(/[^a-zA-Z0-9]+/g, \"_\")}_${questionId}`;\n};\n\nexport const getLabel = (q) =>\n // replace line breaks and remove outer <p>\n q?.label?.replace(/\\n/g, \" \").replace(/<p>(.*)<\\/p>/gi, \"$1\");\n\nexport const isAnswered = (answer) => {\n if (!answer) return false;\n // check type\n if (Array.isArray(answer)) return answer.length > 0;\n if (typeof answer === \"string\") return answer.length > 0;\n if (typeof answer === \"number\") return answer > 0;\n if (typeof answer === \"boolean\") return answer;\n return false;\n};\n\nexport const checkIfValueMatch = (answer, compareVal) => {\n const answerArray = Array.isArray(answer) ? answer : [answer];\n\n return answerArray.some((v) => {\n if (Array.isArray(compareVal)) {\n return compareVal.includes(`${v}`);\n }\n return `${v}` === `${compareVal}`;\n });\n};\n\nexport const getTypeInitialValue = (q) => {\n switch (q.type) {\n case QuestionType_Checkbox:\n return false;\n case QuestionType_RadioButtonList:\n return null;\n case QuestionType_CheckBoxList:\n return [];\n case QuestionType_CountryComboBox:\n case QuestionType_ComboBox:\n return \"\";\n default:\n return \"\";\n }\n};\n\nexport const getTypeValue = (ans, type) => {\n switch (type) {\n case QuestionType_Checkbox:\n return ans === \"true\";\n case QuestionType_CheckBoxList:\n return ans?.split(\",\") || [];\n case QuestionType_CountryComboBox:\n case QuestionType_ComboBox:\n return ans || \"\";\n case QuestionType_RadioButtonList:\n return ans || null;\n default:\n return ans;\n }\n};\n\nexport const transformAnwersFormat = (answers) => {\n const {\n attendee_email,\n attendee_first_name,\n attendee_last_name,\n attendee_company,\n disclaimer_accepted,\n ...extra_questions\n } = answers;\n\n const formattedEQ = Object.entries(extra_questions).map(([key, value]) => ({\n question_id: parseInt(key.split(\"_\").pop(), 10),\n answer: value?.toString() || null\n }));\n\n return {\n attendee_email,\n attendee_first_name,\n attendee_last_name,\n attendee_company,\n disclaimer_accepted,\n extra_questions: formattedEQ\n };\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { FormGroup, TextField } from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst TextQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n setFieldValue,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormGroup>\n <TextField\n name={questionSlug}\n label={questionLabel}\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n />\n {children}\n </FormGroup>\n </div>\n );\n};\n\nTextQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n setFieldValue: PropTypes.func\n};\n\nexport default TextQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText\n} from \"@mui/material\";\nimport RawHTML from \"../../raw-html\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst CheckboxQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n value,\n error,\n helperText,\n setFieldValue,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl fullWidth margin=\"normal\" error={error}>\n <FormControlLabel\n sx={{ alignItems: \"flex-start\" }}\n control={\n <Checkbox\n name={questionSlug}\n checked={!!value}\n label={<RawHTML>{questionLabel}</RawHTML>}\n sx={{ marginTop: -1 }}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n />\n }\n label={<RawHTML>{questionLabel}</RawHTML>}\n disabled={isDisabled}\n required={isRequired}\n />\n {children}\n {error && <FormHelperText>{helperText ?? \" \"}</FormHelperText>}\n </FormControl>\n </div>\n );\n};\n\nCheckboxQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n value: PropTypes.bool,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n setFieldValue: PropTypes.func,\n error: PropTypes.bool,\n helperText: PropTypes.string\n};\n\nexport default CheckboxQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup\n} from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst RadioListQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n error,\n helperText,\n setFieldValue,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n const questionOptions =\n question.values?.map((val) => ({\n label: val.label,\n value: val.id.toString()\n })) || [];\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n error={error}\n >\n <FormLabel id={`${questionSlug}_label`}>{questionLabel}</FormLabel>\n {error && <FormHelperText>{helperText ?? \" \"}</FormHelperText>}\n <RadioGroup\n aria-labelledby={`${questionSlug}_label`}\n name={questionSlug}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n >\n {questionOptions.map((op) => (\n <FormControlLabel\n key={op.label}\n value={op.value}\n control={<Radio />}\n label={op.label}\n />\n ))}\n </RadioGroup>\n {children}\n </FormControl>\n </div>\n );\n};\n\nRadioListQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n error: PropTypes.bool,\n helperText: PropTypes.string,\n setFieldValue: PropTypes.func\n};\n\nexport default RadioListQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Checkbox,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText,\n FormLabel\n} from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst CheckboxListQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n value,\n onChange,\n setFieldValue,\n error,\n helperText,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n const questionMaxValues = question.max_selected_values;\n\n const questionOptions =\n question.values?.map((val) => ({\n label: val.label,\n value: val.id.toString()\n })) || [];\n\n const handleCheckboxListChange = (checked, val) => {\n const currentAns = value || [];\n const maxSelectionReached =\n questionMaxValues !== 0 && currentAns.length === questionMaxValues;\n let newValue;\n\n if (checked) {\n newValue = maxSelectionReached ? currentAns : [...currentAns, val];\n } else {\n newValue = currentAns.filter((v) => v !== val);\n }\n\n setFieldValue(questionSlug, newValue);\n };\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n error={error}\n >\n <FormLabel>{questionLabel}</FormLabel>\n {error && <FormHelperText>{helperText ?? \" \"}</FormHelperText>}\n <FormGroup>\n {questionOptions.map((op) => (\n <FormControlLabel\n key={op.label}\n name={questionSlug}\n control={\n <Checkbox\n checked={value?.includes(op.value)}\n onChange={(ev) =>\n handleCheckboxListChange(ev.target.checked, op.value)\n }\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n />\n }\n label={op.label}\n />\n ))}\n </FormGroup>\n {children}\n </FormControl>\n </div>\n );\n};\n\nCheckboxListQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n value: PropTypes.array,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n children: PropTypes.node,\n setFieldValue: PropTypes.func,\n error: PropTypes.bool,\n helperText: PropTypes.string\n};\n\nexport default CheckboxListQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { FormControl, InputLabel, MenuItem, Select } from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst DropdownQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n setFieldValue,\n children,\n error,\n helperText,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n const questionOptions =\n question.values?.map((val) => ({\n label: val.label,\n value: val.id\n })) || [];\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n error={error}\n >\n <InputLabel id={`${questionSlug}_label`}>{questionLabel}</InputLabel>\n <Select\n labelId={`${questionSlug}_label`}\n name={questionSlug}\n id={questionSlug}\n label={questionLabel}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n style={{ marginBottom: 20 }}\n >\n {questionOptions.map((op) => (\n <MenuItem key={op.label} value={op.value}>\n {op.label}\n </MenuItem>\n ))}\n </Select>\n {children}\n </FormControl>\n </div>\n );\n};\n\nDropdownQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n error: PropTypes.bool,\n helperText: PropTypes.string,\n setFieldValue: PropTypes.func\n};\n\nexport default DropdownQuestionField;\n","/**\n * Copyright 2025 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport {\n toSlug,\n isAnswered,\n checkVisibility,\n checkRule\n} from \"./components/utils\";\nimport {\n QuestionType_Checkbox,\n QuestionType_CheckBoxList,\n QuestionType_ComboBox,\n QuestionType_CountryComboBox,\n QuestionType_RadioButtonList,\n QuestionType_Text,\n QuestionType_TextArea\n} from \"./constants\";\nimport TextQuestionField from \"./components/TextQuestionField\";\nimport CheckboxQuestionField from \"./components/CheckboxQuestionField\";\nimport RadioListQuestionField from \"./components/RadioListQuestionField\";\nimport CheckboxListQuestionField from \"./components/CheckboxListQuestionField\";\nimport DropdownQuestionField from \"./components/DropdownQuestionField\";\n\nconst getQuestionFieldComponent = (questionType) => {\n switch (questionType) {\n case QuestionType_TextArea:\n case QuestionType_Text: {\n return TextQuestionField;\n }\n case QuestionType_Checkbox: {\n return CheckboxQuestionField;\n }\n case QuestionType_RadioButtonList: {\n return RadioListQuestionField;\n }\n case QuestionType_CheckBoxList: {\n return CheckboxListQuestionField;\n }\n case QuestionType_CountryComboBox:\n case QuestionType_ComboBox: {\n return DropdownQuestionField;\n }\n default: {\n return React.Fragment;\n }\n }\n};\n\nconst ExtraQuestionsMUI = ({\n extraQuestions,\n className = \"extraQuestions\",\n questionClassName = \"extraQuestion\",\n readOnly = false,\n allowEdit = true,\n formik\n}) => {\n const renderRule = (rule, questionSlug) => {\n const ruleResult = checkRule(formik.values[questionSlug], rule);\n const isVisible = checkVisibility(rule, ruleResult);\n\n if (isVisible) {\n // eslint-disable-next-line no-use-before-define\n return renderQuestion(rule.sub_question);\n }\n\n return null;\n };\n\n const renderQuestion = (q) => {\n const questionSlug = toSlug(q.name, q.id);\n // disable field if edit isn't allowed and the questions is answered\n const isDisabled =\n (!allowEdit && isAnswered(formik.values[questionSlug])) || readOnly;\n const QuestionFieldComponent = getQuestionFieldComponent(q.type);\n\n const formikProps = {\n value: formik.values[questionSlug],\n onChange: formik.handleChange,\n onBlur: formik.handleBlur,\n error:\n formik.touched[questionSlug] && Boolean(formik.errors[questionSlug]),\n helperText: formik.touched[questionSlug] && formik.errors[questionSlug],\n setFieldValue: formik.setFieldValue\n };\n\n return (\n <QuestionFieldComponent\n key={questionSlug}\n question={q}\n questionClassName={questionClassName}\n isDisabled={isDisabled}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...formikProps}\n >\n {q.sub_question_rules?.map((rule) => renderRule(rule, questionSlug))}\n </QuestionFieldComponent>\n );\n };\n\n return <div className={className}>{extraQuestions.map(renderQuestion)}</div>;\n};\n\nExtraQuestionsMUI.propTypes = {\n extraQuestions: PropTypes.array.isRequired,\n className: PropTypes.string,\n questionClassName: PropTypes.string,\n allowEdit: PropTypes.bool,\n readOnly: PropTypes.bool\n};\n\nexport default ExtraQuestionsMUI;\n","export const QuestionType_Text = \"Text\";\nexport const QuestionType_TextArea = \"TextArea\";\nexport const QuestionType_Checkbox = \"CheckBox\";\nexport const QuestionType_RadioButtonList = \"RadioButtonList\";\nexport const QuestionType_ComboBox = \"ComboBox\";\nexport const QuestionType_CheckBoxList = \"CheckBoxList\";\nexport const QuestionType_CountryComboBox = \"CountryComboBox\";\nexport const QuestionType_RadioButton = \"RadioButton\";\n"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","rest","dangerouslySetInnerHTML","__html","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","toSlug","text","questionId","toLowerCase","getLabel","q","label","TextQuestionField","question","questionClassName","isDisabled","setFieldValue","questionSlug","name","id","questionLabel","isRequired","mandatory","FormGroup","TextField","disabled","required","fullWidth","margin","propTypes","PropTypes","CheckboxQuestionField","error","helperText","FormControl","FormControlLabel","sx","alignItems","control","Checkbox","checked","marginTop","FormHelperText","RadioListQuestionField","questionOptions","values","map","val","toString","FormLabel","RadioGroup","op","Radio","CheckboxListQuestionField","onChange","questionMaxValues","max_selected_values","includes","ev","currentAns","maxSelectionReached","length","newValue","filter","v","handleCheckboxListChange","target","DropdownQuestionField","InputLabel","Select","labelId","style","marginBottom","MenuItem","ExtraQuestionsMUI","extraQuestions","readOnly","allowEdit","formik","renderRule","rule","ruleResult","answer_values","Array","isArray","res","answer_values_operator","forEach","checkRule","isVisible","visibility","visibility_condition","checkVisibility","renderQuestion","sub_question","answer","isAnswered","QuestionFieldComponent","questionType","React","getQuestionFieldComponent","type","formikProps","handleChange","onBlur","handleBlur","touched","Boolean","errors","sub_question_rules"],"sourceRoot":""}
1
+ {"version":3,"file":"components/extra-questions-mui.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAO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AAE8F,MAErDC,EAAc,CAClBrG,MAAO6E,EAAOjC,OAAO9B,GACrBuC,SAAUwB,EAAOyB,aACjBC,OAAQ1B,EAAO2B,WACf3E,MACEgD,EAAO4B,QAAQ3F,IAAiB4F,QAAQ7B,EAAO8B,OAAO7F,IACxDgB,WAAY+C,EAAO4B,QAAQ3F,IAAiB+D,EAAO8B,OAAO7F,GAC1DD,cAAegE,EAAOhE,eAGxB,OACE7C,IAAAA,cAACiI,EAAsBhI,IAAA,CACrBiB,IAAK4B,EACLJ,SAAUJ,EACVK,kBAAmBA,EACnBC,WAAYA,GAERyF,GAEiB,QAFNP,EAEdxF,EAAEsG,0BAAkB,IAAAd,OAAA,EAApBA,EAAsBjD,KAAKkC,GAASD,EAAWC,EAAMjE,KAC/B,EAI7B,OAAO9C,IAAAA,cAAA,OAAKJ,UAAWA,GAAY8G,EAAe7B,IAAI+C,GAAsB,EAG9EnB,EAAkB/C,UAAY,CAC5BgD,eAAgB/C,IAAAA,MAAgBT,WAChCtD,UAAW+D,IAAAA,OACXhB,kBAAmBgB,IAAAA,OACnBiD,UAAWjD,IAAAA,KACXgD,SAAUhD,IAAAA,MAGZ,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/utils.js","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/TextQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/CheckboxQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/RadioListQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/CheckboxListQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/components/DropdownQuestionField.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/index.js","webpack://openstack-uicore-foundation/./src/components/extra-questions-mui/constants.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} {...rest}/>\n\nexport default RawHTML;","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prop-types\");","import {\n QuestionType_Checkbox,\n QuestionType_CheckBoxList,\n QuestionType_ComboBox,\n QuestionType_CountryComboBox,\n QuestionType_RadioButtonList\n} from \"../constants\";\n\nexport const checkRule = (value, rule) => {\n const values = rule.answer_values;\n\n if (!value) return false;\n\n if (Array.isArray(value)) {\n if (!value.length) return false;\n let res = rule.answer_values_operator === \"And\";\n values.forEach((v) => {\n if (rule.answer_values_operator === \"And\") {\n res = res && value.includes(v);\n } else {\n // Or\n res = res || value.includes(v);\n }\n });\n return res;\n }\n return values.includes(value?.toString());\n};\n\nexport const checkVisibility = (rule, ruleResult) => {\n if (rule.visibility === \"Visible\") {\n if (rule.visibility_condition === \"Equal\") {\n return !!ruleResult;\n }\n // Non Equal\n return !ruleResult;\n }\n // not visible\n if (rule.visibility_condition === \"Equal\") {\n return !ruleResult;\n }\n return !!ruleResult;\n};\n\nexport const toSlug = (text, questionId) => {\n const textLC = text.toLowerCase();\n return `${textLC.replace(/[^a-zA-Z0-9]+/g, \"_\")}_${questionId}`;\n};\n\nexport const getLabel = (q) =>\n // replace line breaks and remove outer <p>\n q?.label?.replace(/\\n/g, \" \").replace(/<p>(.*)<\\/p>/gi, \"$1\");\n\nexport const isAnswered = (answer) => {\n if (!answer) return false;\n // check type\n if (Array.isArray(answer)) return answer.length > 0;\n if (typeof answer === \"string\") return answer.length > 0;\n if (typeof answer === \"number\") return answer > 0;\n if (typeof answer === \"boolean\") return answer;\n return false;\n};\n\nexport const checkIfValueMatch = (answer, compareVal) => {\n const answerArray = Array.isArray(answer) ? answer : [answer];\n\n return answerArray.some((v) => {\n if (Array.isArray(compareVal)) {\n return compareVal.includes(`${v}`);\n }\n return `${v}` === `${compareVal}`;\n });\n};\n\nexport const getTypeInitialValue = (q) => {\n switch (q.type) {\n case QuestionType_Checkbox:\n return false;\n case QuestionType_RadioButtonList:\n return null;\n case QuestionType_CheckBoxList:\n return [];\n case QuestionType_CountryComboBox:\n case QuestionType_ComboBox:\n return \"\";\n default:\n return \"\";\n }\n};\n\nexport const getTypeValue = (ans, type) => {\n switch (type) {\n case QuestionType_Checkbox:\n return ans === \"true\";\n case QuestionType_CheckBoxList:\n return ans?.split(\",\") || [];\n case QuestionType_CountryComboBox:\n case QuestionType_ComboBox:\n return ans || \"\";\n case QuestionType_RadioButtonList:\n return ans || null;\n default:\n return ans;\n }\n};\n\nexport const transformAnwersFormat = (answers) => {\n const {\n attendee_email,\n attendee_first_name,\n attendee_last_name,\n attendee_company,\n disclaimer_accepted,\n ...extra_questions\n } = answers;\n\n const formattedEQ = Object.entries(extra_questions).map(([key, value]) => ({\n question_id: parseInt(key.split(\"_\").pop(), 10),\n answer: value?.toString() || null\n }));\n\n return {\n attendee_email,\n attendee_first_name,\n attendee_last_name,\n attendee_company,\n disclaimer_accepted,\n extra_questions: formattedEQ\n };\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { FormGroup, TextField } from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst TextQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n setFieldValue,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormGroup>\n <TextField\n name={questionSlug}\n label={questionLabel}\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n />\n {children}\n </FormGroup>\n </div>\n );\n};\n\nTextQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n setFieldValue: PropTypes.func\n};\n\nexport default TextQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText\n} from \"@mui/material\";\nimport RawHTML from \"../../raw-html\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst CheckboxQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n value,\n error,\n helperText,\n setFieldValue,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl fullWidth margin=\"normal\" error={error}>\n <FormControlLabel\n sx={{ alignItems: \"flex-start\" }}\n control={\n <Checkbox\n name={questionSlug}\n checked={!!value}\n label={<RawHTML>{questionLabel}</RawHTML>}\n sx={{ marginTop: -1 }}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n />\n }\n label={<RawHTML>{questionLabel}</RawHTML>}\n disabled={isDisabled}\n required={isRequired}\n />\n {children}\n {error && <FormHelperText>{helperText ?? \" \"}</FormHelperText>}\n </FormControl>\n </div>\n );\n};\n\nCheckboxQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n value: PropTypes.bool,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n setFieldValue: PropTypes.func,\n error: PropTypes.bool,\n helperText: PropTypes.string\n};\n\nexport default CheckboxQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup\n} from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst RadioListQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n error,\n helperText,\n setFieldValue,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n const questionOptions =\n question.values?.map((val) => ({\n label: val.label,\n value: val.id.toString()\n })) || [];\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n error={error}\n >\n <FormLabel id={`${questionSlug}_label`}>{questionLabel}</FormLabel>\n {error && <FormHelperText>{helperText ?? \" \"}</FormHelperText>}\n <RadioGroup\n aria-labelledby={`${questionSlug}_label`}\n name={questionSlug}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n >\n {questionOptions.map((op) => (\n <FormControlLabel\n key={op.label}\n value={op.value}\n control={<Radio />}\n label={op.label}\n />\n ))}\n </RadioGroup>\n {children}\n </FormControl>\n </div>\n );\n};\n\nRadioListQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n error: PropTypes.bool,\n helperText: PropTypes.string,\n setFieldValue: PropTypes.func\n};\n\nexport default RadioListQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Checkbox,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText,\n FormLabel\n} from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst CheckboxListQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n children,\n value,\n onChange,\n setFieldValue,\n error,\n helperText,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n const questionMaxValues = question.max_selected_values;\n\n const questionOptions =\n question.values?.map((val) => ({\n label: val.label,\n value: val.id.toString()\n })) || [];\n\n const handleCheckboxListChange = (checked, val) => {\n const currentAns = value || [];\n const maxSelectionReached =\n questionMaxValues !== 0 && currentAns.length === questionMaxValues;\n let newValue;\n\n if (checked) {\n newValue = maxSelectionReached ? currentAns : [...currentAns, val];\n } else {\n newValue = currentAns.filter((v) => v !== val);\n }\n\n setFieldValue(questionSlug, newValue);\n };\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n error={error}\n >\n <FormLabel>{questionLabel}</FormLabel>\n {error && <FormHelperText>{helperText ?? \" \"}</FormHelperText>}\n <FormGroup>\n {questionOptions.map((op) => (\n <FormControlLabel\n key={op.label}\n name={questionSlug}\n control={\n <Checkbox\n checked={value?.includes(op.value)}\n onChange={(ev) =>\n handleCheckboxListChange(ev.target.checked, op.value)\n }\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n />\n }\n label={op.label}\n />\n ))}\n </FormGroup>\n {children}\n </FormControl>\n </div>\n );\n};\n\nCheckboxListQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n value: PropTypes.array,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n children: PropTypes.node,\n setFieldValue: PropTypes.func,\n error: PropTypes.bool,\n helperText: PropTypes.string\n};\n\nexport default CheckboxListQuestionField;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { FormControl, InputLabel, MenuItem, Select } from \"@mui/material\";\nimport { getLabel, toSlug } from \"./utils\";\n\nconst DropdownQuestionField = ({\n question,\n questionClassName = \"\",\n isDisabled = false,\n setFieldValue,\n children,\n error,\n helperText,\n ...rest\n}) => {\n const questionSlug = toSlug(question.name, question.id);\n const questionLabel = getLabel(question);\n const isRequired = question.mandatory;\n\n const questionOptions =\n question.values?.map((val) => ({\n label: val.label,\n value: val.id\n })) || [];\n\n return (\n <div\n key={questionSlug}\n id={`${questionSlug}_container`}\n className={questionClassName}\n >\n <FormControl\n disabled={isDisabled}\n required={isRequired}\n fullWidth\n margin=\"normal\"\n error={error}\n >\n <InputLabel id={`${questionSlug}_label`}>{questionLabel}</InputLabel>\n <Select\n labelId={`${questionSlug}_label`}\n name={questionSlug}\n id={questionSlug}\n label={questionLabel}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...rest}\n style={{ marginBottom: 20 }}\n >\n {questionOptions.map((op) => (\n <MenuItem key={op.label} value={op.value}>\n {op.label}\n </MenuItem>\n ))}\n </Select>\n {children}\n </FormControl>\n </div>\n );\n};\n\nDropdownQuestionField.propTypes = {\n question: PropTypes.object.isRequired,\n questionClassName: PropTypes.string,\n isDisabled: PropTypes.bool,\n children: PropTypes.node,\n error: PropTypes.bool,\n helperText: PropTypes.string,\n setFieldValue: PropTypes.func\n};\n\nexport default DropdownQuestionField;\n","/**\n * Copyright 2025 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport {\n toSlug,\n isAnswered,\n checkVisibility,\n checkRule\n} from \"./components/utils\";\nimport {\n QuestionType_Checkbox,\n QuestionType_CheckBoxList,\n QuestionType_ComboBox,\n QuestionType_CountryComboBox,\n QuestionType_RadioButtonList,\n QuestionType_Text,\n QuestionType_TextArea\n} from \"./constants\";\nimport TextQuestionField from \"./components/TextQuestionField\";\nimport CheckboxQuestionField from \"./components/CheckboxQuestionField\";\nimport RadioListQuestionField from \"./components/RadioListQuestionField\";\nimport CheckboxListQuestionField from \"./components/CheckboxListQuestionField\";\nimport DropdownQuestionField from \"./components/DropdownQuestionField\";\n\nconst getQuestionFieldComponent = (questionType) => {\n switch (questionType) {\n case QuestionType_TextArea:\n case QuestionType_Text: {\n return TextQuestionField;\n }\n case QuestionType_Checkbox: {\n return CheckboxQuestionField;\n }\n case QuestionType_RadioButtonList: {\n return RadioListQuestionField;\n }\n case QuestionType_CheckBoxList: {\n return CheckboxListQuestionField;\n }\n case QuestionType_CountryComboBox:\n case QuestionType_ComboBox: {\n return DropdownQuestionField;\n }\n default: {\n return React.Fragment;\n }\n }\n};\n\nconst ExtraQuestionsMUI = ({\n extraQuestions,\n className = \"extraQuestions\",\n questionClassName = \"extraQuestion\",\n readOnly = false,\n allowEdit = true,\n formik\n}) => {\n const renderRule = (rule, questionSlug) => {\n const ruleResult = checkRule(formik.values[questionSlug], rule);\n const isVisible = checkVisibility(rule, ruleResult);\n\n if (isVisible) {\n // eslint-disable-next-line no-use-before-define\n return renderQuestion(rule.sub_question);\n }\n\n return null;\n };\n\n const renderQuestion = (q) => {\n const questionSlug = toSlug(q.name, q.id);\n // disable field if edit isn't allowed and the questions is answered\n const isDisabled =\n (!allowEdit && isAnswered(formik.values[questionSlug])) || readOnly;\n const QuestionFieldComponent = getQuestionFieldComponent(q.type);\n\n const formikProps = {\n value: formik.values[questionSlug],\n onChange: formik.handleChange,\n onBlur: formik.handleBlur,\n error:\n formik.touched[questionSlug] && Boolean(formik.errors[questionSlug]),\n helperText: formik.touched[questionSlug] && formik.errors[questionSlug],\n setFieldValue: formik.setFieldValue\n };\n\n return (\n <QuestionFieldComponent\n key={questionSlug}\n question={q}\n questionClassName={questionClassName}\n isDisabled={isDisabled}\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...formikProps}\n >\n {q.sub_question_rules?.map((rule) => renderRule(rule, questionSlug))}\n </QuestionFieldComponent>\n );\n };\n\n return <div className={className}>{extraQuestions.map(renderQuestion)}</div>;\n};\n\nExtraQuestionsMUI.propTypes = {\n extraQuestions: PropTypes.array.isRequired,\n className: PropTypes.string,\n questionClassName: PropTypes.string,\n allowEdit: PropTypes.bool,\n readOnly: PropTypes.bool\n};\n\nexport default ExtraQuestionsMUI;\n","export const QuestionType_Text = \"Text\";\nexport const QuestionType_TextArea = \"TextArea\";\nexport const QuestionType_Checkbox = \"CheckBox\";\nexport const QuestionType_RadioButtonList = \"RadioButtonList\";\nexport const QuestionType_ComboBox = \"ComboBox\";\nexport const QuestionType_CheckBoxList = \"CheckBoxList\";\nexport const QuestionType_CountryComboBox = \"CountryComboBox\";\nexport const QuestionType_RadioButton = \"RadioButton\";\n"],"names":["root","factory","exports","module","define","amd","this","_ref","children","replaceNewLine","className","rest","_objectWithoutProperties","_excluded","React","_extends","dangerouslySetInnerHTML","__html","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","toSlug","text","questionId","toLowerCase","getLabel","q","_q$label","label","TextQuestionField","question","questionClassName","isDisabled","setFieldValue","questionSlug","name","id","questionLabel","isRequired","mandatory","FormGroup","TextField","disabled","required","fullWidth","margin","propTypes","PropTypes","CheckboxQuestionField","error","helperText","FormControl","FormControlLabel","sx","alignItems","control","Checkbox","checked","RawHTML","marginTop","FormHelperText","RadioListQuestionField","_question$values","questionOptions","values","map","val","toString","FormLabel","RadioGroup","op","Radio","CheckboxListQuestionField","onChange","questionMaxValues","max_selected_values","includes","ev","handleCheckboxListChange","currentAns","maxSelectionReached","length","newValue","filter","v","target","DropdownQuestionField","InputLabel","Select","labelId","style","marginBottom","MenuItem","ExtraQuestionsMUI","extraQuestions","readOnly","allowEdit","formik","renderRule","rule","ruleResult","checkRule","answer_values","Array","isArray","res","answer_values_operator","forEach","isVisible","checkVisibility","visibility","visibility_condition","renderQuestion","sub_question","_q$sub_question_rules","answer","isAnswered","QuestionFieldComponent","questionType","getQuestionFieldComponent","type","formikProps","handleChange","onBlur","handleBlur","touched","Boolean","errors","sub_question_rules"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={7017:(e,t,a)=>{a.d(t,{default:()=>p});var r=a(2462),n=a.n(r),l=a(9825),s=a.n(l),i=a(2015),o=a.n(i),u=a(6842),c=a.n(u),d=a(5028);a(1536);const m=["onChange","value","className","options","id","children","error","disabled","name","ariaLabelledBy"];class p extends o().Component{constructor(e){super(e);let t=!!e.value&&e.value.find((t=>!e.options.map((e=>e.value)).includes(t)));this.state={otherChecked:!!t},this.handleChange=this.handleChange.bind(this),this.handleOtherCBChange=this.handleOtherCBChange.bind(this)}handleChange(e){let t=this.props.options.map((e=>e.value)),a=this.props.value?[...this.props.value]:[];if("checkbox"===e.target.type)if(e.target.checked){const t=isNaN(e.target.value)?e.target.value:parseInt(e.target.value);a.push(t)}else a=a.filter((t=>t!=e.target.value));else a=a.filter((e=>t.includes(e))),a.push(e.target.value);let r={target:{id:this.props.id,value:a,type:"checkboxlist"}};this.props.onChange(r)}handleOtherCBChange(e){this.setState({otherChecked:e.target.checked})}render(){let e,t=this.props,{onChange:a,value:r,className:l,options:s,id:i,children:u,error:p,disabled:h,name:b,ariaLabelledBy:g}=t,{otherChecked:f}=(n()(t,m),this.state),v=this.props.hasOwnProperty("inline"),y=this.props.hasOwnProperty("allowOther"),_=!!r&&r.find((e=>!s.map((e=>e.value)).includes(e))),E=this.props.hasOwnProperty("error")&&""!==p,q=this.props.hasOwnProperty("disabled")&&1==h;return e=v?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px",marginTop:"7px"},o().createElement("div",{id:`chl_wrapper_${i}`,"aria-labelledby":g},o().createElement("div",{className:"checkboxes-div"+(E?" error":"")},s.map((t=>{let a=!!r&&r.includes(t.value);return o().createElement("div",{className:"form-check abc-checkbox",key:"radio_key_"+t.value,style:e},o().createElement("input",{type:"checkbox",id:`cb_${i}_${t.value}`,name:b||i,checked:a,disabled:q,onChange:this.handleChange,className:"form-check-input",value:t.value}),o().createElement("label",{className:"form-check-label",htmlFor:`cb_${i}_${t.value}`},o().createElement(d.default,null,t.label)))})),y&&o().createElement("div",{className:"form-check abc-checkbox",style:e},o().createElement("input",{type:"checkbox",id:"cb_other"+i,checked:f,disabled:q,onChange:this.handleOtherCBChange,className:"form-check-input",value:"other"}),o().createElement("label",{className:"form-check-label",htmlFor:"cb_other"+i},c().translate("general.other"))),y&&f&&o().createElement("div",{style:{paddingLeft:"22px",width:"50%"}},o().createElement("input",{className:"form-control",disabled:q,onChange:this.handleChange,value:_}))),E&&o().createElement("p",{className:"error-label"},p))}}p.defaultProps={ariaLabelledBy:null},p.propTypes={id:s().string.isRequired}},6604:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(6031),n=a.n(r),l=a(1116),s=a.n(l),i=a(2462),o=a.n(i),u=a(2015),c=a.n(u),d=a(8466),m=a.n(d);const p=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function h(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function b(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?h(Object(a),!0).forEach((function(t){s()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):h(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}class g extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){let t=null;t=this.props.isMulti?e?e.map((e=>e.value)):null:e?e.value:null;let a={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(a)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,clearable:s,disabled:i,overrideCSS:u,ariaLabelledBy:d}=e,h=o()(e,p),g=this.props.hasOwnProperty("error")&&""!=l,f=this.props.hasOwnProperty("clearable"),v=this.props.hasOwnProperty("disabled")&&1==i,y=null,_=r;this.props.hasOwnProperty("overrideCSS")&&0!=u||(_="dropdown "+r+" "+(g?"error":"")),y=this.props.isMulti?this.props.options.filter((e=>a.includes(e.value))):a instanceof Object||null==a?a:this.props.options.find((e=>e.value==a));const E={menu:e=>b(b({},e),{},{zIndex:999})};return c().createElement("div",null,c().createElement(m(),n()({className:_,value:y,onChange:this.handleChange,isClearable:f,isDisabled:v,styles:E,"aria-labelledby":d,formatOptionLabel:e=>c().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},h)),g&&c().createElement("p",{className:"error-label"},l))}}g.defaultProps={ariaLabelledBy:null}},5639:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(2462),n=a.n(r),l=a(2015),s=a.n(l),i=a(5028),o=a(9825),u=a.n(o);a(1536);const c=["onChange","value","className","error","ariaLabelledBy","disabled","options","id","name"];class d extends s().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e.target.value,type:"radio"}};this.props.onChange(t)}getLabel(e,t,a,r){return a?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},s().createElement(i.default,null,e.label)):r?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`},e.label):s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},s().createElement("h4",{style:{marginTop:"0px"}},e.label),s().createElement(i.default,null,e.description))}render(){let e,t=this.props,{onChange:a,value:r,className:l,error:i,ariaLabelledBy:o,disabled:u,options:d,id:m,name:p}=t,h=(n()(t,c),this.props.hasOwnProperty("error")&&""!=i),b=this.props.hasOwnProperty("inline"),g=this.props.hasOwnProperty("simple"),f=this.props.hasOwnProperty("disabled")&&1==u;return e=b?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px"},s().createElement("div",{id:`rl_wrapper_${m}`,"aria-labelledby":o},d.map((t=>{let a=t.value==r;return s().createElement("div",{className:"form-check abc-radio",key:`radio_key_${m}_${t.value}`,style:e},s().createElement("input",{className:"form-check-input",type:"radio",id:`radio_${m}_${t.value}`,value:t.value,checked:a,onChange:this.handleChange,disabled:f,name:p||`radio_${m}`}),this.getLabel(t,m,b,g))})),h&&s().createElement("p",{className:"error-label"},i))}}d.defaultProps={ariaLabelledBy:null},d.propTypes={id:u().string.isRequired}},7651:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(6031),n=a.n(r),l=a(2462),s=a.n(l),i=a(2015),o=a.n(i);const u=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class c extends o().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,t,a){this.props.value!==e.value&&(this.input.value=this.props.value)}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,ariaLabelledBy:i,containerClassName:c}=e,d=s()(e,u),m=this.props.hasOwnProperty("error")&&""!==l,p=this.props.hasOwnProperty("className")?r:"form-control",h=this.props.hasOwnProperty("containerClassName")?c:"container-form-control";return o().createElement("div",{className:h},o().createElement("input",n()({className:`${p} ${m?"error":""}`,ref:e=>{this.input=e},defaultValue:a,"aria-labelledby":i,onChange:this.handleChange},d)),m&&o().createElement("p",{className:"error-label"},l))}}c.defaultProps={ariaLabelledBy:null}},5028:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(6031),n=a.n(r),l=a(2462),s=a.n(l),i=a(2015),o=a.n(i);const u=["children","replaceNewLine","className"],c=e=>{let{children:t,replaceNewLine:a=!1,className:r=""}=e,l=s()(e,u);return o().createElement("span",n()({className:r,dangerouslySetInnerHTML:{__html:a?null==t?void 0:t.replace(/\n/g,"<br />"):t}},l))}},9558:(e,t,a)=>{a.d(t,{toSlug:()=>r});a(5812),a(8041);const r=e=>(e=e.toLowerCase()).replace(/[^a-zA-Z0-9]+/g,"_")},356:(e,t,a)=>{a.d(t,{default:()=>h});var r=a(1116),n=a.n(r),l=a(9558);function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const o="ComboBox",u="CheckBoxList",c="RadioButtonList",d=[o,u,c],m="And",p="Equal";class h{constructor(e,t=[]){n()(this,"_parseQuestion",(e=>{if(this.questionByName[(0,l.toSlug)(e.name)]=e,this.questionById[parseInt(e.id)]=e,e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules)this.rules[parseInt(t.id)]=t,this._parseQuestion(t.sub_question)})),n()(this,"_parseQuestions",(()=>{for(let e of this.questions)this._parseQuestion(e)})),n()(this,"_allowsValues",(e=>d.includes(e.type))),n()(this,"_allowsValue",((e,t)=>{let a=t.value.split(",").map((e=>parseInt(e)));for(let t of a)if(!e.values.map((e=>e.id)).includes(t))return!1;return!0})),n()(this,"_getAnswerFor",(e=>{let t=Number.isInteger(e)?e:e.id,a=this.answers[t]||null;return a||null})),n()(this,"_hasValue",(e=>""!==e.value)),n()(this,"_answerContains",((e,t)=>e.value.split(",").includes(t))),n()(this,"_isSubQuestionVisible",(e=>{let t=e.answer_values_operator===m;const a=this._getAnswerFor(e.parent_question_id);if(a)switch(e.visibility_condition){case p:for(let r of e.answer_values)t=e.answer_values_operator===m?t&&this._answerContains(a,r):t||this._answerContains(a,r);break;case"NotEqual":for(let r of e.answer_values)t=e.answer_values_operator===m?t&&!this._answerContains(a,r):t||!this._answerContains(a,r)}else t=e.visibility_condition!==p;return"Visible"===e.visibility?t:!t})),n()(this,"_isAnswered",(e=>{const t=this._getAnswerFor(e);if("MainQuestion"===e.class)return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));for(let a of e.parent_rules)if(this._isSubQuestionVisible(this.rules[a]))return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));return!0})),n()(this,"_checkQuestion",(e=>{let t=this._isAnswered(e);if(e.hasOwnProperty("sub_question_rules"))for(let a of e.sub_question_rules)t=t&&this._checkQuestion(a.sub_question);return t})),n()(this,"_formatQuestionAnswer",(e=>{var t,a;let r={};const n=(0,l.toSlug)(e.name);let s=null===(t=this.originalAnswers.find((t=>t.question_id===e.id)))||void 0===t?void 0:t.value;if(!s&&(null==e||null===(a=e.values)||void 0===a?void 0:a.length)>0){const t=e.values.find((e=>e.is_default));t&&(s=t.id.toString())}if(s&&("CheckBox"===e.type&&(s="false"!==s&&!!s),e.type!==c&&e.type!==o||(s=parseInt(s)),e.type===u&&(s=s.split(",").map((e=>parseInt(e)))||[])),r[n]=s||"",e.type===u&&""===r[n]&&(r[n]=[]),e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules){let e=this._formatQuestionAnswer(t.sub_question);r=i(i({},r),e)}return r})),n()(this,"formatAnswers",(()=>{let e={};return this.questions.forEach((t=>{let a=this._formatQuestionAnswer(t);e=i(i({},e),a)})),e})),n()(this,"completed",(()=>{let e=!0;for(let t of this.questions)e=e&&this._checkQuestion(t);return e})),n()(this,"getQuestionByName",(e=>{const t=(0,l.toSlug)(e);return this.questionByName[e]||this.questionByName[t]||null})),n()(this,"getQuestionById",(e=>this.questionById[parseInt(e)]||null)),this.questions=e,this.originalAnswers=t,this.answers=[];for(let e of this.originalAnswers)this.answers[e.question_id]=e;this.questionByName={},this.questionById={},this.rules={},this._parseQuestions()}}},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},1536:e=>{e.exports=require("awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},5812:e=>{e.exports=require("moment-timezone")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},8466:e=>{e.exports=require("react-select")},8041:e=>{e.exports=require("urijs")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.exports}(()=>{a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t}})(),(()=>{a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};a.r(r),a.d(r,{default:()=>B});var n=a(6031),l=a.n(n),s=a(2462),i=a.n(s),o=a(2015),u=a.n(o),c=a(9825),d=a.n(c),m=a(7651),p=a(6604),h=a(5639),b=a(7017),g=a(356);const f=require("react-final-form");var v=a(9558);const y="CheckBox",_="RadioButton";a(1536);const E=["input","meta","question","className","isDisabled","isRequired"],q=["input","meta","question","isDisabled","isRequired"],w=["input","meta","question","isDisabled","isRequired"],C=["input","meta","question","isDisabled","isRequired","maxValues"],S=e=>{let{input:t,meta:a,question:r,className:n,isDisabled:s,isRequired:o}=e,c=i()(e,E);return u().createElement(m.default,l()({},t,c,{containerClassName:n,name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,id:(0,v.toSlug)(r.name),value:t.value,disabled:s,required:o,onChange:t.onChange,placeholder:r.placeholder}))},N=e=>{let{input:t,meta:a,question:r,isDisabled:n,isRequired:s}=e,o=i()(e,q);return u().createElement(h.default,l()({},t,o,{name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,id:(0,v.toSlug)(r.name),overrideCSS:!0,value:t.value,disabled:n,required:s,onChange:t.onChange}))},k=e=>{let{input:t,meta:a,question:r,isDisabled:n,isRequired:s}=e,o=i()(e,w);return u().createElement(p.default,l()({},t,o,{name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,id:(0,v.toSlug)(r.name),overrideCSS:!0,className:"ddl-extra-questions-container",classNamePrefix:"ddl-extra-questions",value:t.value,disabled:n,required:s,onChange:t.onChange}))},x=e=>{let{input:t,meta:a,question:r,isDisabled:n,isRequired:s,maxValues:o}=e,c=i()(e,C);return u().createElement(b.default,l()({},t,c,{id:(0,v.toSlug)(r.name),name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,value:t.value,disabled:n,required:s,onChange:e=>{const a=e.target.value;return o>0&&a.length>o?null:t.onChange(e)}}))},O=e=>e?e=>e?void 0:"Required":()=>{},P=u().forwardRef((({extraQuestions:e,userAnswers:t,onAnswerChanges:a,className:r="questions-form",questionContainerClassName:n="question-container",questionLabelContainerClassName:l="question-label-container",questionControlContainerClassName:s="question-control-container",readOnly:i=!1,debug:c=!1,buttonText:d="Submit",RequiredErrorMessage:m="Required",ValidationErrorClassName:p="extra-question-error",allowExtraQuestionsEdit:h=!0,onError:b=e=>console.log("form errors: ",e),shouldScroll2FirstError:E=!0},q)=>{let w=null;const C=(0,o.useRef)({}),P=(0,o.useRef)(null),[B,L]=(0,o.useState)({});(0,o.useEffect)((()=>{F()}),[e]),(0,o.useImperativeHandle)(q,(()=>({doSubmit(){var e;null===(e=P.current)||void 0===e||e.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))},scroll2QuestionById(e){H(e)}})));const j=e=>(C.current[e]||(C.current[e]=u().createRef()),C.current[e]),F=()=>{const a=new g.default(e,t);L(a.formatAnswers())},$=({when:e,rule:t,children:a})=>u().createElement(f.Field,{name:e,subscription:{value:!0}},(({input:{value:e}})=>D(t,A(e,t),a))),R=({name:e})=>u().createElement(f.Field,{name:e,subscription:{error:!0,touched:!0,submitFailed:!0}},(({meta:{error:e,touched:t,submitFailed:a}})=>e&&(t||a)?u().createElement("div",{className:p},e):null)),A=(e,t)=>{let a=t.answer_values;if(Array.isArray(e)){if(!e.length)return!1;let r="And"===t.answer_values_operator;return a.forEach((a=>{r="And"===t.answer_values_operator?r&&e.includes(parseInt(a)):r||e.includes(parseInt(a))})),r}return a.includes(e.toString())},D=(e,t,a)=>"Visible"===e.visibility?"Equal"===e.visibility_condition?t?a:(delete C.current[e.sub_question.id],null):t?(delete C.current[e.sub_question.id],null):a:"Equal"===e.visibility_condition?t?(delete C.current[e.sub_question.id],null):a:t?a:(delete C.current[e.sub_question.id],null),I=e=>{var t;const a=String.fromCharCode(160),r=null==e||null===(t=e.label)||void 0===t?void 0:t.replace(/\n/g,"<br />").replace(/<p>(.*)<\/p>/gi,"$1"),n=[y,_],l=e.mandatory&&!n.includes(e.type)?`${r}${a}<b>*</b>`:r;return u().createElement("label",{dangerouslySetInnerHTML:{__html:l},htmlFor:(0,v.toSlug)(e.name),id:`${(0,v.toSlug)(e.name)} label`})},Q=e=>{let t=e.values;const a=!h&&((e,t)=>{const a=(0,v.toSlug)(e.name);if(!t.hasOwnProperty(a))return!1;const r=t[a];return Array.isArray(r)||"string"==typeof r?r.length>0:"number"==typeof r?r>0:"boolean"==typeof r&&r})(e,B);var r,i,c,d;if("Text"===e.type)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),question:e,isDisabled:a,isRequired:e.mandatory,validate:O(e.mandatory),component:S}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(r=e.sub_question_rules)||void 0===r?void 0:r.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if("TextArea"===e.type)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{validate:O(e.mandatory),name:(0,v.toSlug)(e.name),id:(0,v.toSlug)(e.name),disabled:a,required:e.mandatory,component:"textarea"}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(i=e.sub_question_rules)||void 0===i?void 0:i.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if(e.type===y)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:`${n} checkbox-wrapper`},u().createElement("div",{className:`${s} input-wrapper`},u().createElement("div",{className:"form-check abc-checkbox"},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),id:(0,v.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"checkbox",className:"form-check-input",component:"input"}),u().createElement("label",{className:"form-check-label",htmlFor:(0,v.toSlug)(e.name)}),e.mandatory&&u().createElement("span",{className:"checkbox-mandatory"},u().createElement("b",null,"*")))),u().createElement("span",{className:`eq-checkbox-label ${l}`},I(e))),u().createElement(R,{name:(0,v.toSlug)(e.name)}),(null===(c=e.sub_question_rules)||void 0===c?void 0:c.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if(e.type===_)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:`${n} checkbox-wrapper`},u().createElement("div",{className:`${s} input-wrapper`},u().createElement("div",{className:"form-check abc-radio"},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),id:(0,v.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"radio",className:"form-check-input",value:"true",component:"input"}),u().createElement("label",{className:"form-check-label",htmlFor:(0,v.toSlug)(e.name)}),e.mandatory&&u().createElement("span",{className:"checkbox-mandatory"},u().createElement("b",null,"*")))),u().createElement("span",{className:`eq-checkbox-label ${l}`},I(e))),u().createElement(R,{name:(0,v.toSlug)(e.name)}),(null===(d=e.sub_question_rules)||void 0===d?void 0:d.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if("RadioButtonList"===e.type){var m;const r=t.map((e=>({label:e.label,value:e.id})));return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:N}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(m=e.sub_question_rules)||void 0===m?void 0:m.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))))}if("ComboBox"===e.type||"CountryComboBox"===e.type){var p;const r=t.map((e=>({label:e.label,value:e.id})));return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:`${s} reactSelectDropdown`},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:k}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(p=e.sub_question_rules)||void 0===p?void 0:p.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))))}if("CheckBoxList"===e.type){var b;const r=t.map((e=>({label:e.label,value:e.id})));return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),className:s,validate:O(e.mandatory),options:r,question:e,maxValues:e.max_selected_values,isDisabled:a,isRequired:e.mandatory,component:x}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(b=e.sub_question_rules)||void 0===b?void 0:b.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))))}return null},V=(e,t,a)=>{var r;if(e.mandatory&&(e=>!!C.current[e.id])(e)){const r=(0,v.toSlug)(e.name);t.hasOwnProperty((0,v.toSlug)(r))&&""!==t[(0,v.toSlug)(r)]&&0!==t[r].length||(a[r]=m)}null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{V(e.sub_question,t,a)}))};if(!Object.keys(B).length)return null;const T=(e,t,a)=>{var r;t.includes((0,v.toSlug)(e.name))&&a.push(e),null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{T(e.sub_question,t,a)}))},M=t=>{const a=[];return e.forEach((e=>{T(e,t,a)})),a.sort(((e,t)=>e.order>t.order))[0]},H=e=>{const t=C.current[e];t&&t.current&&(t.current.focus(),t.current.scrollIntoView({behavior:"smooth",block:"center"}))};return Object.keys(B).length?u().createElement("div",{className:r},u().createElement(f.Form,{validate:t=>{const a={};return e.forEach((e=>{V(e,t,a)})),a},onSubmit:e=>{a(e)},initialValues:B},(({handleSubmit:t,form:a,submitting:r,pristine:n,values:l})=>(w=t,u().createElement("form",{onSubmit:e=>{const r=a.getRegisteredFields().filter((e=>a.getFieldState(e).invalid));if(r.length>0){const e=M(r);b(r,C.current[e.id],e.id),E&&(e=>{const t=M(e);t&&H(t.id)})(r)}t(e)},ref:P},i?u().createElement("fieldset",{disabled:"disabled"},e.map((e=>Q(e)))):e.map((e=>Q(e))),c&&u().createElement("pre",null,JSON.stringify(l,0,2)))))),!q&&u().createElement("button",{type:"submit",onClick:e=>{w(e)},style:{marginTop:10}},d)):null}));P.propTypes={extraQuestions:d().array.isRequired,userAnswers:d().array.isRequired,onAnswerChanges:d().func.isRequired,className:d().string,debug:d().bool,buttonText:d().string,questionContainerClassName:d().string,questionLabelContainerClassName:d().string,questionControlContainerClassName:d().string,RequiredErrorMessage:d().string,ValidationErrorClassName:d().string,allowExtraQuestionsEdit:d().bool,shouldScroll2FirstError:d().bool,readOnly:d().bool};const B=P;return r})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={7017:(e,t,a)=>{a.d(t,{default:()=>p});var r=a(2462),n=a.n(r),l=a(9825),s=a.n(l),i=a(2015),o=a.n(i),u=a(6842),c=a.n(u),d=a(5028);a(1536);const m=["onChange","value","className","options","id","children","error","disabled","name","ariaLabelledBy"];class p extends o().Component{constructor(e){super(e);let t=!!e.value&&e.value.find((t=>!e.options.map((e=>e.value)).includes(t)));this.state={otherChecked:!!t},this.handleChange=this.handleChange.bind(this),this.handleOtherCBChange=this.handleOtherCBChange.bind(this)}handleChange(e){let t=this.props.options.map((e=>e.value)),a=this.props.value?[...this.props.value]:[];if("checkbox"===e.target.type)if(e.target.checked){const t=isNaN(e.target.value)?e.target.value:parseInt(e.target.value);a.push(t)}else a=a.filter((t=>t!=e.target.value));else a=a.filter((e=>t.includes(e))),a.push(e.target.value);let r={target:{id:this.props.id,value:a,type:"checkboxlist"}};this.props.onChange(r)}handleOtherCBChange(e){this.setState({otherChecked:e.target.checked})}render(){let e,t=this.props,{onChange:a,value:r,className:l,options:s,id:i,children:u,error:p,disabled:h,name:b,ariaLabelledBy:g}=t,{otherChecked:f}=(n()(t,m),this.state),v=this.props.hasOwnProperty("inline"),y=this.props.hasOwnProperty("allowOther"),_=!!r&&r.find((e=>!s.map((e=>e.value)).includes(e))),E=this.props.hasOwnProperty("error")&&""!==p,q=this.props.hasOwnProperty("disabled")&&1==h;return e=v?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px",marginTop:"7px"},o().createElement("div",{id:`chl_wrapper_${i}`,"aria-labelledby":g},o().createElement("div",{className:"checkboxes-div"+(E?" error":"")},s.map((t=>{let a=!!r&&r.includes(t.value);return o().createElement("div",{className:"form-check abc-checkbox",key:"radio_key_"+t.value,style:e},o().createElement("input",{type:"checkbox",id:`cb_${i}_${t.value}`,name:b||i,checked:a,disabled:q,onChange:this.handleChange,className:"form-check-input",value:t.value}),o().createElement("label",{className:"form-check-label",htmlFor:`cb_${i}_${t.value}`},o().createElement(d.default,null,t.label)))})),y&&o().createElement("div",{className:"form-check abc-checkbox",style:e},o().createElement("input",{type:"checkbox",id:"cb_other"+i,checked:f,disabled:q,onChange:this.handleOtherCBChange,className:"form-check-input",value:"other"}),o().createElement("label",{className:"form-check-label",htmlFor:"cb_other"+i},c().translate("general.other"))),y&&f&&o().createElement("div",{style:{paddingLeft:"22px",width:"50%"}},o().createElement("input",{className:"form-control",disabled:q,onChange:this.handleChange,value:_}))),E&&o().createElement("p",{className:"error-label"},p))}}p.defaultProps={ariaLabelledBy:null},p.propTypes={id:s().string.isRequired}},6604:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(6031),n=a.n(r),l=a(1116),s=a.n(l),i=a(2462),o=a.n(i),u=a(2015),c=a.n(u),d=a(8466),m=a.n(d);const p=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function h(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function b(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?h(Object(a),!0).forEach((function(t){s()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):h(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}class g extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){let t=null;t=this.props.isMulti?e?e.map((e=>e.value)):null:e?e.value:null;let a={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(a)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,clearable:s,disabled:i,overrideCSS:u,ariaLabelledBy:d}=e,h=o()(e,p),g=this.props.hasOwnProperty("error")&&""!=l,f=this.props.hasOwnProperty("clearable"),v=this.props.hasOwnProperty("disabled")&&1==i,y=null,_=r;this.props.hasOwnProperty("overrideCSS")&&0!=u||(_="dropdown "+r+" "+(g?"error":"")),y=this.props.isMulti?this.props.options.filter((e=>a.includes(e.value))):a instanceof Object||null==a?a:this.props.options.find((e=>e.value==a));const E={menu:e=>b(b({},e),{},{zIndex:999})};return c().createElement("div",null,c().createElement(m(),n()({className:_,value:y,onChange:this.handleChange,isClearable:f,isDisabled:v,styles:E,"aria-labelledby":d,formatOptionLabel:e=>c().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},h)),g&&c().createElement("p",{className:"error-label"},l))}}g.defaultProps={ariaLabelledBy:null}},5639:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(2462),n=a.n(r),l=a(2015),s=a.n(l),i=a(5028),o=a(9825),u=a.n(o);a(1536);const c=["onChange","value","className","error","ariaLabelledBy","disabled","options","id","name"];class d extends s().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e.target.value,type:"radio"}};this.props.onChange(t)}getLabel(e,t,a,r){return a?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},s().createElement(i.default,null,e.label)):r?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`},e.label):s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},s().createElement("h4",{style:{marginTop:"0px"}},e.label),s().createElement(i.default,null,e.description))}render(){let e,t=this.props,{onChange:a,value:r,className:l,error:i,ariaLabelledBy:o,disabled:u,options:d,id:m,name:p}=t,h=(n()(t,c),this.props.hasOwnProperty("error")&&""!=i),b=this.props.hasOwnProperty("inline"),g=this.props.hasOwnProperty("simple"),f=this.props.hasOwnProperty("disabled")&&1==u;return e=b?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px"},s().createElement("div",{id:`rl_wrapper_${m}`,"aria-labelledby":o},d.map((t=>{let a=t.value==r;return s().createElement("div",{className:"form-check abc-radio",key:`radio_key_${m}_${t.value}`,style:e},s().createElement("input",{className:"form-check-input",type:"radio",id:`radio_${m}_${t.value}`,value:t.value,checked:a,onChange:this.handleChange,disabled:f,name:p||`radio_${m}`}),this.getLabel(t,m,b,g))})),h&&s().createElement("p",{className:"error-label"},i))}}d.defaultProps={ariaLabelledBy:null},d.propTypes={id:u().string.isRequired}},7651:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(6031),n=a.n(r),l=a(2462),s=a.n(l),i=a(2015),o=a.n(i);const u=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class c extends o().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,t,a){this.props.value!==e.value&&(this.input.value=this.props.value)}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,ariaLabelledBy:i,containerClassName:c}=e,d=s()(e,u),m=this.props.hasOwnProperty("error")&&""!==l,p=this.props.hasOwnProperty("className")?r:"form-control",h=this.props.hasOwnProperty("containerClassName")?c:"container-form-control";return o().createElement("div",{className:h},o().createElement("input",n()({className:`${p} ${m?"error":""}`,ref:e=>{this.input=e},defaultValue:a,"aria-labelledby":i,onChange:this.handleChange},d)),m&&o().createElement("p",{className:"error-label"},l))}}c.defaultProps={ariaLabelledBy:null}},5028:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(6031),n=a.n(r),l=a(2462),s=a.n(l),i=a(2015),o=a.n(i);const u=["children","replaceNewLine","className"],c=e=>{let{children:t,replaceNewLine:a=!1,className:r=""}=e,l=s()(e,u);return o().createElement("span",n()({className:r,dangerouslySetInnerHTML:{__html:a?null==t?void 0:t.replace(/\n/g,"<br />"):t}},l))}},9128:(e,t,a)=>{a.d(t,{toSlug:()=>r});require("@sentry/react");a(5812),a(8041);const r=e=>(e=e.toLowerCase()).replace(/[^a-zA-Z0-9]+/g,"_")},356:(e,t,a)=>{a.d(t,{default:()=>h});var r=a(1116),n=a.n(r),l=a(9128);function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const o="ComboBox",u="CheckBoxList",c="RadioButtonList",d=[o,u,c],m="And",p="Equal";class h{constructor(e,t=[]){n()(this,"_parseQuestion",(e=>{if(this.questionByName[(0,l.toSlug)(e.name)]=e,this.questionById[parseInt(e.id)]=e,e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules)this.rules[parseInt(t.id)]=t,this._parseQuestion(t.sub_question)})),n()(this,"_parseQuestions",(()=>{for(let e of this.questions)this._parseQuestion(e)})),n()(this,"_allowsValues",(e=>d.includes(e.type))),n()(this,"_allowsValue",((e,t)=>{let a=t.value.split(",").map((e=>parseInt(e)));for(let t of a)if(!e.values.map((e=>e.id)).includes(t))return!1;return!0})),n()(this,"_getAnswerFor",(e=>{let t=Number.isInteger(e)?e:e.id,a=this.answers[t]||null;return a||null})),n()(this,"_hasValue",(e=>""!==e.value)),n()(this,"_answerContains",((e,t)=>e.value.split(",").includes(t))),n()(this,"_isSubQuestionVisible",(e=>{let t=e.answer_values_operator===m;const a=this._getAnswerFor(e.parent_question_id);if(a)switch(e.visibility_condition){case p:for(let r of e.answer_values)t=e.answer_values_operator===m?t&&this._answerContains(a,r):t||this._answerContains(a,r);break;case"NotEqual":for(let r of e.answer_values)t=e.answer_values_operator===m?t&&!this._answerContains(a,r):t||!this._answerContains(a,r)}else t=e.visibility_condition!==p;return"Visible"===e.visibility?t:!t})),n()(this,"_isAnswered",(e=>{const t=this._getAnswerFor(e);if("MainQuestion"===e.class)return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));for(let a of e.parent_rules)if(this._isSubQuestionVisible(this.rules[a]))return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));return!0})),n()(this,"_checkQuestion",(e=>{let t=this._isAnswered(e);if(e.hasOwnProperty("sub_question_rules"))for(let a of e.sub_question_rules)t=t&&this._checkQuestion(a.sub_question);return t})),n()(this,"_formatQuestionAnswer",(e=>{var t,a;let r={};const n=(0,l.toSlug)(e.name);let s=null===(t=this.originalAnswers.find((t=>t.question_id===e.id)))||void 0===t?void 0:t.value;if(!s&&(null==e||null===(a=e.values)||void 0===a?void 0:a.length)>0){const t=e.values.find((e=>e.is_default));t&&(s=t.id.toString())}if(s&&("CheckBox"===e.type&&(s="false"!==s&&!!s),e.type!==c&&e.type!==o||(s=parseInt(s)),e.type===u&&(s=s.split(",").map((e=>parseInt(e)))||[])),r[n]=s||"",e.type===u&&""===r[n]&&(r[n]=[]),e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules){let e=this._formatQuestionAnswer(t.sub_question);r=i(i({},r),e)}return r})),n()(this,"formatAnswers",(()=>{let e={};return this.questions.forEach((t=>{let a=this._formatQuestionAnswer(t);e=i(i({},e),a)})),e})),n()(this,"completed",(()=>{let e=!0;for(let t of this.questions)e=e&&this._checkQuestion(t);return e})),n()(this,"getQuestionByName",(e=>{const t=(0,l.toSlug)(e);return this.questionByName[e]||this.questionByName[t]||null})),n()(this,"getQuestionById",(e=>this.questionById[parseInt(e)]||null)),this.questions=e,this.originalAnswers=t,this.answers=[];for(let e of this.originalAnswers)this.answers[e.question_id]=e;this.questionByName={},this.questionById={},this.rules={},this._parseQuestions()}}},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},1536:e=>{e.exports=require("awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},5812:e=>{e.exports=require("moment-timezone")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},8466:e=>{e.exports=require("react-select")},8041:e=>{e.exports=require("urijs")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.exports}(()=>{a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t}})(),(()=>{a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};a.r(r),a.d(r,{default:()=>B});var n=a(6031),l=a.n(n),s=a(2462),i=a.n(s),o=a(2015),u=a.n(o),c=a(9825),d=a.n(c),m=a(7651),p=a(6604),h=a(5639),b=a(7017),g=a(356);const f=require("react-final-form");var v=a(9128);const y="CheckBox",_="RadioButton";a(1536);const E=["input","meta","question","className","isDisabled","isRequired"],q=["input","meta","question","isDisabled","isRequired"],w=["input","meta","question","isDisabled","isRequired"],C=["input","meta","question","isDisabled","isRequired","maxValues"],S=e=>{let{input:t,meta:a,question:r,className:n,isDisabled:s,isRequired:o}=e,c=i()(e,E);return u().createElement(m.default,l()({},t,c,{containerClassName:n,name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,id:(0,v.toSlug)(r.name),value:t.value,disabled:s,required:o,onChange:t.onChange,placeholder:r.placeholder}))},N=e=>{let{input:t,meta:a,question:r,isDisabled:n,isRequired:s}=e,o=i()(e,q);return u().createElement(h.default,l()({},t,o,{name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,id:(0,v.toSlug)(r.name),overrideCSS:!0,value:t.value,disabled:n,required:s,onChange:t.onChange}))},k=e=>{let{input:t,meta:a,question:r,isDisabled:n,isRequired:s}=e,o=i()(e,w);return u().createElement(p.default,l()({},t,o,{name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,id:(0,v.toSlug)(r.name),overrideCSS:!0,className:"ddl-extra-questions-container",classNamePrefix:"ddl-extra-questions",value:t.value,disabled:n,required:s,onChange:t.onChange}))},x=e=>{let{input:t,meta:a,question:r,isDisabled:n,isRequired:s,maxValues:o}=e,c=i()(e,C);return u().createElement(b.default,l()({},t,c,{id:(0,v.toSlug)(r.name),name:(0,v.toSlug)(r.name),ariaLabelledBy:`${(0,v.toSlug)(r.name)} label`,value:t.value,disabled:n,required:s,onChange:e=>{const a=e.target.value;return o>0&&a.length>o?null:t.onChange(e)}}))},O=e=>e?e=>e?void 0:"Required":()=>{},P=u().forwardRef((({extraQuestions:e,userAnswers:t,onAnswerChanges:a,className:r="questions-form",questionContainerClassName:n="question-container",questionLabelContainerClassName:l="question-label-container",questionControlContainerClassName:s="question-control-container",readOnly:i=!1,debug:c=!1,buttonText:d="Submit",RequiredErrorMessage:m="Required",ValidationErrorClassName:p="extra-question-error",allowExtraQuestionsEdit:h=!0,onError:b=e=>console.log("form errors: ",e),shouldScroll2FirstError:E=!0},q)=>{let w=null;const C=(0,o.useRef)({}),P=(0,o.useRef)(null),[B,L]=(0,o.useState)({});(0,o.useEffect)((()=>{F()}),[e]),(0,o.useImperativeHandle)(q,(()=>({doSubmit(){var e;null===(e=P.current)||void 0===e||e.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))},scroll2QuestionById(e){H(e)}})));const j=e=>(C.current[e]||(C.current[e]=u().createRef()),C.current[e]),F=()=>{const a=new g.default(e,t);L(a.formatAnswers())},$=({when:e,rule:t,children:a})=>u().createElement(f.Field,{name:e,subscription:{value:!0}},(({input:{value:e}})=>D(t,A(e,t),a))),R=({name:e})=>u().createElement(f.Field,{name:e,subscription:{error:!0,touched:!0,submitFailed:!0}},(({meta:{error:e,touched:t,submitFailed:a}})=>e&&(t||a)?u().createElement("div",{className:p},e):null)),A=(e,t)=>{let a=t.answer_values;if(Array.isArray(e)){if(!e.length)return!1;let r="And"===t.answer_values_operator;return a.forEach((a=>{r="And"===t.answer_values_operator?r&&e.includes(parseInt(a)):r||e.includes(parseInt(a))})),r}return a.includes(e.toString())},D=(e,t,a)=>"Visible"===e.visibility?"Equal"===e.visibility_condition?t?a:(delete C.current[e.sub_question.id],null):t?(delete C.current[e.sub_question.id],null):a:"Equal"===e.visibility_condition?t?(delete C.current[e.sub_question.id],null):a:t?a:(delete C.current[e.sub_question.id],null),I=e=>{var t;const a=String.fromCharCode(160),r=null==e||null===(t=e.label)||void 0===t?void 0:t.replace(/\n/g,"<br />").replace(/<p>(.*)<\/p>/gi,"$1"),n=[y,_],l=e.mandatory&&!n.includes(e.type)?`${r}${a}<b>*</b>`:r;return u().createElement("label",{dangerouslySetInnerHTML:{__html:l},htmlFor:(0,v.toSlug)(e.name),id:`${(0,v.toSlug)(e.name)} label`})},Q=e=>{let t=e.values;const a=!h&&((e,t)=>{const a=(0,v.toSlug)(e.name);if(!t.hasOwnProperty(a))return!1;const r=t[a];return Array.isArray(r)||"string"==typeof r?r.length>0:"number"==typeof r?r>0:"boolean"==typeof r&&r})(e,B);var r,i,c,d;if("Text"===e.type)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),question:e,isDisabled:a,isRequired:e.mandatory,validate:O(e.mandatory),component:S}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(r=e.sub_question_rules)||void 0===r?void 0:r.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if("TextArea"===e.type)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{validate:O(e.mandatory),name:(0,v.toSlug)(e.name),id:(0,v.toSlug)(e.name),disabled:a,required:e.mandatory,component:"textarea"}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(i=e.sub_question_rules)||void 0===i?void 0:i.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if(e.type===y)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:`${n} checkbox-wrapper`},u().createElement("div",{className:`${s} input-wrapper`},u().createElement("div",{className:"form-check abc-checkbox"},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),id:(0,v.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"checkbox",className:"form-check-input",component:"input"}),u().createElement("label",{className:"form-check-label",htmlFor:(0,v.toSlug)(e.name)}),e.mandatory&&u().createElement("span",{className:"checkbox-mandatory"},u().createElement("b",null,"*")))),u().createElement("span",{className:`eq-checkbox-label ${l}`},I(e))),u().createElement(R,{name:(0,v.toSlug)(e.name)}),(null===(c=e.sub_question_rules)||void 0===c?void 0:c.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if(e.type===_)return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:`${n} checkbox-wrapper`},u().createElement("div",{className:`${s} input-wrapper`},u().createElement("div",{className:"form-check abc-radio"},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),id:(0,v.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"radio",className:"form-check-input",value:"true",component:"input"}),u().createElement("label",{className:"form-check-label",htmlFor:(0,v.toSlug)(e.name)}),e.mandatory&&u().createElement("span",{className:"checkbox-mandatory"},u().createElement("b",null,"*")))),u().createElement("span",{className:`eq-checkbox-label ${l}`},I(e))),u().createElement(R,{name:(0,v.toSlug)(e.name)}),(null===(d=e.sub_question_rules)||void 0===d?void 0:d.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))));if("RadioButtonList"===e.type){var m;const r=t.map((e=>({label:e.label,value:e.id})));return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:N}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(m=e.sub_question_rules)||void 0===m?void 0:m.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))))}if("ComboBox"===e.type||"CountryComboBox"===e.type){var p;const r=t.map((e=>({label:e.label,value:e.id})));return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:`${s} reactSelectDropdown`},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:k}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(p=e.sub_question_rules)||void 0===p?void 0:p.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))))}if("CheckBoxList"===e.type){var b;const r=t.map((e=>({label:e.label,value:e.id})));return u().createElement(o.Fragment,{key:(0,v.toSlug)(e.name)},u().createElement("div",{ref:j(e.id),className:n},u().createElement("span",{className:l},I(e)),u().createElement("div",{className:s},u().createElement(f.Field,{name:(0,v.toSlug)(e.name),className:s,validate:O(e.mandatory),options:r,question:e,maxValues:e.max_selected_values,isDisabled:a,isRequired:e.mandatory,component:x}),u().createElement(R,{name:(0,v.toSlug)(e.name)}))),(null===(b=e.sub_question_rules)||void 0===b?void 0:b.length)>0&&e.sub_question_rules.map((t=>u().createElement($,{key:t.id,when:(0,v.toSlug)(e.name),rule:t},Q(t.sub_question)))))}return null},V=(e,t,a)=>{var r;if(e.mandatory&&(e=>!!C.current[e.id])(e)){const r=(0,v.toSlug)(e.name);t.hasOwnProperty((0,v.toSlug)(r))&&""!==t[(0,v.toSlug)(r)]&&0!==t[r].length||(a[r]=m)}null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{V(e.sub_question,t,a)}))};if(!Object.keys(B).length)return null;const T=(e,t,a)=>{var r;t.includes((0,v.toSlug)(e.name))&&a.push(e),null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{T(e.sub_question,t,a)}))},M=t=>{const a=[];return e.forEach((e=>{T(e,t,a)})),a.sort(((e,t)=>e.order>t.order))[0]},H=e=>{const t=C.current[e];t&&t.current&&(t.current.focus(),t.current.scrollIntoView({behavior:"smooth",block:"center"}))};return Object.keys(B).length?u().createElement("div",{className:r},u().createElement(f.Form,{validate:t=>{const a={};return e.forEach((e=>{V(e,t,a)})),a},onSubmit:e=>{a(e)},initialValues:B},(({handleSubmit:t,form:a,submitting:r,pristine:n,values:l})=>(w=t,u().createElement("form",{onSubmit:e=>{const r=a.getRegisteredFields().filter((e=>a.getFieldState(e).invalid));if(r.length>0){const e=M(r);b(r,C.current[e.id],e.id),E&&(e=>{const t=M(e);t&&H(t.id)})(r)}t(e)},ref:P},i?u().createElement("fieldset",{disabled:"disabled"},e.map((e=>Q(e)))):e.map((e=>Q(e))),c&&u().createElement("pre",null,JSON.stringify(l,0,2)))))),!q&&u().createElement("button",{type:"submit",onClick:e=>{w(e)},style:{marginTop:10}},d)):null}));P.propTypes={extraQuestions:d().array.isRequired,userAnswers:d().array.isRequired,onAnswerChanges:d().func.isRequired,className:d().string,debug:d().bool,buttonText:d().string,questionContainerClassName:d().string,questionLabelContainerClassName:d().string,questionControlContainerClassName:d().string,RequiredErrorMessage:d().string,ValidationErrorClassName:d().string,allowExtraQuestionsEdit:d().bool,shouldScroll2FirstError:d().bool,readOnly:d().bool};const B=P;return r})()));
2
2
  //# sourceMappingURL=extra-questions.js.map