openstack-uicore-foundation 4.0.38 → 4.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/index.js +1 -1
- package/lib/components/inputs/access-levels-input.js +1 -1
- package/lib/components/inputs/company-input.js +1 -1
- package/lib/components/inputs/country-dropdown.js +1 -1
- package/lib/components/inputs/country-input.js +1 -1
- package/lib/components/inputs/event-input.js +1 -1
- package/lib/components/inputs/group-input.js +1 -1
- package/lib/components/inputs/language-input.js +1 -1
- package/lib/components/inputs/member-input.js +1 -1
- package/lib/components/inputs/organization-input.js +1 -1
- package/lib/components/inputs/registration-company-input.js +1 -1
- package/lib/components/inputs/speaker-input.js +1 -1
- package/lib/components/inputs/sponsor-input.js +1 -1
- package/lib/components/inputs/summit-input.js +1 -1
- package/lib/components/inputs/tag-input.js +1 -1
- package/lib/components/inputs/ticket-types-input.js +1 -1
- package/lib/utils/query-actions.js +1 -1
- package/package.json +1 -1
|
@@ -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)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>u});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",p="pkce",u=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),a===i&&k()){if(!o)throw g(),Error("missing Refresh Token");let e=await h(o),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=b(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(e,t,n=null,o=null)=>{let a=m(),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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(p)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),b=()=>"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),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}),i=(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")}}),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:()=>o,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>a,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});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)},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,{queryAccessLevels:()=>p});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,p=(l().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),l().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),l().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),l().debounce((async(e,t,n)=>{const s=await(0,o.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,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),l().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),l().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),l().debounce((async(e,t,n=!1,s)=>{const c=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,a.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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));l().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);l().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}/ticket-types?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=["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,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.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getAccessLevels=this.getAccessLevels.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:"accesslevelinput"}};this.props.onChange(t)}getAccessLevels(e,t){let{summitId:n}=this.props;if(!e)return Promise.resolve({options:[]});(0,s.queryAccessLevels)(n,e,t)}render(){let e=this.props,{value:n,error:r,onChange:o,id:s,multi:d}=e,p=l(e,c),u=this.props.hasOwnProperty("multi"),h=this.props.hasOwnProperty("error")&&""!=r;return t().createElement("div",null,t().createElement(a(),i({value:n,onChange:this.handleChange,loadOptions:this.getAccessLevels,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:u},p)),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(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>u});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);const s=new(o()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",p="pkce",u=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),o===i&&k()){if(!a)throw g(),Error("missing Refresh Token");let e=await h(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=b(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:s,expires_in:c}=n;return{access_token:o,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(p)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),b=()=>"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,{queryAccessLevels:()=>p});var r=n(4054),a=n(8576),o=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,p=(l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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));l().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);l().debounce((async(e,t={},n,s="v1",i=null)=>{let l;try{l=await(0,a.getAccessToken)()}catch(e){return void(i&&i(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).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.getAccessLevels=this.getAccessLevels.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:"accesslevelinput"}};this.props.onChange(t)}getAccessLevels(e,t){let{summitId:n}=this.props;if(!e)return Promise.resolve({options:[]});(0,s.queryAccessLevels)(n,e,t)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:d}=e,p=l(e,c),u=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.getAccessLevels,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:u},p)),h&&t().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,n)=>{n(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>u});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);const s=new(o()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",p="pkce",u=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),o===i&&k()){if(!a)throw w(),Error("missing Refresh Token");let e=await h(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw w(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=b(),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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:s,expires_in:c}=n;return{access_token:o,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},w=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(p)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),b=()=>"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,{queryCompanies:()=>p});var r=n(4054),a=n(8576),o=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,p=(l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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));l().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().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}/ticket-types?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")},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 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(6689),t=n.n(e),a=n(9953),o=n.n(a),s=n(7525),c=n(9503),i=n.n(c);const l=["error","value","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.handleChange=this.handleChange.bind(this),this.handleNew=this.handleNew.bind(this),this.getCompanies=this.getCompanies.bind(this)}handleChange(e){const t=this.props.hasOwnProperty("multi")||this.props.hasOwnProperty("isMulti")?e.map((e=>({id:e.value,name:e.label}))):{id:e.value,name:e.label};let n={target:{id:this.props.id,value:t,type:"companyinput"}};this.props.onChange(n)}handleNew(e){this.props.onCreate(e,(e=>{this.handleChange({value:e.id,label:e.name})}))}getCompanies(e,t){if(!e)return Promise.resolve({options:[]});(0,s.queryCompanies)(e,(e=>{let n=e.map((e=>({value:e.id.toString(),label:e.name})));t(n)}))}render(){let e=this.props,{error:n,value:r,onChange:a,id:s,multi:c}=e,u=p(e,l),h=this.props.hasOwnProperty("error")&&""!=n,f=this.props.hasOwnProperty("multi")||this.props.hasOwnProperty("isMulti"),m=this.props.hasOwnProperty("allowCreate"),w=null;f&&r.length>0?w=r.map((e=>({value:e.id.toString(),label:e.name}))):!f&&r&&(w={value:r.id.toString(),label:r.name});const g=m?i():o();return t().createElement("div",null,t().createElement(g,d({value:w,onChange:this.handleChange,loadOptions:this.getCompanies,onCreateOption:this.handleNew,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(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>u});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);const s=new(o()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",p="pkce",u=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),o===i&&k()){if(!a)throw w(),Error("missing Refresh Token");let e=await h(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw w(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=b(),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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:s,expires_in:c}=n;return{access_token:o,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},w=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(p)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),b=()=>"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,{queryCompanies:()=>p});var r=n(4054),a=n(8576),o=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,p=(l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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));l().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().debounce((async(e,t={},n,s="v1",i=null)=>{let l;try{l=await(0,a.getAccessToken)()}catch(e){return void(i&&i(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).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")},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 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(6689),t=n.n(e),a=n(9953),o=n.n(a),s=n(7525),c=n(9503),i=n.n(c);const l=["error","value","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.handleChange=this.handleChange.bind(this),this.handleNew=this.handleNew.bind(this),this.getCompanies=this.getCompanies.bind(this)}handleChange(e){const t=this.props.hasOwnProperty("multi")||this.props.hasOwnProperty("isMulti")?e.map((e=>({id:e.value,name:e.label}))):{id:e.value,name:e.label};let n={target:{id:this.props.id,value:t,type:"companyinput"}};this.props.onChange(n)}handleNew(e){this.props.onCreate(e,(e=>{this.handleChange({value:e.id,label:e.name})}))}getCompanies(e,t){if(!e)return Promise.resolve({options:[]});(0,s.queryCompanies)(e,(e=>{let n=e.map((e=>({value:e.id.toString(),label:e.name})));t(n)}))}render(){let e=this.props,{error:n,value:r,onChange:a,id:s,multi:c}=e,u=p(e,l),h=this.props.hasOwnProperty("error")&&""!=n,f=this.props.hasOwnProperty("multi")||this.props.hasOwnProperty("isMulti"),m=this.props.hasOwnProperty("allowCreate"),w=null;f&&r.length>0?w=r.map((e=>({value:e.id.toString(),label:e.name}))):!f&&r&&(w={value:r.id.toString(),label:r.name});const g=m?i():o();return t().createElement("div",null,t().createElement(g,d({value:w,onChange:this.handleChange,loadOptions:this.getCompanies,onCreateOption:this.handleNew,isMulti:f},u)),h&&t().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={401:(e,t,n)=>{n.d(t,{default:()=>h});var r=n(6689),o=n.n(r),a=n(1929),s=n.n(a);const c=["onChange","value","className","error","clearable","disabled","overrideCSS"];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){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(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 h extends o().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){let t=null;t=this.props.isMulti?e?e.map((e=>e.value)):null:e?e.value:null;let n={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(n)}render(){let e=this.props,{onChange:t,value:n,className:r,error:a,clearable:i,disabled:p,overrideCSS:h}=e,f=u(e,c),m=this.props.hasOwnProperty("error")&&""!=a,g=this.props.hasOwnProperty("clearable"),w=this.props.hasOwnProperty("disabled")&&1==p,y=null,b=r;this.props.hasOwnProperty("overrideCSS")&&0!=h||(b="dropdown "+r+" "+(m?"error":"")),y=this.props.isMulti?this.props.options.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:this.props.options.find((e=>e.value==n));const k={menu:e=>d(d({},e),{},{zIndex:999})};return o().createElement("div",null,o().createElement(s(),l({className:b,value:y,onChange:this.handleChange,isClearable:g,isDisabled:w,styles:k},f)),m&&o().createElement("p",{className:"error-label"},a))}}},4341:(e,t,n)=>{n(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>u});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",l="code",i="authInfo",d="nonce",p="pkce",u=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),i=Math.floor(Date.now()/1e3);if(n-=20,i-r>n||null==t){if(console.log("getAccessToken access token expired"),a===l&&b()){if(!o)throw g(),Error("missing Refresh Token");let e=await h(o),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=k(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(e,t,n=null,o=null)=>{let a=m(),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)(i,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(i,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(i),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(p)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",b=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),k=()=>"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,{getCountryList:()=>p});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const l=require("lodash");var i=n.n(l);const d=500,p=(i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let l=c()(`/api/v1/summits/${e}/registration-companies`);l.addQuery("access_token",s),l.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),l.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(l.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),i().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),i().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),i().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),(e,t)=>fetch((0,a.buildAPIBaseUrl)("/api/public/v1/countries"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));i().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}/ticket-types?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")},1929:e=>{e.exports=require("react-select")},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:()=>c});var e=n(6689),t=n.n(e),o=n(401),a=n(7525);function s(){return s=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},s.apply(this,arguments)}class c extends t().Component{constructor(e){super(e),this.state={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),this.abortController=new AbortController}componentDidMount(){let{options:e}=this.state;0==e.length&&(0,a.getCountryList)(this.setOptions,this.abortController.signal)}componentWillUnmount(){this.abortController.abort()}handleChange(e){let t={target:{id:this.props.id,value:e,type:"countryddl"}};this.props.onChange(t)}setOptions(e){let t=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}render(){let{options:e}=this.state;return t().createElement(o.default,s({options:e},this.props))}}})(),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={401:(e,t,n)=>{n.d(t,{default:()=>h});var r=n(6689),o=n.n(r),a=n(1929),s=n.n(a);const c=["onChange","value","className","error","clearable","disabled","overrideCSS"];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){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(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 h extends o().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){let t=null;t=this.props.isMulti?e?e.map((e=>e.value)):null:e?e.value:null;let n={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(n)}render(){let e=this.props,{onChange:t,value:n,className:r,error:a,clearable:i,disabled:p,overrideCSS:h}=e,f=u(e,c),m=this.props.hasOwnProperty("error")&&""!=a,g=this.props.hasOwnProperty("clearable"),y=this.props.hasOwnProperty("disabled")&&1==p,w=null,b=r;this.props.hasOwnProperty("overrideCSS")&&0!=h||(b="dropdown "+r+" "+(m?"error":"")),w=this.props.isMulti?this.props.options.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:this.props.options.find((e=>e.value==n));const k={menu:e=>d(d({},e),{},{zIndex:999})};return o().createElement("div",null,o().createElement(s(),l({className:b,value:w,onChange:this.handleChange,isClearable:g,isDisabled:y,styles:k},f)),m&&o().createElement("p",{className:"error-label"},a))}}},4341:(e,t,n)=>{n(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>u});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",l="code",i="authInfo",d="nonce",p="pkce",u=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=w(),i=Math.floor(Date.now()/1e3);if(n-=20,i-r>n||null==t){if(console.log("getAccessToken access token expired"),a===l&&b()){if(!o)throw g(),Error("missing Refresh Token");let e=await h(o),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=k(),n=y();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(e,t,n=null,o=null)=>{let a=m(),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)(i,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(i,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(i),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(p)},y=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,w=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",b=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),k=()=>"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,{getCountryList:()=>p});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const l=require("lodash");var i=n.n(l);const d=500,p=(i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let l=c()(`/api/v1/summits/${e}/registration-companies`);l.addQuery("access_token",s),l.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),l.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(l.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),i().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),i().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),i().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),(e,t)=>fetch((0,a.buildAPIBaseUrl)("/api/public/v1/countries"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));i().debounce((async(e,t={},n,s="v1",l=null)=>{let i;try{i=await(0,o.getAccessToken)()}catch(e){return void(l&&l(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",i),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,a.buildAPIBaseUrl)(d.toString())).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")},1929:e=>{e.exports=require("react-select")},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:()=>c});var e=n(6689),t=n.n(e),o=n(401),a=n(7525);function s(){return s=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},s.apply(this,arguments)}class c extends t().Component{constructor(e){super(e),this.state={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),this.abortController=new AbortController}componentDidMount(){let{options:e}=this.state;0==e.length&&(0,a.getCountryList)(this.setOptions,this.abortController.signal)}componentWillUnmount(){this.abortController.abort()}handleChange(e){let t={target:{id:this.props.id,value:e,type:"countryddl"}};this.props.onChange(t)}setOptions(e){let t=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}render(){let{options:e}=this.state;return t().createElement(o.default,s({options:e},this.props))}}})(),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)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",l="code",i="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),i=Math.floor(Date.now()/1e3);if(n-=20,i-r>n||null==t){if(console.log("getAccessToken access token expired"),a===l&&k()){if(!o)throw g(),Error("missing Refresh Token");let e=await h(o),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=$(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(e,t,n=null,o=null)=>{let a=m(),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)(i,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(i,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(i),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),$=()=>"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,{getCountryList:()=>u});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const l=require("lodash");var i=n.n(l);const d=500,u=(i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let l=c()(`/api/v1/summits/${e}/registration-companies`);l.addQuery("access_token",s),l.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),l.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(l.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),i().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),i().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),i().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),(e,t)=>fetch((0,a.buildAPIBaseUrl)("/api/public/v1/countries"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));i().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}/ticket-types?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")},1929:e=>{e.exports=require("react-select")},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(1929),a=n.n(o),s=n(7525);const c=["value","onChange","id","multi","error"];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.state={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),(0,s.getCountryList)(this.setOptions)}setOptions(e){let t=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}handleChange(e){let t=null;t=this.props.hasOwnProperty("multi")?e.map((e=>e.value)):e.value;let n={target:{id:this.props.id,value:t,type:"countryinput"}};this.props.onChange(n)}render(){let e=this.props,{value:n,onChange:r,id:o,multi:s,error:d}=e,u=i(e,c),{options:p}=this.state,h=this.props.hasOwnProperty("multi"),f=null,m=this.props.hasOwnProperty("error")&&""!=d;return f=h?p.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:p.find((e=>e.value==n)),t().createElement("div",null,t().createElement(a(),l({className:"dropdown"+(m?" error":""),onChange:this.handleChange,options:p,value:f,isMulti:h},u)),m&&t().createElement("p",{className:"error-label"},d))}}})(),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(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(o()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),o===i&&k()){if(!a)throw w(),Error("missing Refresh Token");let e=await h(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw w(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=$(),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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:s,expires_in:c}=n;return{access_token:o,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},w=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),$=()=>"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,{getCountryList:()=>u});var r=n(4054),a=n(8576),o=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,u=(l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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),(e,t)=>fetch((0,o.buildAPIBaseUrl)("/api/public/v1/countries"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));l().debounce((async(e,t={},n,s="v1",i=null)=>{let l;try{l=await(0,a.getAccessToken)()}catch(e){return void(i&&i(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).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")},1929:e=>{e.exports=require("react-select")},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(1929),o=n.n(a),s=n(7525);const c=["value","onChange","id","multi","error"];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={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),(0,s.getCountryList)(this.setOptions)}setOptions(e){let t=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}handleChange(e){let t=null;t=this.props.hasOwnProperty("multi")?e.map((e=>e.value)):e.value;let n={target:{id:this.props.id,value:t,type:"countryinput"}};this.props.onChange(n)}render(){let e=this.props,{value:n,onChange:r,id:a,multi:s,error:d}=e,u=l(e,c),{options:p}=this.state,h=this.props.hasOwnProperty("multi"),f=null,m=this.props.hasOwnProperty("error")&&""!=d;return f=h?p.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:p.find((e=>e.value==n)),t().createElement("div",null,t().createElement(o(),i({className:"dropdown"+(m?" error":""),onChange:this.handleChange,options:p,value:f,isMulti:h},u)),m&&t().createElement("p",{className:"error-label"},d))}}})(),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)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),a===i&&k()){if(!o)throw g(),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),h(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},f=async e=>{let t=$(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},h=(e,t,n=null,o=null)=>{let a=m(),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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),$=()=>"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),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}),i=(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")}}),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:()=>o,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>a,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});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)},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,{queryEvents:()=>u});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,u=(l().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),l().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),l().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),l().debounce((async(e,t,n)=>{const s=await(0,o.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,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),l().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),l().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),l().debounce((async(e,t,n=!1,s)=>{const c=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,a.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d));l().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),l().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),l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().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}/ticket-types?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=["value","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,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.getEvents=this.getEvents.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"eventinput"}};this.props.onChange(t)}getEvents(e,t){let{summit:n,onlyPublished:r}=this.props;if(!e)return Promise.resolve({options:[]});(0,s.queryEvents)(n.id,e,r,t)}render(){let e=this.props,{value:n,onChange:r,id:o,multi:s}=e,d=l(e,c),u=this.props.hasOwnProperty("multi");return t().createElement(a(),i({value:n,onChange:this.handleChange,loadOptions:this.getEvents,getOptionValue:e=>e.id,getOptionLabel:e=>e.title,isMulti:u},d))}}})(),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(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(o()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),o===i&&k()){if(!a)throw g(),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),h(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},f=async e=>{let t=$(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:s,expires_in:c}=n;return{access_token:o,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},h=(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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),$=()=>"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,{queryEvents:()=>u});var r=n(4054),a=n(8576),o=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,u=(l().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),l().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),l().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),l().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),l().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),l().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),l().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));l().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),l().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),l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().debounce((async(e,t={},n,s="v1",i=null)=>{let l;try{l=await(0,a.getAccessToken)()}catch(e){return void(i&&i(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).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","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.handleChange=this.handleChange.bind(this),this.getEvents=this.getEvents.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"eventinput"}};this.props.onChange(t)}getEvents(e,t){let{summit:n,onlyPublished:r}=this.props;if(!e)return Promise.resolve({options:[]});(0,s.queryEvents)(n.id,e,r,t)}render(){let e=this.props,{value:n,onChange:r,id:a,multi:s}=e,d=l(e,c),u=this.props.hasOwnProperty("multi");return t().createElement(o(),i({value:n,onChange:this.handleChange,loadOptions:this.getEvents,getOptionValue:e=>e.id,getOptionLabel:e=>e.title,isMulti:u},d))}}})(),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)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),a===i&&k()){if(!o)throw g(),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),h(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},f=async e=>{let t=$(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},h=(e,t,n=null,o=null)=>{let a=m(),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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),$=()=>"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),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}),i=(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")}}),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:()=>o,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>a,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});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)},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,{queryGroups:()=>u});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,u=(l().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),l().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),l().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),l().debounce((async(e,t,n)=>{const s=await(0,o.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,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),l().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),l().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),l().debounce((async(e,t,n=!1,s)=>{const c=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,a.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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));l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().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}/ticket-types?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=["value","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,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.getGroups=this.getGroups.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"groupinput"}};this.props.onChange(t)}getGroups(e,t){if(!e)return Promise.resolve({options:[]});(0,s.queryGroups)(e,t)}render(){let e=this.props,{value:n,onChange:r,id:o,multi:s}=e,d=l(e,c),u=this.props.hasOwnProperty("multi");return t().createElement(a(),i({value:n,onChange:this.handleChange,loadOptions:this.getGroups,getOptionValue:e=>e.id,getOptionLabel:e=>e.title,isMulti:u},d))}}})(),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(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),a===i&&k()){if(!o)throw g(),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),h(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},f=async e=>{let t=$(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},h=(e,t,n=null,o=null)=>{let a=m(),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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),$=()=>"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),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}),i=(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")}}),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:()=>o,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>a,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});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)},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,{queryGroups:()=>u});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,u=(l().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),l().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),l().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),l().debounce((async(e,t,n)=>{const s=await(0,o.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,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),l().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),l().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),l().debounce((async(e,t,n=!1,s)=>{const c=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,a.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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));l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().debounce((async(e,t={},n,s="v1",i=null)=>{let l;try{l=await(0,o.getAccessToken)()}catch(e){return void(i&&i(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,a.buildAPIBaseUrl)(d.toString())).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=["value","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,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.getGroups=this.getGroups.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"groupinput"}};this.props.onChange(t)}getGroups(e,t){if(!e)return Promise.resolve({options:[]});(0,s.queryGroups)(e,t)}render(){let e=this.props,{value:n,onChange:r,id:o,multi:s}=e,d=l(e,c),u=this.props.hasOwnProperty("multi");return t().createElement(a(),i({value:n,onChange:this.handleChange,loadOptions:this.getGroups,getOptionValue:e=>e.id,getOptionLabel:e=>e.title,isMulti:u},d))}}})(),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)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",l="code",i="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),i=Math.floor(Date.now()/1e3);if(n-=20,i-r>n||null==t){if(console.log("getAccessToken access token expired"),a===l&&k()){if(!o)throw g(),Error("missing Refresh Token");let e=await h(o),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=b(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(e,t,n=null,o=null)=>{let a=m(),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)(i,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(i,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(i),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),b=()=>"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,{getLanguageList:()=>u});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const l=require("lodash");var i=n.n(l);const d=500,u=(i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().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),i().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let l=c()(`/api/v1/summits/${e}/registration-companies`);l.addQuery("access_token",s),l.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),l.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(l.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),i().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),i().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),i().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),(e,t)=>fetch((0,a.buildAPIBaseUrl)("/api/public/v1/languages"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));i().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}/ticket-types?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")},1929:e=>{e.exports=require("react-select")},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(1929),a=n.n(o),s=n(7525);const c=["value","onChange","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 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.state={options:[],shouldUseId:!!e.hasOwnProperty("shouldUseId")&&e.shouldUseId},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),this.abortController=new AbortController,(0,s.getLanguageList)(this.setOptions,this.abortController.signal)}componentWillUnmount(){this.abortController.abort()}setOptions(e){let t=this.state.shouldUseId?e.map((e=>({label:e.name,value:e.id}))):e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}handleChange(e){let t=null;t=this.props.hasOwnProperty("multi")?e.map((e=>e.value)):e.value;let n={target:{id:this.props.id,value:t,type:"laguageinput"}};this.props.onChange(n)}render(){let e=this.props,{value:n,onChange:r,id:o,multi:s}=e,d=i(e,c),{options:u}=this.state,p=this.props.hasOwnProperty("multi"),h=null;return h=p?u.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:u.find((e=>e.value==n)),t().createElement(a(),l({className:"dropdown",onChange:this.handleChange,options:u,value:h,isMulti:p},d))}}})(),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(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(o()),c="openstackuicore.lock.getTokenSilently",l="code",i="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),i=Math.floor(Date.now()/1e3);if(n-=20,i-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&k()){if(!a)throw g(),Error("missing Refresh Token");let e=await h(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=b(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:s,expires_in:c}=n;return{access_token:o,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(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)(i,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(i,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(i),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",k=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),b=()=>"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),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}),l=(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")}}),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:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>i,setSessionClearingState:()=>l});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)},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,{getLanguageList:()=>u});var r=n(4054),a=n(8576),o=n(6793),s=n(6530),c=n.n(s);const l=require("lodash");var i=n.n(l);const d=500,u=(i().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),i().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),i().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),i().debounce((async(e,t,n)=>{const s=await(0,a.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,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),i().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),i().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),i().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(n?"/published":""),i=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),i().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),i().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),i().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),i().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let l=c()(`/api/v1/summits/${e}/registration-companies`);l.addQuery("access_token",s),l.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),l.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(l.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),i().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),i().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),i().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),(e,t)=>fetch((0,o.buildAPIBaseUrl)("/api/public/v1/languages"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));i().debounce((async(e,t={},n,s="v1",l=null)=>{let i;try{i=await(0,a.getAccessToken)()}catch(e){return void(l&&l(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",i),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).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")},1929:e=>{e.exports=require("react-select")},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(1929),o=n.n(a),s=n(7525);const c=["value","onChange","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 i(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={options:[],shouldUseId:!!e.hasOwnProperty("shouldUseId")&&e.shouldUseId},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),this.abortController=new AbortController,(0,s.getLanguageList)(this.setOptions,this.abortController.signal)}componentWillUnmount(){this.abortController.abort()}setOptions(e){let t=this.state.shouldUseId?e.map((e=>({label:e.name,value:e.id}))):e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}handleChange(e){let t=null;t=this.props.hasOwnProperty("multi")?e.map((e=>e.value)):e.value;let n={target:{id:this.props.id,value:t,type:"laguageinput"}};this.props.onChange(n)}render(){let e=this.props,{value:n,onChange:r,id:a,multi:s}=e,d=i(e,c),{options:u}=this.state,p=this.props.hasOwnProperty("multi"),h=null;return h=p?u.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:u.find((e=>e.value==n)),t().createElement(o(),l({className:"dropdown",onChange:this.handleChange,options:u,value:h,isMulti:p},d))}}})(),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)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>u});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);const s=new(a()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",p="pkce",u=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:o}=e,a=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),a===i&&b()){if(!o)throw g(),Error("missing Refresh Token");let e=await h(o),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=k(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:a,refresh_token:s,expires_in:c}=n;return{access_token:a,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(e,t,n=null,o=null)=>{let a=m(),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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(p)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",b=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),k=()=>"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),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}),i=(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")}}),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:()=>o,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>a,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});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)},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,{queryMembers:()=>p});var r=n(4054),o=n(8576),a=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,p=l().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);l().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),l().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),l().debounce((async(e,t,n)=>{const s=await(0,o.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,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),l().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),l().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),l().debounce((async(e,t,n=!1,s)=>{const c=await(0,o.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,a.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,o.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,a.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().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}/ticket-types?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=["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,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.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getMembers=this.getMembers.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.first_name} ${e.last_name} (${e.id})`}handleChange(e){let t={target:{id:this.props.id,value:e,type:"memberinput"}};this.props.onChange(t)}getMembers(e,t){if(!e)return Promise.resolve({options:[]});(0,s.queryMembers)(e,t)}render(){let e=this.props,{value:n,error:r,onChange:o,id:s,multi:d}=e,p=l(e,c),u=this.props.hasOwnProperty("multi"),h=this.props.hasOwnProperty("error")&&""!=r;return t().createElement("div",null,t().createElement(a(),i({value:n,onChange:this.handleChange,loadOptions:this.getMembers,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:u},p)),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(4656),n(4054),n(6793),n(8576)},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>p});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);const s=new(o()),c="openstackuicore.lock.getTokenSilently",i="code",l="authInfo",d="nonce",u="pkce",p=async()=>{if(await(0,r.retryPromise)((()=>s.acquireLock(c,5e3)),10))try{let e=m();if(!e)throw Error("Missing Auth info.");let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=y(),l=Math.floor(Date.now()/1e3);if(n-=20,l-r>n||null==t){if(console.log("getAccessToken access token expired"),o===i&&b()){if(!a)throw g(),Error("missing Refresh Token");let e=await h(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),f(t,n,r),t}throw g(),Error("Access Token Expired.")}return t}finally{await s.releaseLock(c)}throw Error("Lock acquire error.")},h=async e=>{let t=k(),n=w();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(`${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`Request failed: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:s,expires_in:c}=n;return{access_token:o,refresh_token:s,expires_in:c}}catch(e){throw console.log(e),e}},f=(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)(l,JSON.stringify(s))},m=()=>{let e=(0,r.getFromLocalStorage)(l,!1);return null===e?null:JSON.parse(e)},g=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(l),(0,r.removeFromLocalStorage)(d),void(0,r.removeFromLocalStorage)(u)},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",b=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),k=()=>"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,{queryMembers:()=>u});var r=n(4054),a=n(8576),o=n(6793),s=n(6530),c=n.n(s);const i=require("lodash");var l=n.n(i);const d=500,u=l().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);l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().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),l().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let i=c()(`/api/v1/summits/${e}/registration-companies`);i.addQuery("access_token",s),i.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),i.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),l().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),l().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),l().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);l().debounce((async(e,t={},n,s="v1",i=null)=>{let l;try{l=await(0,a.getAccessToken)()}catch(e){return void(i&&i(e))}let d=c()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).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.getMembers=this.getMembers.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.first_name} ${e.last_name} (${e.id})`}handleChange(e){let t={target:{id:this.props.id,value:e,type:"memberinput"}};this.props.onChange(t)}getMembers(e,t){if(!e)return Promise.resolve({options:[]});(0,s.queryMembers)(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.getMembers,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:p},u)),h&&t().createElement("p",{className:"error-label"},r))}}})(),r})()));
|