openstack-uicore-foundation 4.0.77 → 4.0.79

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 (53) hide show
  1. package/lib/components/attendance-tracker.js +1 -1
  2. package/lib/components/clock.js +1 -1
  3. package/lib/components/extra-questions.js +1 -1
  4. package/lib/components/forms/rsvp-form.js +1 -1
  5. package/lib/components/forms/simple-form.js +1 -1
  6. package/lib/components/free-text-search.js +1 -1
  7. package/lib/components/index.js +1 -1
  8. package/lib/components/inputs/access-levels-input.js +1 -1
  9. package/lib/components/inputs/action-dropdown.js +1 -1
  10. package/lib/components/inputs/checkbox-list.js +1 -1
  11. package/lib/components/inputs/company-input.js +1 -1
  12. package/lib/components/inputs/country-dropdown.js +1 -1
  13. package/lib/components/inputs/country-input.js +1 -1
  14. package/lib/components/inputs/datetimepicker.js +1 -1
  15. package/lib/components/inputs/dropdown.js +1 -1
  16. package/lib/components/inputs/editor-input.js +1 -1
  17. package/lib/components/inputs/event-input.js +1 -1
  18. package/lib/components/inputs/free-multi-text-input.js +1 -1
  19. package/lib/components/inputs/group-input.js +1 -1
  20. package/lib/components/inputs/language-input.js +1 -1
  21. package/lib/components/inputs/member-input.js +1 -1
  22. package/lib/components/inputs/operator-input.js +1 -1
  23. package/lib/components/inputs/organization-input.js +1 -1
  24. package/lib/components/inputs/promocode-input.js +1 -1
  25. package/lib/components/inputs/radio-list.js +1 -1
  26. package/lib/components/inputs/registration-company-input.js +1 -1
  27. package/lib/components/inputs/speaker-input.js +1 -1
  28. package/lib/components/inputs/sponsor-input.js +1 -1
  29. package/lib/components/inputs/summit-input.js +1 -1
  30. package/lib/components/inputs/tag-input.js +1 -1
  31. package/lib/components/inputs/text-input.js +1 -1
  32. package/lib/components/inputs/textarea-input.js +1 -1
  33. package/lib/components/inputs/ticket-types-input.js +1 -1
  34. package/lib/components/inputs/upload-input-v2.js +1 -1
  35. package/lib/components/inputs/upload-input.js +1 -1
  36. package/lib/components/sponsored-project-input.js +1 -1
  37. package/lib/components/table-editable.js +1 -1
  38. package/lib/components/table-sortable.js +1 -1
  39. package/lib/css/components/extra-questions.css +1 -1
  40. package/lib/css/components/free-text-search.css +1 -1
  41. package/lib/css/components/index.css +1 -1
  42. package/lib/security/abstract-auth-callback-route.js +1 -1
  43. package/lib/security/actions.js +1 -1
  44. package/lib/security/methods.js +1 -1
  45. package/lib/security/reducers.js +1 -1
  46. package/lib/security/session-checker.js +1 -1
  47. package/lib/utils/actions.js +1 -1
  48. package/lib/utils/fragment-parser.js +1 -1
  49. package/lib/utils/methods.js +1 -1
  50. package/lib/utils/query-actions.js +1 -1
  51. package/lib/utils/questions-set.js +1 -1
  52. package/lib/utils/reducers.js +1 -1
  53. package/package.json +7 -2
@@ -1 +1 @@
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={4341:(e,t,n)=>{n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=E(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&y()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=w(),n=g();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,E=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",y=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(4824),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySpeakers:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>p});var e=n(6689),t=n.n(e),a=n(9953),o=n.n(a);const s=require("react-select/lib/components");var c=n(7525);const i=["value","onChange","history","summitId","error","id","multi"];function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}class p extends t().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSpeakers=this.getSpeakers.bind(this),this.handleClick=this.handleClick.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"speakerinput"}};this.props.onChange(t)}handleClick(e){let{history:t}=this.props;t.push(`/app/speakers/${e}`)}getSpeakers(e,t){if(!e)return Promise.resolve({options:[]});let n=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,c.querySpeakers)(n,e,t)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.first_name} ${e.last_name} (${e.id})`}render(){let e=this.props,{value:n,onChange:r,history:a,summitId:c,error:p,id:u,multi:h}=e,f=d(e,i),R=this.props.hasOwnProperty("error")&&""!=p,m=this.props.hasOwnProperty("multi");return t().createElement("div",null,t().createElement(o(),l({value:n,onChange:this.handleChange,loadOptions:this.getSpeakers,components:{MultiValueLabel:e=>t().createElement("a",{onClick:()=>this.handleClick(e.data.id),style:{cursor:"pointer"}},t().createElement(s.components.MultiValueLabel,e))},getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:m},f)),R&&t().createElement("p",{className:"error-label"},p))}}})(),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={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(4824),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySpeakers:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>h});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i);const d=require("react-select/lib/components");var p=n(7525);const u=["value","onChange","history","summitId","error","id","multi"];class h extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSpeakers=this.getSpeakers.bind(this),this.handleClick=this.handleClick.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"speakerinput"}};this.props.onChange(t)}handleClick(e){let{history:t}=this.props;t.push(`/app/speakers/${e}`)}getSpeakers(e,t){if(!e)return Promise.resolve({options:[]});let n=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,p.querySpeakers)(n,e,t)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.first_name} ${e.last_name} (${e.id})`}render(){let e=this.props,{value:n,onChange:r,history:a,summitId:s,error:i,id:p,multi:h}=e,f=o()(e,u),R=this.props.hasOwnProperty("error")&&""!=i,m=this.props.hasOwnProperty("multi");return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getSpeakers,components:{MultiValueLabel:e=>c().createElement("a",{onClick:()=>this.handleClick(e.data.id),style:{cursor:"pointer"}},c().createElement(d.components.MultiValueLabel,e))},getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:m},f)),R&&c().createElement("p",{className:"error-label"},i))}}})(),r})()));
@@ -1 +1 @@
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={4341:(e,t,n)=>{n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>a,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>o,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",o="AUTH_ERROR_MISSING_REFRESH_TOKEN",a="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const o=require("browser-tabs-lock");var a=n.n(o);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(a()),l="openstackuicore.lock.getTokenSilently",i="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(l,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=g(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),a===i&&y()){if(!o)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(o),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(l)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=w(),n=E();const o={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:c,expires_in:l}=n;return{access_token:a,refresh_token:c,expires_in:l}}catch(e){throw console.log(e),e}},R=(e,t,n=null,o=null)=>{let a=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&a&&(n=a.refreshToken),null===o&&a&&(o=a.idToken),n&&(s.refreshToken=n),o&&(s.idToken=o),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",y=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>l,fetchResponseHandler:()=>i});n(4824),n(6530);var r=n(271),o=n.n(r),a=n(4656),s=n.n(a);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),l=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:o().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:o().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:o().fire("ERROR",n,"warning");case 500:o().fire("ERROR",s().translate("errors.server_error"),"error")}}),i=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>o,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>a,removeFromLocalStorage:()=>c,retryPromise:()=>i,setSessionClearingState:()=>l});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,o=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,a=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},l=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},i=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySponsors:()=>p});var r=n(4054),o=n(8576),a=n(6793);const s=require("lodash");var c=n.n(s),l=n(6530),i=n.n(l);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,o.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,o.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,a.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",l=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${l}&expand=tag,track_tag_group`:`/tags?filter=${l}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,a.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,o.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,a.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(n?"/published":""),i=encodeURIComponent(`title=@${t}`);fetch((0,a.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,o.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,a.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,o.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,o.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let c=i()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,o.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,o.getAccessToken)();let l=i()(`/api/${s}/summits/${e}/ticket-types`);if(l.addQuery("access_token",c),l.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);l.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);l.addQuery("filter[]",`audience==${e}`)}fetch((0,a.buildAPIBaseUrl)(l.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,o.getAccessToken)(),s=i()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,a.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,a.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>d});var e=n(6689),t=n.n(e),o=n(9953),a=n.n(o),s=n(7525);const c=["error","value","onChange","id","multi","summitId"];function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}class d extends t().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSponsors=this.getSponsors.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"sponsorinput"}};this.props.onChange(t)}getSponsors(e,t){let{summitId:n}=this.props;if(!e)return Promise.resolve({options:[]});(0,s.querySponsors)(n,e,t)}render(){let e=this.props,{error:n,value:r,onChange:o,id:s,multi:d,summitId:p}=e,u=i(e,c),h=this.props.hasOwnProperty("error")&&""!=n,f=this.props.hasOwnProperty("multi");return t().createElement("div",null,t().createElement(a(),l({value:r,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.company.name} (${e.sponsorship.label})`,onChange:this.handleChange,loadOptions:this.getSponsors,isMulti:f},u)),h&&t().createElement("p",{className:"error-label"},n))}}})(),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={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(4824),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySponsors:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>u});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525);const p=["error","value","onChange","id","multi","summitId"];class u extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSponsors=this.getSponsors.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"sponsorinput"}};this.props.onChange(t)}getSponsors(e,t){let{summitId:n}=this.props;if(!e)return Promise.resolve({options:[]});(0,d.querySponsors)(n,e,t)}render(){let e=this.props,{error:n,value:r,onChange:a,id:s,multi:i,summitId:d}=e,u=o()(e,p),h=this.props.hasOwnProperty("error")&&""!=n,f=this.props.hasOwnProperty("multi");return c().createElement("div",null,c().createElement(l(),t()({value:r,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.company.name} (${e.sponsorship.label})`,onChange:this.handleChange,loadOptions:this.getSponsors,isMulti:f},u)),h&&c().createElement("p",{className:"error-label"},n))}}})(),r})()));
@@ -1 +1 @@
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={4341:(e,t,n)=>{n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&y()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=w(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(u),void(0,r.removeFromLocalStorage)(p)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",y=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(4824),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySummits:()=>u});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,u=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>d});var e=n(6689),t=n.n(e),a=n(9953),o=n.n(a),s=n(7525);const c=["value","error","onChange","id","multi"];function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}class d extends t().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getSummits=this.getSummits.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"summitinput"}};this.props.onChange(t)}getSummits(e,t){if(!e)return Promise.resolve({options:[]});(0,s.querySummits)(e,t)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:d}=e,u=l(e,c),p=this.props.hasOwnProperty("multi"),h=this.props.hasOwnProperty("error")&&""!=r;return t().createElement("div",null,t().createElement(o(),i({value:n,onChange:this.handleChange,loadOptions:this.getSummits,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.name} (${e.id})`,isMulti:p},u)),h&&t().createElement("p",{className:"error-label"},r))}}})(),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={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(u),void(0,r.removeFromLocalStorage)(p)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(4824),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySummits:()=>u});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,u=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>p});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525);const u=["value","error","onChange","id","multi"];class p extends c().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getSummits=this.getSummits.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"summitinput"}};this.props.onChange(t)}getSummits(e,t){if(!e)return Promise.resolve({options:[]});(0,d.querySummits)(e,t)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:i}=e,d=o()(e,u),p=this.props.hasOwnProperty("multi"),h=this.props.hasOwnProperty("error")&&""!=r;return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getSummits,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.name} (${e.id})`,isMulti:p},d)),h&&c().createElement("p",{className:"error-label"},r))}}})(),r})()));
@@ -1 +1 @@
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={4341:(e,t,r)=>{r(4656),r(4054),r(6793),r(8576)},1593:(e,t,r)=>{r.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>n,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const n="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,r)=>{r.d(t,{getAccessToken:()=>h});var n=r(6793);r(4824);const a=require("browser-tabs-lock");var o=r.n(a);r(6530),r(3856),r(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=r(1593);const c=new(o()),l="openstackuicore.lock.getTokenSilently",i="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,n.retryPromise)((()=>c.acquireLock(l,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:r,accessTokenUpdatedAt:n,refreshToken:a}=e,o=w(),d=Math.floor(Date.now()/1e3);if(r-=20,d-n>r||null==t){if(console.log("getAccessToken access token expired"),o===i&&E()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:r,refresh_token:n}=e;return void 0===n&&(n=null),R(t,r,n),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(l)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),r=g();const a={grant_type:"refresh_token",client_id:encodeURI(r),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,n.getCurrentPathName)();throw(0,n.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),r=await e.json();let{access_token:o,refresh_token:c,expires_in:l}=r;return{access_token:o,refresh_token:c,expires_in:l}}catch(e){throw console.log(e),e}},R=(e,t,r=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===r&&o&&(r=o.refreshToken),null===a&&o&&(a=o.idToken),r&&(s.refreshToken=r),a&&(s.idToken=a),(0,n.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,n.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,n.removeFromLocalStorage)(d),(0,n.removeFromLocalStorage)(u),void(0,n.removeFromLocalStorage)(p)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,w=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",E=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,r)=>{r.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>l,fetchResponseHandler:()=>i});r(4824),r(6530);var n=r(271),a=r.n(n),o=r(4656),s=r.n(o);r(6793),r(4341),r(8576);const c=e=>t=>({type:e,payload:t}),l=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,r=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",r,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),i=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,r)=>{r.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>n,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>d,setSessionClearingState:()=>l,shallowEqual:()=>i});r(8362),r(6530);const n=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let r=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),r}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},l=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},i=(e,t)=>{const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(e[n]!==t[n])return!1;return!0},d=async(e,t=3)=>{for(let r=0;r<t;r++)if(await e())return!0;return!1}},7525:(e,t,r)=>{r.d(t,{queryTags:()=>u});var n=r(4054),a=r(8576),o=r(6793);const s=require("lodash");var c=r.n(s),l=r(6530),i=r.n(l);const d=500,u=(c().debounce((async(e,t)=>{const r=await(0,a.getAccessToken)();e=(0,n.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${r}`)).then(n.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,a.getAccessToken)();e=(0,n.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${r}`)).then(n.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,a.getAccessToken)();t=(0,n.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,a.getAccessToken)();t=(0,n.escapeFilterValue)(t);let c="/api/v1",l=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${l}&expand=tag,track_tag_group`:`/tags?filter=${l}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(n.fetchResponseHandler).then((t=>{let n=[...t.data];e&&(n=n.map((e=>e.tag))),r(n)})).catch(n.fetchErrorHandler)}),d));c().debounce((async(e,t,r)=>{const s=await(0,a.getAccessToken)();t=(0,n.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,n.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,n.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(r?"/published":""),i=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,n.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${r}`)).then(n.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,a.getAccessToken)();e=(0,n.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${r}`)).then(n.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void r(e)}let c=i()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,n.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,a.getAccessToken)();t=(0,n.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,a.getAccessToken)();t=(0,n.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,a.getAccessToken)();e=(0,n.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${r}`)).then(n.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(n.fetchErrorHandler)}),d);c().debounce((async(e,t={},r,s="v1")=>{const c=await(0,a.getAccessToken)();let l=i()(`/api/${s}/summits/${e}/ticket-types`);if(l.addQuery("access_token",c),l.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,n.escapeFilterValue)(t.name);l.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,n.escapeFilterValue)(t.audience);l.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(l.toString())).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,a.getAccessToken)(),s=i()("/api/v1/sponsored-projects");s.addQuery("access_token",r),e&&(e=(0,n.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(n.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(n.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,a.getAccessToken)();t=(0,n.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(n.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(n.fetchErrorHandler)}),d)},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},9503:e=>{e.exports=require("react-select/lib/AsyncCreatable")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{r.r(n),r.d(n,{default:()=>R});var e=r(6689),t=r.n(e),a=r(580),o=r.n(a),s=r(9953),c=r.n(s),l=r(9503),i=r.n(l),d=r(7525),u=r(6793);const p=["className","error","allowCreate"];function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}class R extends t().Component{constructor(e){super(e),this.state={tagValue:e.value.map((e=>({tag:e.tag,id:e.id})))},this.handleChange=this.handleChange.bind(this),this.handleNew=this.handleNew.bind(this),this.getTags=this.getTags.bind(this)}componentDidUpdate(e,t,r){if(!(0,u.shallowEqual)(this.props.value,e.value)){let e=this.props.value.map((e=>({tag:e.tag,id:e.id})));this.setState({tagValue:e})}}handleNew(e){const t={tag:e};this.props.onCreate(e,this.setState({value:[...this.state.tagValue,t]}))}handleChange(e){let t={target:{id:this.props.id,value:e,type:"taginput"}};this.props.onChange(t)}getTags(e,t){if(!e)return Promise.resolve({options:[]});let r=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,d.queryTags)(r,e,t)}render(){let e=this.props,{className:r,error:n,allowCreate:a}=e,o=f(e,p),{tagValue:s}=this.state,l=this.props.hasOwnProperty("error")&&""!=n,d=s.sort(((e,t)=>e.tag.toLowerCase()>t.tag.toLowerCase()?1:e.tag.toLowerCase()<t.tag.toLowerCase()?-1:0));const u=a?i():c();return t().createElement("div",null,t().createElement(u,h({},o,{className:r+" "+(l?"error":""),isMulti:!0,value:d,onChange:this.handleChange,onCreateOption:this.handleNew,loadOptions:this.getTags,getOptionLabel:e=>e.__isNew__?e.label:e.tag,getOptionValue:e=>e.__isNew__?e.value:e.tag})),l&&t().createElement("p",{className:"error-label"},n))}}R.propTypes={allowCreate:o().bool,className:o().string,summitId:o().number,id:o().string.isRequired,value:o().array,onCreate:o().func,onChange:o().func.isRequired},R.defaultProps={allowCreate:!1}})(),n})()));
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={4341:(e,t,r)=>{r(8779),r(4656),r(4054),r(6793),r(8576)},1593:(e,t,r)=>{r.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>a,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>n,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const a="AUTH_ERROR_MISSING_AUTH_INFO",n="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,r)=>{r.d(t,{getAccessToken:()=>h});var a=r(6793);r(4824);const n=require("browser-tabs-lock");var o=r.n(n);r(6530),r(3856),r(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=r(1593);const c=new(o()),l="openstackuicore.lock.getTokenSilently",i="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,a.retryPromise)((()=>c.acquireLock(l,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:r,accessTokenUpdatedAt:a,refreshToken:n}=e,o=w(),d=Math.floor(Date.now()/1e3);if(r-=20,d-a>r||null==t){if(console.log("getAccessToken access token expired"),o===i&&E()){if(!n)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(n),{access_token:t,expires_in:r,refresh_token:a}=e;return void 0===a&&(a=null),R(t,r,a),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(l)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),r=g();const n={grant_type:"refresh_token",client_id:encodeURI(r),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>{if(400===e.status){(0,a.getCurrentPathName)();throw(0,a.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),r=await e.json();let{access_token:o,refresh_token:c,expires_in:l}=r;return{access_token:o,refresh_token:c,expires_in:l}}catch(e){throw console.log(e),e}},R=(e,t,r=null,n=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===r&&o&&(r=o.refreshToken),null===n&&o&&(n=o.idToken),r&&(s.refreshToken=r),n&&(s.idToken=n),(0,a.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,a.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,a.removeFromLocalStorage)(d),(0,a.removeFromLocalStorage)(u),void(0,a.removeFromLocalStorage)(p)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,w=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",E=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,r)=>{r.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>l,fetchResponseHandler:()=>i});r(3838),r(4824),r(6530);var a=r(271),n=r.n(a),o=r(4656),s=r.n(o);r(6793),r(4341),r(8576);const c=e=>t=>({type:e,payload:t}),l=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,r=e.statusText;switch(t){case 403:n().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:n().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:n().fire("ERROR",r,"warning");case 500:n().fire("ERROR",s().translate("errors.server_error"),"error")}}),i=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,r)=>{r.d(t,{buildAPIBaseUrl:()=>n,getCurrentPathName:()=>a,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>d,setSessionClearingState:()=>l,shallowEqual:()=>i});r(8362),r(6530);const a=()=>"undefined"!=typeof window?window.location.pathname:null,n=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let r=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),r}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},l=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},i=(e,t)=>{const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let a of r)if(e[a]!==t[a])return!1;return!0},d=async(e,t=3)=>{for(let r=0;r<t;r++)if(await e())return!0;return!1}},7525:(e,t,r)=>{r.d(t,{queryTags:()=>u});var a=r(4054),n=r(8576),o=r(6793);const s=require("lodash");var c=r.n(s),l=r(6530),i=r.n(l);const d=500,u=(c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c="/api/v1",l=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${l}&expand=tag,track_tag_group`:`/tags?filter=${l}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((t=>{let a=[...t.data];e&&(a=a.map((e=>e.tag))),r(a)})).catch(a.fetchErrorHandler)}),d));c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();let c=(t=(0,a.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r=!1,s)=>{const c=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(r?"/published":""),i=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,n.getAccessToken)()}`;if(t=(0,a.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{let s;try{s=await(0,n.getAccessToken)()}catch(e){return void r(e)}let c=i()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,a.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d);c().debounce((async(e,t={},r,s="v1")=>{const c=await(0,n.getAccessToken)();let l=i()(`/api/${s}/summits/${e}/ticket-types`);if(l.addQuery("access_token",c),l.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,a.escapeFilterValue)(t.name);l.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,a.escapeFilterValue)(t.audience);l.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(l.toString())).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)(),s=i()("/api/v1/sponsored-projects");s.addQuery("access_token",r),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},9503:e=>{e.exports=require("react-select/lib/AsyncCreatable")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};return(()=>{r.r(a),r.d(a,{default:()=>m});var e=r(8213),t=r.n(e),n=r(3838),o=r.n(n),s=r(6689),c=r.n(s),l=r(580),i=r.n(l),d=r(9953),u=r.n(d),p=r(9503),h=r.n(p),f=r(7525),R=r(6793);const _=["className","error","allowCreate"];class m extends c().Component{constructor(e){super(e),this.state={tagValue:e.value.map((e=>({tag:e.tag,id:e.id})))},this.handleChange=this.handleChange.bind(this),this.handleNew=this.handleNew.bind(this),this.getTags=this.getTags.bind(this)}componentDidUpdate(e,t,r){if(!(0,R.shallowEqual)(this.props.value,e.value)){let e=this.props.value.map((e=>({tag:e.tag,id:e.id})));this.setState({tagValue:e})}}handleNew(e){const t={tag:e};this.props.onCreate(e,this.setState({value:[...this.state.tagValue,t]}))}handleChange(e){let t={target:{id:this.props.id,value:e,type:"taginput"}};this.props.onChange(t)}getTags(e,t){if(!e)return Promise.resolve({options:[]});let r=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,f.queryTags)(r,e,t)}render(){let e=this.props,{className:r,error:a,allowCreate:n}=e,s=o()(e,_),{tagValue:l}=this.state,i=this.props.hasOwnProperty("error")&&""!=a,d=l.sort(((e,t)=>e.tag.toLowerCase()>t.tag.toLowerCase()?1:e.tag.toLowerCase()<t.tag.toLowerCase()?-1:0));const p=n?h():u();return c().createElement("div",null,c().createElement(p,t()({},s,{className:r+" "+(i?"error":""),isMulti:!0,value:d,onChange:this.handleChange,onCreateOption:this.handleNew,loadOptions:this.getTags,getOptionLabel:e=>e.__isNew__?e.label:e.tag,getOptionValue:e=>e.__isNew__?e.value:e.tag})),i&&c().createElement("p",{className:"error-label"},a))}}m.propTypes={allowCreate:i().bool,className:i().string,summitId:i().number,id:i().string.isRequired,value:i().array,onCreate:i().func,onChange:i().func.isRequired},m.defaultProps={allowCreate:!1}})(),a})()));
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={6689:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>l});var e=t(6689),r=t.n(e);const n=["onChange","value","className","error","containerClassName"];function a(){return a=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},a.apply(this,arguments)}function s(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}class l extends r().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,r,t){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:o,className:l,error:i,containerClassName:p}=e,u=s(e,n),c=this.props.hasOwnProperty("error")&&""!==i,f=this.props.hasOwnProperty("className")?l:"form-control",d=this.props.hasOwnProperty("containerClassName")?p:"container-form-control";return r().createElement("div",{className:d},r().createElement("input",a({className:`${f} ${c?"error":""}`,ref:e=>{this.input=e},defaultValue:o,onChange:this.handleChange},u)),c&&r().createElement("p",{className:"error-label"},i))}}})(),o})()));
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},r={};function t(o){var a=r[o];if(void 0!==a)return a.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>p});var e=t(8213),r=t.n(e),a=t(3838),n=t.n(a),s=t(6689),l=t.n(s);const i=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class p extends l().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,r,t){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:o,className:a,error:s,ariaLabelledBy:p,containerClassName:u}=e,c=n()(e,i),d=this.props.hasOwnProperty("error")&&""!==s,h=this.props.hasOwnProperty("className")?a:"form-control",f=this.props.hasOwnProperty("containerClassName")?u:"container-form-control";return l().createElement("div",{className:f},l().createElement("input",r()({className:`${h} ${d?"error":""}`,ref:e=>{this.input=e},defaultValue:o,"aria-labelledby":p,onChange:this.handleChange},c)),d&&l().createElement("p",{className:"error-label"},s))}}p.defaultProps={ariaLabelledBy:null}})(),o})()));
@@ -1 +1 @@
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={6689:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{r.r(o),r.d(o,{default:()=>l});var e=r(6689),t=r.n(e);const n=["onChange","value","className","error"];function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},a.apply(this,arguments)}function s(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}class l extends t().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,t,r){this.props.value!==e.value&&this.setState({value:this.props.value})}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:r,value:o,className:l,error:p}=e,u=s(e,n),i=this.props.hasOwnProperty("error")&&""!=p,c=this.props.hasOwnProperty("className")?l:"form-control";return t().createElement("div",null,t().createElement("textarea",a({className:c+" "+(i?"error":""),value:this.state.value,onChange:this.handleChange},u)),i&&t().createElement("p",{className:"error-label"},p))}}})(),o})()));
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={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},t={};function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{r.r(o),r.d(o,{default:()=>i});var e=r(8213),t=r.n(e),a=r(3838),n=r.n(a),s=r(6689),l=r.n(s);const p=["onChange","value","className","error"];class i extends l().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,t,r){this.props.value!==e.value&&this.setState({value:this.props.value})}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:r,value:o,className:a,error:s}=e,i=n()(e,p),u=this.props.hasOwnProperty("error")&&""!=s,c=this.props.hasOwnProperty("className")?a:"form-control";return l().createElement("div",null,l().createElement("textarea",t()({className:c+" "+(u?"error":""),value:this.state.value,onChange:this.handleChange},i)),u&&l().createElement("p",{className:"error-label"},s))}}})(),o})()));
@@ -1 +1 @@
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={4341:(e,t,n)=>{n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&E()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=w(),n=g();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",E=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(4824),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{queryTicketTypes:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500;c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);const p=c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>h});var e=n(6689),t=n.n(e),a=n(9953),o=n.n(a),s=n(7525),c=n(580),i=n.n(c);const l=["value","error","onChange","id","multi"];function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}class u extends t().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getTicketTypes=this.getTicketTypes.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.name}`}handleChange(e){let t={target:{id:this.props.id,value:e,type:"tickettypeinput"}};this.props.onChange(t)}getTicketTypes(e,t){let{summitId:n,version:r}=this.props;if(!e)return Promise.resolve({options:[]});let a={name:e};this.props.hasOwnProperty("audience")&&(a.audience=this.props.audience),(0,s.queryTicketTypes)(n,a,t,r)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:c}=e,i=p(e,l),u=this.props.hasOwnProperty("multi"),h=this.props.hasOwnProperty("error")&&""!=r;return t().createElement("div",null,t().createElement(o(),d({value:n,onChange:this.handleChange,loadOptions:this.getTicketTypes,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:u},i)),h&&t().createElement("p",{className:"error-label"},r))}}u.defaultProps={version:"v1"},u.propTypes={audience:i().string,version:i().string};const h=u})(),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={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(4824);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=E(),d=Math.floor(Date.now()/1e3);if(n-=20,d-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&y()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=w(),n=g();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,E=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",y=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(4824),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{queryTicketTypes:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500;c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);const p=c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},4824:e=>{e.exports=require("superagent")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>R});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525),p=n(580),u=n.n(p);const h=["value","error","onChange","id","multi"];class f extends c().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getTicketTypes=this.getTicketTypes.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.name}`}handleChange(e){let t={target:{id:this.props.id,value:e,type:"tickettypeinput"}};this.props.onChange(t)}getTicketTypes(e,t){let{summitId:n,version:r}=this.props;if(!e)return Promise.resolve({options:[]});let a={name:e};this.props.hasOwnProperty("audience")&&(a.audience=this.props.audience),(0,d.queryTicketTypes)(n,a,t,r)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:i}=e,d=o()(e,h),p=this.props.hasOwnProperty("multi"),u=this.props.hasOwnProperty("error")&&""!=r;return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getTicketTypes,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:p},d)),u&&c().createElement("p",{className:"error-label"},r))}}f.defaultProps={version:"v1"},f.propTypes={audience:u().string,version:u().string};const R=f})(),r})()));
@@ -1 +1 @@
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={6961:e=>{e.exports=require("dropzone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{o.r(r),o.d(r,{default:()=>y});var e=o(6689),t=o.n(e);const n=require("react-dom");var s=o.n(n);const i=require("extend");var p=o.n(i);require("dropzone/dist/dropzone.css");const l=e=>t().createElement("div",{"data-filetype":e.filetype,className:"filepicker-file-icon"});var a=o(580),d=o.n(a);let c=null;class h extends t().Component{constructor(e){super(e),this.state={files:[]},this.onUploadComplete=this.onUploadComplete.bind(this)}onUploadComplete(e){this.props.onUploadComplete&&this.props.onUploadComplete(e,this.props.id,this.props.data)}getDjsConfig(){let e=null;const t={url:this.props.config.postUrl?this.props.config.postUrl:null};return e=this.props.djsConfig?p()(!0,{},t,this.props.djsConfig):t,e.accept=(t,o)=>{e.maxFiles&&e.maxFiles<this.state.files.length+this.props.uploadCount&&o("Max files reached"),o()},e}componentDidMount(){const e=this.getDjsConfig();c=c||o(6961),c.autoDiscover=!1,this.props.config.postUrl||this.props.eventHandlers.drop||console.info('Neither postUrl nor a "drop" eventHandler specified, the React-Dropzone component might misbehave.');var t=this.props.config.dropzoneSelector||s().findDOMNode(this);this.dropzone=new c(t,e),this.setupEvents()}componentWillUnmount(){if(this.dropzone){if(this.dropzone.getActiveFiles().length>0){this.queueDestroy=!0;const e=window.setInterval((()=>!1===this.queueDestroy?window.clearInterval(e):0===this.dropzone.getActiveFiles().length?(this.dropzone=this.destroy(this.dropzone),window.clearInterval(e)):void 0),500)}else this.dropzone=this.destroy(this.dropzone)}}componentDidUpdate(){const{config:e,djsConfig:t}=this.props,o=t||{},r=e&&e.postUrl?{url:e.postUrl}:{};if(this.queueDestroy=!1,!this.dropzone){const e=this.props.config.dropzoneSelector||s().findDOMNode(this);this.dropzone=new c(e,this.getDjsConfig())}this.dropzone.options=p()(!0,{},this.dropzone.options,o,r)}render(){const e=[],{files:o}=this.state,{config:r}=this.props,n=this.props.className?"filepicker dropzone "+this.props.className:"filepicker dropzone";if(r.showFiletypeIcon&&r.iconFiletypes&&(!o||o.length<1))for(var s=0;s<this.props.config.iconFiletypes.length;s+=1)e.push(t().createElement(l,{filetype:r.iconFiletypes[s],key:"icon-component"+s}));return!this.props.config.postUrl&&this.props.action?t().createElement("form",{action:this.props.action,className:n},e,this.props.children):t().createElement("div",{id:this.props.id,className:n}," ",e," ",this.props.children," ")}setupEvents(){const e=this.props.eventHandlers;if(this.dropzone&&e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])if("[object Array]"===Object.prototype.toString.call(e[t]))for(var o=0;o<e[t].length;o+=1)"init"===t?e[t][o](this.dropzone):this.dropzone.on(t,e[t][o]);else"init"===t?e[t](this.dropzone):this.dropzone.on(t,e[t]);this.dropzone.on("addedfile",(e=>{if(!e)return;const t=this.state.files||[];t.push(e),this.setState({files:t})})),this.dropzone.on("removedfile",(e=>{if(!e)return;const t=this.state.files||[];t.forEach(((o,r)=>{o.name===e.name&&o.size===e.size&&t.splice(r,1)})),this.setState({files:t})})),this.dropzone.on("uploadprogress",((e,t,o)=>{if(t=o/e.size*100,e.previewElement){let o=e.previewElement.querySelectorAll("[data-dz-uploadprogress]");o.length>0&&(o=o[0]),o&&(o.style.width=t+"%")}})),this.dropzone.on("sending",((e,t,o)=>{this.props.hasOwnProperty("access_token")&&o.append("access_token",this.props.access_token);let r=this,n=t.onload;t.onload=function(e){n(e);let o=JSON.parse(t.responseText);"string"==typeof o.name&&r.onUploadComplete(o)}}))}}destroy(e){return e.off(),e.destroy()}}h.defaultProps={djsConfig:{},config:{},eventHandlers:{},data:{}},h.propTypes={id:d().string.isRequired};const f=h;function u(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function m(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}class y extends t().Component{constructor(e){super(e)}render(){let{value:e,onRemove:o,error:r,mediaType:n,postUrl:s,maxFiles:i=1,timeOut:p,onUploadComplete:l,djsConfig:a,id:d}=this.props,c=this.props.hasOwnProperty("error")&&""!==r;const h=n&&n.type?n.type.allowed_extensions.map((e=>`.${e.toLowerCase()}`)).join(","):"",y=n?n.max_size/1024:100,g=!i||e.length<i,v=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?u(Object(o),!0).forEach((function(t){m(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({paramName:"file",maxFilesize:y,timeout:p||6e5,chunking:!0,retryChunks:!0,parallelChunkUploads:!1,addRemoveLinks:!0,maxFiles:i,acceptedFiles:h,dropzoneSelector:`media_upload_${n.id}`},a),b={showFiletypeIcon:!1,postUrl:s},z={media_type:n,media_upload:e};let j={};return o&&(j={removedfile:o}),t().createElement("div",{className:"row"},t().createElement("div",{className:"col-md-6",style:{height:180}},g?t().createElement(f,{id:d,djsConfig:v,config:b,eventHandlers:j,data:z,uploadCount:e.length,onUploadComplete:l}):t().createElement("div",{className:"filepicker disabled"},"Max number of files uploaded for this type - Remove uploaded file to add new file.")),t().createElement("div",{className:"col-md-6"},c&&t().createElement("p",{className:"error-label"},r),e.length>0&&t().createElement("div",null,t().createElement("label",null,"Uploaded"),e.map(((e,r)=>t().createElement("div",{key:`uploaded-${r}`},t().createElement("a",{href:e.private_url||e.public_url,target:"_blank"},e.filename),o&&t().createElement("span",null," - ",t().createElement("a",{onClick:t=>o(e)},"Remove"))))))))}}})(),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={8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6961:e=>{e.exports=require("dropzone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")}},t={};function o(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{o.r(r),o.d(r,{default:()=>g});var e=o(8779),t=o.n(e),s=o(6689),n=o.n(s);const i=require("react-dom");var p=o.n(i);const l=require("extend");var a=o.n(l);require("dropzone/dist/dropzone.css");const d=e=>n().createElement("div",{"data-filetype":e.filetype,className:"filepicker-file-icon"});var c=o(580),h=o.n(c);let f=null;class u extends n().Component{constructor(e){super(e),this.state={files:[]},this.onUploadComplete=this.onUploadComplete.bind(this)}onUploadComplete(e){this.props.onUploadComplete&&this.props.onUploadComplete(e,this.props.id,this.props.data)}getDjsConfig(){let e=null;const t={url:this.props.config.postUrl?this.props.config.postUrl:null};return e=this.props.djsConfig?a()(!0,{},t,this.props.djsConfig):t,e.accept=(t,o)=>{e.maxFiles&&e.maxFiles<this.state.files.length+this.props.uploadCount&&o("Max files reached"),o()},e}componentDidMount(){const e=this.getDjsConfig();f=f||o(6961),f.autoDiscover=!1,this.props.config.postUrl||this.props.eventHandlers.drop||console.info('Neither postUrl nor a "drop" eventHandler specified, the React-Dropzone component might misbehave.');var t=this.props.config.dropzoneSelector||p().findDOMNode(this);this.dropzone=new f(t,e),this.setupEvents()}componentWillUnmount(){if(this.dropzone){if(this.dropzone.getActiveFiles().length>0){this.queueDestroy=!0;const e=window.setInterval((()=>!1===this.queueDestroy?window.clearInterval(e):0===this.dropzone.getActiveFiles().length?(this.dropzone=this.destroy(this.dropzone),window.clearInterval(e)):void 0),500)}else this.dropzone=this.destroy(this.dropzone)}}componentDidUpdate(){const{config:e,djsConfig:t}=this.props,o=t||{},r=e&&e.postUrl?{url:e.postUrl}:{};if(this.queueDestroy=!1,!this.dropzone){const e=this.props.config.dropzoneSelector||p().findDOMNode(this);this.dropzone=new f(e,this.getDjsConfig())}this.dropzone.options=a()(!0,{},this.dropzone.options,o,r)}render(){const e=[],{files:t}=this.state,{config:o}=this.props,r=this.props.className?"filepicker dropzone "+this.props.className:"filepicker dropzone";if(o.showFiletypeIcon&&o.iconFiletypes&&(!t||t.length<1))for(var s=0;s<this.props.config.iconFiletypes.length;s+=1)e.push(n().createElement(d,{filetype:o.iconFiletypes[s],key:"icon-component"+s}));return!this.props.config.postUrl&&this.props.action?n().createElement("form",{action:this.props.action,className:r},e,this.props.children):n().createElement("div",{id:this.props.id,className:r}," ",e," ",this.props.children," ")}setupEvents(){const e=this.props.eventHandlers;if(this.dropzone&&e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])if("[object Array]"===Object.prototype.toString.call(e[t]))for(var o=0;o<e[t].length;o+=1)"init"===t?e[t][o](this.dropzone):this.dropzone.on(t,e[t][o]);else"init"===t?e[t](this.dropzone):this.dropzone.on(t,e[t]);this.dropzone.on("addedfile",(e=>{if(!e)return;const t=this.state.files||[];t.push(e),this.setState({files:t})})),this.dropzone.on("removedfile",(e=>{if(!e)return;const t=this.state.files||[];t.forEach(((o,r)=>{o.name===e.name&&o.size===e.size&&t.splice(r,1)})),this.setState({files:t})})),this.dropzone.on("uploadprogress",((e,t,o)=>{if(t=o/e.size*100,e.previewElement){let o=e.previewElement.querySelectorAll("[data-dz-uploadprogress]");o.length>0&&(o=o[0]),o&&(o.style.width=t+"%")}})),this.dropzone.on("sending",((e,t,o)=>{this.props.hasOwnProperty("access_token")&&o.append("access_token",this.props.access_token);let r=this,s=t.onload;t.onload=function(e){s(e);let o=JSON.parse(t.responseText);"string"==typeof o.name&&r.onUploadComplete(o)}}))}}destroy(e){return e.off(),e.destroy()}}u.defaultProps={djsConfig:{},config:{},eventHandlers:{},data:{}},u.propTypes={id:h().string.isRequired};const m=u;function y(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}class g extends n().Component{constructor(e){super(e)}render(){let{value:e,onRemove:o,error:r,mediaType:s,postUrl:i,maxFiles:p=1,timeOut:l,onUploadComplete:a,djsConfig:d,id:c}=this.props,h=this.props.hasOwnProperty("error")&&""!==r;const f=s&&s.type?s.type.allowed_extensions.map((e=>`.${e.toLowerCase()}`)).join(","):"",u=s?s.max_size/1024:100,g=!p||e.length<p,v=function(e){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?y(Object(r),!0).forEach((function(o){t()(e,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({paramName:"file",maxFilesize:u,timeout:l||6e5,chunking:!0,retryChunks:!0,parallelChunkUploads:!1,addRemoveLinks:!0,maxFiles:p,acceptedFiles:f,dropzoneSelector:`media_upload_${s.id}`},d),b={showFiletypeIcon:!1,postUrl:i},z={media_type:s,media_upload:e};let j={};return o&&(j={removedfile:o}),n().createElement("div",{className:"row"},n().createElement("div",{className:"col-md-6",style:{height:180}},g?n().createElement(m,{id:c,djsConfig:v,config:b,eventHandlers:j,data:z,uploadCount:e.length,onUploadComplete:a}):n().createElement("div",{className:"filepicker disabled"},"Max number of files uploaded for this type - Remove uploaded file to add new file.")),n().createElement("div",{className:"col-md-6"},h&&n().createElement("p",{className:"error-label"},r),e.length>0&&n().createElement("div",null,n().createElement("label",null,"Uploaded"),e.map(((e,t)=>n().createElement("div",{key:`uploaded-${t}`},n().createElement("a",{href:e.private_url||e.public_url,target:"_blank"},e.filename),o&&n().createElement("span",null," - ",n().createElement("a",{onClick:t=>o(e)},"Remove"))))))))}}})(),r})()));