mgwdev-m365-components 0.0.13-experimental → 0.0.15
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/dist/components/datagrid/DataverseTableDataGrid.d.ts +7 -0
- package/dist/components/datagrid/GenericDataGrid.d.ts +4 -1
- package/dist/components/datagrid/SPListDataGrid.d.ts +1 -0
- package/dist/components/datagrid/columnRenderers/DataverseChoiceRenderer.d.ts +7 -0
- package/dist/components/datagrid/columnRenderers/IColumnRenderer.d.ts +0 -1
- package/dist/mgwdev-m365-components.es.js +5563 -32762
- package/dist/mgwdev-m365-components.umd.js +50 -0
- package/dist/services/datagrid/DataGridService.d.ts +1 -0
- package/dist/services/datagrid/DataverseTableDataGridService.d.ts +6 -2
- package/dist/services/datagrid/GraphEntityDataGridService.d.ts +1 -0
- package/dist/services/datagrid/SPListDataGridService.d.ts +3 -1
- package/package.json +4 -3
- package/dist/ProtocolUtils-f8qLE_2m.mjs +0 -476
- package/dist/index.html +0 -14
- package/dist/mgwdev-m365-components.es2.js +0 -182
- package/dist/redirect.html +0 -14
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
(function(P,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("react"),require("@fluentui/react-components")):typeof define=="function"&&define.amd?define(["exports","react","@fluentui/react-components"],U):(P=typeof globalThis<"u"?globalThis:P||self,U(P["mgwdev-m365-components"]={},P.React,P.FluentUIReactComponents))})(this,function(P,U,m){"use strict";function ur(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>s[e]})}}return r.default=s,Object.freeze(r)}const b=ur(U);var Qe={exports:{}},pe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Dt;function lr(){return Dt||(Dt=1,process.env.NODE_ENV!=="production"&&function(){var s=U,r=Symbol.for("react.element"),e=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),n=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),v=Symbol.iterator,x="@@iterator";function S(f){if(f===null||typeof f!="object")return null;var p=v&&f[v]||f[x];return typeof p=="function"?p:null}var C=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(f){{for(var p=arguments.length,w=new Array(p>1?p-1:0),R=1;R<p;R++)w[R-1]=arguments[R];D("error",f,w)}}function D(f,p,w){{var R=C.ReactDebugCurrentFrame,I=R.getStackAddendum();I!==""&&(p+="%s",w=w.concat([I]));var j=w.map(function(T){return String(T)});j.unshift("Warning: "+p),Function.prototype.apply.call(console[f],console,j)}}var F=!1,A=!1,G=!1,Z=!1,H=!1,k;k=Symbol.for("react.module.reference");function O(f){return!!(typeof f=="string"||typeof f=="function"||f===a||f===t||H||f===i||f===n||f===c||Z||f===y||F||A||G||typeof f=="object"&&f!==null&&(f.$$typeof===g||f.$$typeof===d||f.$$typeof===o||f.$$typeof===u||f.$$typeof===l||f.$$typeof===k||f.getModuleId!==void 0))}function N(f,p,w){var R=f.displayName;if(R)return R;var I=p.displayName||p.name||"";return I!==""?w+"("+I+")":w}function ge(f){return f.displayName||"Context"}function M(f){if(f==null)return null;if(typeof f.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case a:return"Fragment";case e:return"Portal";case t:return"Profiler";case i:return"StrictMode";case n:return"Suspense";case c:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case u:var p=f;return ge(p)+".Consumer";case o:var w=f;return ge(w._context)+".Provider";case l:return N(f,f.render,"ForwardRef");case d:var R=f.displayName||null;return R!==null?R:M(f.type)||"Memo";case g:{var I=f,j=I._payload,T=I._init;try{return M(T(j))}catch{return null}}}return null}var ie=Object.assign,Ee=0,Bn,Gn,Mn,Qn,Vn,Hn,Wn;function zn(){}zn.__reactDisabledLog=!0;function Oa(){{if(Ee===0){Bn=console.log,Gn=console.info,Mn=console.warn,Qn=console.error,Vn=console.group,Hn=console.groupCollapsed,Wn=console.groupEnd;var f={configurable:!0,enumerable:!0,value:zn,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}Ee++}}function ja(){{if(Ee--,Ee===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ie({},f,{value:Bn}),info:ie({},f,{value:Gn}),warn:ie({},f,{value:Mn}),error:ie({},f,{value:Qn}),group:ie({},f,{value:Vn}),groupCollapsed:ie({},f,{value:Hn}),groupEnd:ie({},f,{value:Wn})})}Ee<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Pt=C.ReactCurrentDispatcher,Ct;function qe(f,p,w){{if(Ct===void 0)try{throw Error()}catch(I){var R=I.stack.trim().match(/\n( *(at )?)/);Ct=R&&R[1]||""}return`
|
|
10
|
+
`+Ct+f}}var _t=!1,Ue;{var Na=typeof WeakMap=="function"?WeakMap:Map;Ue=new Na}function Jn(f,p){if(!f||_t)return"";{var w=Ue.get(f);if(w!==void 0)return w}var R;_t=!0;var I=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=Pt.current,Pt.current=null,Oa();try{if(p){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(W){R=W}Reflect.construct(f,[],T)}else{try{T.call()}catch(W){R=W}f.call(T.prototype)}}else{try{throw Error()}catch(W){R=W}f()}}catch(W){if(W&&R&&typeof W.stack=="string"){for(var E=W.stack.split(`
|
|
11
|
+
`),q=R.stack.split(`
|
|
12
|
+
`),L=E.length-1,$=q.length-1;L>=1&&$>=0&&E[L]!==q[$];)$--;for(;L>=1&&$>=0;L--,$--)if(E[L]!==q[$]){if(L!==1||$!==1)do if(L--,$--,$<0||E[L]!==q[$]){var Q=`
|
|
13
|
+
`+E[L].replace(" at new "," at ");return f.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",f.displayName)),typeof f=="function"&&Ue.set(f,Q),Q}while(L>=1&&$>=0);break}}}finally{_t=!1,Pt.current=j,ja(),Error.prepareStackTrace=I}var ve=f?f.displayName||f.name:"",cr=ve?qe(ve):"";return typeof f=="function"&&Ue.set(f,cr),cr}function Aa(f,p,w){return Jn(f,!1)}function Fa(f){var p=f.prototype;return!!(p&&p.isReactComponent)}function Be(f,p,w){if(f==null)return"";if(typeof f=="function")return Jn(f,Fa(f));if(typeof f=="string")return qe(f);switch(f){case n:return qe("Suspense");case c:return qe("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case l:return Aa(f.render);case d:return Be(f.type,p,w);case g:{var R=f,I=R._payload,j=R._init;try{return Be(j(I),p,w)}catch{}}}return""}var Ge=Object.prototype.hasOwnProperty,Kn={},Yn=C.ReactDebugCurrentFrame;function Me(f){if(f){var p=f._owner,w=Be(f.type,f._source,p?p.type:null);Yn.setExtraStackFrame(w)}else Yn.setExtraStackFrame(null)}function La(f,p,w,R,I){{var j=Function.call.bind(Ge);for(var T in f)if(j(f,T)){var E=void 0;try{if(typeof f[T]!="function"){var q=Error((R||"React class")+": "+w+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}E=f[T](p,T,R,w,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(L){E=L}E&&!(E instanceof Error)&&(Me(I),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",R||"React class",w,T,typeof E),Me(null)),E instanceof Error&&!(E.message in Kn)&&(Kn[E.message]=!0,Me(I),_("Failed %s type: %s",w,E.message),Me(null))}}}var $a=Array.isArray;function Rt(f){return $a(f)}function qa(f){{var p=typeof Symbol=="function"&&Symbol.toStringTag,w=p&&f[Symbol.toStringTag]||f.constructor.name||"Object";return w}}function Ua(f){try{return Xn(f),!1}catch{return!0}}function Xn(f){return""+f}function Zn(f){if(Ua(f))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qa(f)),Xn(f)}var Te=C.ReactCurrentOwner,Ba={key:!0,ref:!0,__self:!0,__source:!0},er,tr,kt;kt={};function Ga(f){if(Ge.call(f,"ref")){var p=Object.getOwnPropertyDescriptor(f,"ref").get;if(p&&p.isReactWarning)return!1}return f.ref!==void 0}function Ma(f){if(Ge.call(f,"key")){var p=Object.getOwnPropertyDescriptor(f,"key").get;if(p&&p.isReactWarning)return!1}return f.key!==void 0}function Qa(f,p){if(typeof f.ref=="string"&&Te.current&&p&&Te.current.stateNode!==p){var w=M(Te.current.type);kt[w]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(Te.current.type),f.ref),kt[w]=!0)}}function Va(f,p){{var w=function(){er||(er=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",p))};w.isReactWarning=!0,Object.defineProperty(f,"key",{get:w,configurable:!0})}}function Ha(f,p){{var w=function(){tr||(tr=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",p))};w.isReactWarning=!0,Object.defineProperty(f,"ref",{get:w,configurable:!0})}}var Wa=function(f,p,w,R,I,j,T){var E={$$typeof:r,type:f,key:p,ref:w,props:T,_owner:j};return E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(E,"_self",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.defineProperty(E,"_source",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E};function za(f,p,w,R,I){{var j,T={},E=null,q=null;w!==void 0&&(Zn(w),E=""+w),Ma(p)&&(Zn(p.key),E=""+p.key),Ga(p)&&(q=p.ref,Qa(p,I));for(j in p)Ge.call(p,j)&&!Ba.hasOwnProperty(j)&&(T[j]=p[j]);if(f&&f.defaultProps){var L=f.defaultProps;for(j in L)T[j]===void 0&&(T[j]=L[j])}if(E||q){var $=typeof f=="function"?f.displayName||f.name||"Unknown":f;E&&Va(T,$),q&&Ha(T,$)}return Wa(f,E,q,I,R,Te.current,T)}}var Et=C.ReactCurrentOwner,nr=C.ReactDebugCurrentFrame;function ye(f){if(f){var p=f._owner,w=Be(f.type,f._source,p?p.type:null);nr.setExtraStackFrame(w)}else nr.setExtraStackFrame(null)}var Tt;Tt=!1;function It(f){return typeof f=="object"&&f!==null&&f.$$typeof===r}function rr(){{if(Et.current){var f=M(Et.current.type);if(f)return`
|
|
14
|
+
|
|
15
|
+
Check the render method of \``+f+"`."}return""}}function Ja(f){{if(f!==void 0){var p=f.fileName.replace(/^.*[\\\/]/,""),w=f.lineNumber;return`
|
|
16
|
+
|
|
17
|
+
Check your code at `+p+":"+w+"."}return""}}var ir={};function Ka(f){{var p=rr();if(!p){var w=typeof f=="string"?f:f.displayName||f.name;w&&(p=`
|
|
18
|
+
|
|
19
|
+
Check the top-level render call using <`+w+">.")}return p}}function ar(f,p){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var w=Ka(p);if(ir[w])return;ir[w]=!0;var R="";f&&f._owner&&f._owner!==Et.current&&(R=" It was passed a child from "+M(f._owner.type)+"."),ye(f),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',w,R),ye(null)}}function sr(f,p){{if(typeof f!="object")return;if(Rt(f))for(var w=0;w<f.length;w++){var R=f[w];It(R)&&ar(R,p)}else if(It(f))f._store&&(f._store.validated=!0);else if(f){var I=S(f);if(typeof I=="function"&&I!==f.entries)for(var j=I.call(f),T;!(T=j.next()).done;)It(T.value)&&ar(T.value,p)}}}function Ya(f){{var p=f.type;if(p==null||typeof p=="string")return;var w;if(typeof p=="function")w=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===l||p.$$typeof===d))w=p.propTypes;else return;if(w){var R=M(p);La(w,f.props,"prop",R,f)}else if(p.PropTypes!==void 0&&!Tt){Tt=!0;var I=M(p);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",I||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Xa(f){{for(var p=Object.keys(f.props),w=0;w<p.length;w++){var R=p[w];if(R!=="children"&&R!=="key"){ye(f),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R),ye(null);break}}f.ref!==null&&(ye(f),_("Invalid attribute `ref` supplied to `React.Fragment`."),ye(null))}}function or(f,p,w,R,I,j){{var T=O(f);if(!T){var E="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(E+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var q=Ja(I);q?E+=q:E+=rr();var L;f===null?L="null":Rt(f)?L="array":f!==void 0&&f.$$typeof===r?(L="<"+(M(f.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):L=typeof f,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",L,E)}var $=za(f,p,w,I,j);if($==null)return $;if(T){var Q=p.children;if(Q!==void 0)if(R)if(Rt(Q)){for(var ve=0;ve<Q.length;ve++)sr(Q[ve],f);Object.freeze&&Object.freeze(Q)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else sr(Q,f)}return f===a?Xa($):Ya($),$}}function Za(f,p,w){return or(f,p,w,!0)}function es(f,p,w){return or(f,p,w,!1)}var ts=es,ns=Za;pe.Fragment=a,pe.jsx=ts,pe.jsxs=ns}()),pe}var me={};/**
|
|
20
|
+
* @license React
|
|
21
|
+
* react-jsx-runtime.production.min.js
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/var Ot;function fr(){if(Ot)return me;Ot=1;var s=U,r=Symbol.for("react.element"),e=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,i=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t={key:!0,ref:!0,__self:!0,__source:!0};function o(u,l,n){var c,d={},g=null,y=null;n!==void 0&&(g=""+n),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(y=l.ref);for(c in l)a.call(l,c)&&!t.hasOwnProperty(c)&&(d[c]=l[c]);if(u&&u.defaultProps)for(c in l=u.defaultProps,l)d[c]===void 0&&(d[c]=l[c]);return{$$typeof:r,type:u,key:g,ref:y,props:d,_owner:i.current}}return me.Fragment=e,me.jsx=o,me.jsxs=o,me}process.env.NODE_ENV==="production"?Qe.exports=fr():Qe.exports=lr();var h=Qe.exports;const Ve=b.createContext({authProvider:{getAccessToken:async()=>{throw new Error("No auth provider available")},isAuthenticated:async()=>!1,clearCache:async()=>{throw new Error("No auth provider available")},logout:async()=>{throw new Error("No auth provider available")}}}),Ie=()=>b.useContext(Ve),dr=s=>h.jsx(Ve.Provider,{value:{authProvider:s.authProvider},children:s.children});var De=function(){function s(){}return s.splitToMaxLength=function(r,e){for(var a=[],i=0;i<r.length;)a.push(r.slice(i,i+e)),i+=e;return a},s.getSubMap=function(r,e){var a=new Map;return e.forEach(function(i){return a.set(i,r.get(i))}),a},s}(),hr=function(){function s(){this.query=""}return s.prototype.withQuery=function(r,e){return e===void 0&&(e="And"),this.query?this.query="<".concat(e,">").concat(this.query).concat(r,"</").concat(e,">"):this.query=r,this},s.prototype.withFieldQuery=function(r,e){if(e===void 0&&(e="And"),!r.name)throw new Error("Field name is required");if(!r.type)throw new Error("Field type is required");r.comparer||(r.comparer="Eq");var a="";switch(r.comparer){case"IsNull":case"IsNotNull":a="<".concat(r.comparer,"><FieldRef Name='").concat(r.name,"' /></").concat(r.comparer,">");break;case"CurrentUserGroups":a=`<Or>
|
|
28
|
+
<Membership Type="CurrentUserGroups">
|
|
29
|
+
<FieldRef Name="`.concat(r.name,`"/>
|
|
30
|
+
</Membership>
|
|
31
|
+
<Eq>
|
|
32
|
+
<FieldRef Name="`).concat(r.name,`"></FieldRef>
|
|
33
|
+
<Value Type="Integer">
|
|
34
|
+
<UserID/>
|
|
35
|
+
</Value>
|
|
36
|
+
</Eq>
|
|
37
|
+
</Or>`);break;case"IDEq":a="<Eq><FieldRef Name='".concat(r.name,"' LookupId='True' /><Value Type='").concat(r.type,"'>").concat(r.value,"</Value></Eq>");break;default:a="<".concat(r.comparer,"><FieldRef Name='").concat(r.name,"' /><Value ").concat(r.includeTimeValue!=null?"IncludeTimeValue='".concat(r.includeTimeValue?"TRUE":"FALSE","' "):"","Type='").concat(r.type,"'>").concat(r.value,"</Value></").concat(r.comparer,">");break}return this.query?this.query="<".concat(e,">").concat(this.query).concat(a,"</").concat(e,">"):this.query=a,this},s.prototype.build=function(){return this.query},s}(),jt=function(){function s(){this.query="",this.oDataSupportedComparers=["BeginsWith","Contains","Eq","IDEq","Geq","Gt","IsNotNull","IsNull","Leq","Lt","Neq"]}return s.prototype.withQuery=function(r,e){return e===void 0&&(e="And"),this.query?this.query="(".concat(this.query,") ").concat(e.toLocaleLowerCase()," (").concat(r,")"):this.query=r,this},s.prototype.withFieldQuery=function(r,e){if(e===void 0&&(e="And"),!r.name)throw new Error("Field name is required");if(!r.type)throw new Error("Field type is required");r.comparer||(r.comparer="Eq");var a="";switch(r.comparer){case"IsNull":a="".concat(r.name," eq null");break;case"IsNotNull":a="".concat(r.name," ne null");break;case"CurrentUserGroups":throw new Error("Not supported!");case"IDEq":a="".concat(r.name,"/Id eq ").concat(r.value);break;default:if(this.oDataSupportedComparers.indexOf(r.comparer)>=0)if(r.comparer==="Contains"){a="substringof('".concat(r.value,"', ").concat(r.name,")");break}else if(r.comparer==="BeginsWith"){a="startswith(".concat(r.name,", '").concat(r.value,"')");break}else{a="".concat(r.name," ").concat(r.comparer.toLocaleLowerCase().replace("geq","ge").replace("leq","le").replace("neq","ne")," "),r.type&&(r.type==="Number"||r.type==="Counter"||r.type==="Integer"||r.type==="Boolean")?a+=r.value:r.type&&r.type==="Guid"?a+="guid'".concat(r.value,"'"):r.type&&(r.type==="Date"||r.type==="DateTime")?a+="datetime'".concat(r.value,"'"):a+="'".concat(r.value,"'");break}else throw new Error("Unsupported comparer")}return this.query?this.query="(".concat(this.query,") ").concat(e.toLocaleLowerCase()," (").concat(a,")"):this.query=a,this},s.prototype.build=function(){return this.query},s}(),gr=function(){var s=function(r,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(a[t]=i[t])},s(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(r,e);function a(){this.constructor=r}r.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}(),He=function(s){gr(r,s);function r(){return s!==null&&s.apply(this,arguments)||this}return r.prototype.withFieldQuery=function(e,a){var i="";return e.type&&(e.type==="Date"||e.type==="DateTime")?(i=e.name,i+=" ",i+=e.comparer.toLocaleLowerCase().replace("geq","ge").replace("leq","le"),i+=" ",i+=e.value,this.query?this.query="(".concat(this.query,") ").concat(a.toLocaleLowerCase()," (").concat(i,")"):this.query=i,this):e.comparer==="Contains"?(i="contains(".concat(e.name,", '").concat(e.value,"')"),this.query?this.query="(".concat(this.query,") ").concat(a.toLocaleLowerCase()," (").concat(i,")"):this.query=i,this):s.prototype.withFieldQuery.call(this,e,a)},r}(jt),We=function(){function s(){}return s.prototype.get=function(r){return JSON.parse(localStorage.getItem(r))},s.prototype.set=function(r,e){localStorage.setItem(r,JSON.stringify(e))},s.prototype.remove=function(r){localStorage.removeItem(r)},s}();function yr(s,r){for(var e=s,a=0;a<r.length;a++)e=e.replace("{".concat(a,"}"),r[a]);return e}function ze(s){var r=[],e=new Map;return function(a,i,t){var o=t.value;t.value=function(){for(var u=this,l=[],n=0;n<arguments.length;n++)l[n-0]=arguments[n];var c=yr(s,l);return new Promise(function(d,g){var y=e.get(c);if(!y)y=o.apply(u,l).then(function(x){return d(x),r.length===0&&e.delete(c),x}).catch(function(x){g(x),r.length===0&&e.delete(c)}),e.set(c,y);else{var v=new Promise(function(x,S){y.then(function(C){d(C),x(C),r.splice(r.indexOf(v),1),r.length===0&&e.delete(c)}).catch(function(C){g(C),S(C)})});r.push(v)}})}}}var Je=function(){function s(){}return s.getTokenInfo=function(r){var e=atob(r.split(".")[1]);return JSON.parse(e)},s.isExpValid=function(r){return!!r&&r>new Date().getTime()/1e3},s.isTokenValid=function(r){var e=s.getTokenInfo(r);return s.isExpValid(e.exp)},s}(),Ke=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Ye=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Xe=function(){function s(){}return s.debounce=function(r,e,a){return a===void 0&&(a=100),Ke(this,void 0,void 0,function(){var i=this;return Ye(this,function(t){return s.registeredTimeouts.has(r)&&window.clearTimeout(s.registeredTimeouts.get(r)),[2,new Promise(function(o,u){return Ke(i,void 0,void 0,function(){var l,n=this;return Ye(this,function(c){return l=setTimeout(function(){return Ke(n,void 0,void 0,function(){var d,g;return Ye(this,function(y){switch(y.label){case 0:return y.trys.push([0,2,,3]),[4,e()];case 1:return d=y.sent(),s.registeredTimeouts.delete(r),o(d),[3,3];case 2:return g=y.sent(),s.registeredTimeouts.delete(r),u(g),[3,3];case 3:return[2]}})})},a),s.registeredTimeouts.set(r,l),[2]})})})]})})},s.registeredTimeouts=new Map,s}(),vr=function(){function s(){}return s.clearStorageKeys=function(r){for(var e=0,a=[localStorage,sessionStorage];e<a.length;e++)for(var i=a[e],t=Object.keys(i),o=0,u=t;o<u.length;o++){var l=u[o];(l.startsWith("msal.".concat(r,"."))||l.includes(r))&&i.removeItem(l)}},s}(),ae=function(){return ae=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},ae.apply(this,arguments)},Nt=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},At=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Ft=function(){function s(r,e,a,i){i===void 0&&(i=0);var t=this;this.baseClient=r,this.registeredPromises=e,this.batch=a,this.retries=i,this.requestBatch=function(o,u){return u===void 0&&(u="beta"),Nt(t,void 0,void 0,function(){var l,n,c;return At(this,function(d){switch(d.label){case 0:return l={headers:{Accept:"application/json",ConsistencyLevel:"eventual","Content-Type":"application/json"},body:o},[4,this.baseClient.post("https://graph.microsoft.com/".concat(u,"/$batch"),l)];case 1:return n=d.sent(),n.ok?[4,n.json()]:[3,3];case 2:return c=d.sent(),[2,c];case 3:return[2]}})})}}return s.prototype.executeBatch=function(){return Nt(this,void 0,void 0,function(){var r,e,a,i,t,o,u;return At(this,function(l){switch(l.label){case 0:return r=this.batch.filter(function(n){return n.url.indexOf("v1.0/")<0}),e=this.batch.filter(function(n){return n.url.indexOf("v1.0/")>=0}),a=JSON.stringify({requests:r.map(function(n){return ae(ae({},n),{url:n.url.replace("beta/","")})})}),i=JSON.stringify({requests:e.map(function(n){return ae(ae({},n),{url:n.url.replace("v1.0/","")})})}),t=[],r.length>0?[4,this.requestBatch(a)]:[3,2];case 1:o=l.sent(),t.push.apply(t,o.responses),l.label=2;case 2:return e.length>0?[4,this.requestBatch(i,"v1.0")]:[3,4];case 3:u=l.sent(),t.push.apply(t,u.responses),l.label=4;case 4:return this.processBatchResponse(t),this.batch.length>0&&this.retries>0&&(this.retries--,this.executeBatch()),[2]}})})},s.prototype.processBatchResponse=function(r){var e=this,a=[],i=new Map;this.registeredPromises.forEach(function(t,o){var u=r.filter(function(l){return l.id===o})[0];u&&u.status===429&&e.retries>0?(a.push({url:o,id:o,method:"GET"}),i.set(o,t)):e.handleSingleResponse(u,t)}),a.length>0?(this.registeredPromises=i,this.batch=a):(this.batch=[],this.registeredPromises.clear())},s.prototype.handleSingleResponse=function(r,e){r?e.forEach(function(a){a.resolve({json:function(){return Promise.resolve(r.body)},ok:r.status===200,status:r.status,text:function(){return Promise.resolve(JSON.stringify(r.body))},headers:r.headers})}):e.forEach(function(a){a.error({json:function(){return Promise.resolve(r)},ok:!1,text:function(){return Promise.resolve(JSON.stringify(r))}})})},s.maxRetries=5,s}(),Ze=function(){return Ze=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},Ze.apply(this,arguments)},pr=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},mr=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},br=function(s,r,e){if(e||arguments.length===2)for(var a=0,i=r.length,t;a<i;a++)(t||!(a in r))&&(t||(t=Array.prototype.slice.call(r,0,a)),t[a]=r[a]);return s.concat(t||Array.prototype.slice.call(r))},wr=function(){function s(r,e,a){e===void 0&&(e=500),a===void 0&&(a=15);var i=this;this.baseClient=r,this.batchWaitTime=e,this.batchSplitThreshold=a,this.batch=[],this.getRequestId=function(t,o){return o==="GET"?encodeURIComponent(t):Math.random().toString(36).substring(7)},this.registeredPromises=new Map,this.generateBatch=function(){return pr(i,void 0,void 0,function(){var t,o,u,l,n,c,d,g;return mr(this,function(y){switch(y.label){case 0:t=br([],this.batch,!0),this.batch=[],o=new Map(this.registeredPromises),this.registeredPromises.clear(),u=De.splitToMaxLength(t,this.batchSplitThreshold),l=0,n=u,y.label=1;case 1:return l<n.length?(c=n[l],d=De.getSubMap(o,c.map(function(v){return v.id})),g=new Ft(this.baseClient,d,c,Ft.maxRetries),[4,g.executeBatch()]):[3,4];case 2:y.sent(),y.label=3;case 3:return l++,[3,1];case 4:return[2]}})})},this.createGetBatchRequest=function(t,o,u,l){i.batch.length===0&&setTimeout(i.generateBatch,i.batchWaitTime);var n=i.getRequestId(t,o),c=new URL(t,"https://graph.microsoft.com"),d=c.pathname+c.search;i.batch.filter(function(g){return g.id===n})[0]?i.registeredPromises.get(n).push(l):(i.batch.push({url:d,id:n,method:o,body:u&&u.body?JSON.parse(u.body):null,headers:Ze({ConsistencyLevel:"eventual"},u?u.headers:{})}),i.registeredPromises.set(n,[l]))}}return s.prototype.get=function(r,e){var a=this;return new Promise(function(i,t){a.createGetBatchRequest(r,"GET",e,{resolve:i,error:t})})},s.prototype.post=function(r,e){var a=this;return r.toLocaleLowerCase().endsWith("/batch")||r.toLocaleLowerCase().endsWith("/chatoverstream")?this.baseClient.post(r,e):new Promise(function(i,t){a.createGetBatchRequest(r,"POST",e,{resolve:i,error:t})})},s.prototype.patch=function(r,e){return this.baseClient.patch(r,e)},s.prototype.put=function(r,e){return this.baseClient.put(r,e)},s.prototype.delete=function(r,e){return this.baseClient.delete(r,e)},s}(),se=function(){return se=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},se.apply(this,arguments)},ee=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},te=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},et=function(){function s(r,e){this.authService=r,this.baseClient=e,this.resourceUri="https://graph.microsoft.com"}return s.prototype.get=function(r,e){return ee(this,void 0,void 0,function(){var a;return te(this,function(i){switch(i.label){case 0:return[4,this.prepareRequest(e)];case 1:return a=i.sent(),[2,this.baseClient.get(r,a)]}})})},s.prototype.post=function(r,e){return ee(this,void 0,void 0,function(){var a;return te(this,function(i){switch(i.label){case 0:return[4,this.prepareRequest(e)];case 1:return a=i.sent(),[2,this.baseClient.post(r,a)]}})})},s.prototype.patch=function(r,e){return ee(this,void 0,void 0,function(){var a;return te(this,function(i){switch(i.label){case 0:return[4,this.prepareRequest(e)];case 1:return a=i.sent(),[2,this.baseClient.patch(r,a)]}})})},s.prototype.put=function(r,e){return ee(this,void 0,void 0,function(){var a;return te(this,function(i){switch(i.label){case 0:return[4,this.prepareRequest(e)];case 1:return a=i.sent(),[2,this.baseClient.put(r,a)]}})})},s.prototype.delete=function(r,e){return ee(this,void 0,void 0,function(){var a;return te(this,function(i){switch(i.label){case 0:return[4,this.prepareRequest({})];case 1:return a=i.sent(),[2,this.baseClient.delete(r,a)]}})})},s.prototype.prepareRequest=function(r){return ee(this,void 0,void 0,function(){var e,a,i,t;return te(this,function(o){switch(o.label){case 0:return e=[se({},r)],i={},a=[se({},r==null?void 0:r.headers)],t={},[4,this.getAuthHeader()];case 1:return[2,se.apply(void 0,e.concat([(i.headers=se.apply(void 0,a.concat([(t.Authorization=o.sent(),t)])),i)]))]}})})},s.prototype.getAuthHeader=function(){return ee(this,void 0,void 0,function(){var r;return te(this,function(e){switch(e.label){case 0:return[4,this.authService.getAccessToken(this.resourceUri)];case 1:return r=e.sent(),[2,"Bearer ".concat(r)]}})})},s}(),ne=function(){return ne=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},ne.apply(this,arguments)},oe=function(){function s(r){this.baseUrl=r}return s.prototype.buildUrl=function(r){return r.startsWith("http")||!this.baseUrl?r:this.baseUrl+r},s.prototype.get=function(r,e){return fetch(this.buildUrl(r),ne({method:"GET"},e))},s.prototype.post=function(r,e){return fetch(this.buildUrl(r),ne({method:"POST"},e))},s.prototype.patch=function(r,e){return fetch(this.buildUrl(r),ne({method:"PATCH"},e))},s.prototype.put=function(r,e){return fetch(this.buildUrl(r),ne({method:"PUT"},e))},s.prototype.delete=function(r,e){return fetch(this.buildUrl(r),ne({method:"DELETE"},e))},s}(),xr=function(){function s(){this.lastUsedId=0}return s.prototype.getNextId=function(){return this.lastUsedId++,this.lastUsedId.toString()},s.prototype.reset=function(){this.lastUsedId=0},s}(),Sr=function(){var s=function(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)};return"".concat(s()).concat(s(),"-").concat(s(),"-").concat(s(),"-").concat(s(),"-").concat(s()).concat(s()).concat(s())},Lt=function(s){for(var r="",e=0;e<s;e++){var a=Math.floor(Math.random()*26)+(Math.random()<.5?65:97);r+=String.fromCharCode(a)}return r},$t=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},qt=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Ut=function(){function s(r,e,a,i,t,o){o===void 0&&(o=0);var u=this;this.baseClient=r,this.dataverseEnvUri=e,this.apiPath=a,this.registeredPromises=i,this.batch=t,this.retries=o,this.batchSeparator="batch-mgwdev-m365-helpers",this.requestBatch=function(l){return $t(u,void 0,void 0,function(){var n,c,d,g;return qt(this,function(y){switch(y.label){case 0:return n={headers:{Accept:"application/json","OData-Version":"4.0","content-type":"multipart/mixed; boundary=".concat(this.batchSeparator)},body:l},[4,this.baseClient.post("".concat(this.dataverseEnvUri).concat(this.apiPath,"/$batch"),n)];case 1:return c=y.sent(),c.ok?[4,c.text()]:[3,3];case 2:return d=y.sent(),g=c.headers.get("content-type").split("boundary=")[1],[2,d.split(g)];case 3:return[2]}})})}}return s.prototype.executeBatch=function(){return $t(this,void 0,void 0,function(){var r,e,a;return qt(this,function(i){switch(i.label){case 0:return r=this.buildBatchBody(),e=[],this.batch.length>0?[4,this.requestBatch(r)]:[3,2];case 1:a=i.sent(),e.push.apply(e,a),i.label=2;case 2:return this.processBatchResponse(e),this.batch.length>0&&this.retries>0&&(this.retries--,this.executeBatch()),[2]}})})},s.prototype.buildBatchBody=function(){var r=this,e="";return this.batch.forEach(function(a){if(e+="--".concat(r.batchSeparator,`
|
|
38
|
+
Content-type: application/http
|
|
39
|
+
Content-Transfer-Encoding: binary
|
|
40
|
+
|
|
41
|
+
`),e+="".concat(a.method," ").concat(a.url,` HTTP/1.1
|
|
42
|
+
`),a.headers)for(var i in a.headers)e+="".concat(i,": ").concat(a.headers[i],`
|
|
43
|
+
`);if(a.body){var t=new TextEncoder,o=t.encode(a.body),u=o.length;e+="Content-Length: ".concat(u,`
|
|
44
|
+
`),e+=`
|
|
45
|
+
`,e+="".concat(a.body)}e+=`
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
`}),e+="--".concat(this.batchSeparator,"--"),e},s.prototype.extractJSONFromBody=function(r){var e=r.indexOf("{");if(e!==-1){var a=r.substring(e),i=a.lastIndexOf("}")+1;if(i!==-1){var t=a.substring(0,i);try{return JSON.parse(t),t}catch(o){return console.error("Error parsing JSON:",o),null}}else return console.error("End of JSON data not found in the input text."),null}else return console.error("JSON data not found in the input text."),null},s.prototype.processBatchResponse=function(r){var e=this,a=[],i=new Map;this.registeredPromises.forEach(function(t,o){var u=r[o],l=e.extractJSONFromBody(u);e.handleSingleResponse(l,t)}),a.length>0?(this.registeredPromises=i,this.batch=a):(this.batch=[],this.registeredPromises.clear())},s.prototype.handleSingleResponse=function(r,e){var a=r;r?e.resolve({json:function(){return Promise.resolve(JSON.parse(a))},ok:!0,text:function(){return Promise.resolve(a)}}):e.error({json:function(){return Promise.resolve(JSON.parse(a))},ok:!1,text:function(){return Promise.resolve(a)}})},s.maxRetries=5,s}(),Bt=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Gt=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Pr=function(){function s(r,e,a,i,t){a===void 0&&(a="/api/data/v9.2"),i===void 0&&(i=500),t===void 0&&(t=15);var o=this;this.baseClient=r,this.dataverseEnvUri=e,this.apiPath=a,this.batchWaitTime=i,this.batchSplitThreshold=t,this.promiseIdGenerator=new xr,this.registeredPromises=new Map,this.batch=[],this.generateBatch=function(){return Bt(o,void 0,void 0,function(){var u,l,n,c,d,g;return Gt(this,function(y){switch(y.label){case 0:u=De.splitToMaxLength(this.batch,this.batchSplitThreshold),l=0,n=u,y.label=1;case 1:return l<n.length?(c=n[l],d=De.getSubMap(this.registeredPromises,c.map(function(v){return v.id})),g=new Ut(this.baseClient,this.dataverseEnvUri,this.apiPath,d,c,Ut.maxRetries),this.batch=[],this.promiseIdGenerator.reset(),this.registeredPromises.clear(),[4,g.executeBatch()]):[3,4];case 2:y.sent(),y.label=3;case 3:return l++,[3,1];case 4:return[2]}})})}}return s.prototype.get=function(r,e){return Bt(this,void 0,void 0,function(){var a,i,t=this;return Gt(this,function(o){return a=this.promiseIdGenerator.getNextId(),i=new Promise(function(u,l){t.batch.length===0&&setTimeout(t.generateBatch,t.batchWaitTime),t.registeredPromises.set(a,{resolve:u,error:l}),t.batch.push({url:r,id:a,method:"GET",headers:e==null?void 0:e.headers})}),[2,i]})})},s.prototype.post=function(r,e){var a=this,i=this.promiseIdGenerator.getNextId(),t=new Promise(function(o,u){a.batch.length===0&&setTimeout(a.generateBatch,a.batchWaitTime),a.registeredPromises.set(i,{resolve:o,error:u}),a.batch.push({url:r,id:i,method:"POST",body:e==null?void 0:e.body,headers:e==null?void 0:e.headers})});return t},s.prototype.patch=function(r,e){return this.baseClient.patch(r,e)},s.prototype.put=function(r,e){return this.baseClient.put(r,e)},s.prototype.delete=function(r){return this.baseClient.delete(r)},s}(),ce=function(){return ce=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},ce.apply(this,arguments)},ue=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},le=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Mt={headers:{"content-type":"application/json;odata=nometadata",accept:"application/json;odata=nometadata"}},Cr=function(){function s(r,e,a,i,t){i===void 0&&(i=[]),this.spHttpClient=r,this.siteUrl=e,this.listId=a,this.selectedFields=i,this.mapMethod=t,this.pageSize=25,this.orderBy="ID",this.orderDir="DESC",this.lastValue="",this.previousPages=[],this.previousPageIndex=-1,this.currentLink="",this.query="",this.lastId=0,this.lastRow=0,this.allItemsCount=0,this.recursive=!0}return s.prototype.getData=function(){return ue(this,void 0,void 0,function(){var r;return le(this,function(e){switch(e.label){case 0:return this.previousPageIndex=-1,this.previousPages=[],this.currentLink="".concat(this.siteUrl,"/_api/web/lists('").concat(this.listId,"')/RenderListDataAsStream?TryNewExperienceSingle=TRUE&Paged=TRUE"),[4,Promise.all([this.getDataWithAPI(this.currentLink),this.getAllItemsCount()])];case 1:return r=e.sent()[0],[2,r]}})})},s.prototype.getAllItemsCount=function(){return ue(this,void 0,void 0,function(){var a,r,e,a,i;return le(this,function(t){switch(t.label){case 0:return this.query?[3,4]:[4,this.spHttpClient.get("".concat(this.siteUrl,"/_api/web/lists('").concat(this.listId,"')?$select=itemCount"),{headers:{accept:"application/json","content-type":"application/json;odata=verbose"}})];case 1:return a=t.sent(),a.ok?[4,this.getResponse(a)]:[3,3];case 2:r=t.sent(),this.allItemsCount=r.ItemCount,t.label=3;case 3:return[3,7];case 4:return e='<View Scope="RecursiveAll"><Query><Where>'.concat(this.query,"</Where><ViewFields><FieldRef Name='ID' /></ViewFields></Query></View>"),[4,this.spHttpClient.post("".concat(this.siteUrl,"/_api/web/lists('").concat(this.listId,"')/RenderListDataAsStream"),ce(ce({},Mt),{body:JSON.stringify(this.buildPostBody(e))}))];case 5:return a=t.sent(),a.ok?(i=this,[4,this.getResponse(a)]):[3,7];case 6:i.allItemsCount=t.sent().Row.length,t.label=7;case 7:return[2,this.allItemsCount]}})})},s.prototype.setOrder=function(r,e){this.orderBy=r,this.orderDir=e},s.prototype.getCamlQuery=function(){return!this.query&&!this.orderBy?"":"<Query>".concat(this.query?"<Where>".concat(this.query,"</Where>"):"",'<OrderBy><FieldRef Name="').concat(this.orderBy,'" Ascending="').concat(this.orderDir==="ASC"?"TRUE":"FALSE",'"/></OrderBy><ViewFields>').concat(this.selectedFields.map(function(r){return"<FieldRef Name='".concat(r,"' />")}).join(""),"</ViewFields></Query>")},s.prototype.buildPostBody=function(r){return{parameters:{RenderOptions:2,ViewXml:r}}},s.prototype.getQuery=function(){return this.query},s.prototype.getCurrentPage=function(){return this.previousPageIndex+1},s.prototype.getResponse=function(r){return ue(this,void 0,void 0,function(){return le(this,function(e){switch(e.label){case 0:return[4,r.json()];case 1:return[2,e.sent()]}})})},s.prototype.getDataWithAPI=function(r){return ue(this,void 0,void 0,function(){var e,a,i;return le(this,function(t){switch(t.label){case 0:return[4,this.spHttpClient.post(r,ce(ce({},Mt),{body:JSON.stringify(this.buildPostBody("<View".concat(this.recursive?' Scope="RecursiveAll"':"",">").concat(this.getCamlQuery(),"<RowLimit>").concat(this.pageSize,"</RowLimit></View>")))}))];case 1:return e=t.sent(),e.ok?[4,this.getResponse(e)]:[3,3];case 2:return a=t.sent(),a.Row.length>0&&(this.lastValue=a.Row[a.Row.length-1][this.orderBy],this.lastValue=this.getLastFieldValue(a.Row),this.lastId=a.Row[a.Row.length-1].ID,this.lastRow=a.LastRow),this.mapMethod?[2,a.Row.map(this.mapMethod)]:[2,a.Row];case 3:return i=Error.bind,[4,e.text()];case 4:throw new(i.apply(Error,[void 0,t.sent()]))}})})},s.prototype.getLastFieldValue=function(r){return r[r.length-1][this.orderBy]},s.prototype.setQuery=function(r){this.query=r},s.prototype.getNextPage=function(){return ue(this,void 0,void 0,function(){var r=this;return le(this,function(e){return this.previousPages.find(function(a){return a===r.currentLink})?this.previousPageIndex=this.previousPages.findIndex(function(a){return a===r.currentLink}):(this.previousPages.push(this.currentLink),this.previousPageIndex=this.previousPages.length-1),this.currentLink="".concat(this.siteUrl,"/_api/web/lists('").concat(this.listId,"')/RenderListDataAsStream?TryNewExperienceSingle=TRUE&Paged=TRUE&p_").concat(this.orderBy,"=").concat(encodeURIComponent(this.lastValue).toLocaleLowerCase(),"&p_ID=").concat(this.lastId,"&SortField=").concat(this.orderBy,"&SortDir=").concat(this.orderDir==="ASC"?"Asc":"Desc","&PageFirstRow=").concat(this.lastRow+1),[2,this.getDataWithAPI(this.currentLink)]})})},s.prototype.isNextPageAvailable=function(){return this.previousPageIndex+2<=Math.floor(this.allItemsCount/this.pageSize)},s.prototype.getPreviousPage=function(){return ue(this,void 0,void 0,function(){return le(this,function(r){return this.currentLink=this.previousPages[this.previousPageIndex],this.previousPageIndex--,[2,this.getDataWithAPI(this.currentLink)]})})},s.prototype.isPreviousPageAvailable=function(){return this.previousPageIndex>=0},s}(),be=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},we=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},_r=function(){function s(r,e,a){a===void 0&&(a=!1),this.graphClient=r,this.resourceQuery=e,this.skipCountCheck=a,this.filterQuery="",this.orderQuery="",this.nextPageLink="",this.previousPages=[],this.previousPageIndex=-1,this.pageSize=25,this.allItemsCount=-1}return s.prototype.getAllItemsCount=function(){return be(this,void 0,void 0,function(){var r,e,a,i;return we(this,function(t){switch(t.label){case 0:return this.skipCountCheck?[2,-1]:(r=this.getQuery(),e="".concat(this.resourceQuery,"/$count"),this.getQuery()&&(e+="?$filter=".concat(r)),[4,this.graphClient.get(e)]);case 1:return a=t.sent(),a.ok?(i=parseInt,[4,a.text()]):[3,3];case 2:return[2,i.apply(void 0,[t.sent(),10])];case 3:return[2]}})})},s.prototype.getData=function(){return be(this,void 0,void 0,function(){var r,e,a;return we(this,function(i){switch(i.label){case 0:return[4,Promise.all([this.callGraphAPI(this.buildInitialQuery()),this.getAllItemsCount()])];case 1:return r=i.sent(),e=r[0],a=r[1],this.allItemsCount=a,[2,e]}})})},s.prototype.buildInitialQuery=function(){var r=this.getQuery(),e="".concat(this.resourceQuery,"?$top=").concat(this.pageSize);return this.orderQuery&&(e+="&$orderBy=".concat(this.orderQuery)),r&&(e+="&$filter=".concat(r)),e},s.prototype.callGraphAPI=function(r){return be(this,void 0,void 0,function(){var e,a,i,t;return we(this,function(o){switch(o.label){case 0:return[4,this.graphClient.get(r)];case 1:return e=o.sent(),e.ok?[4,e.json()]:[3,3];case 2:return a=o.sent(),i=a.value,this.nextPageLink=a["@odata.nextLink"],[2,i];case 3:return t=Error.bind,[4,e.text()];case 4:throw new(t.apply(Error,[void 0,o.sent()]))}})})},s.prototype.setQuery=function(r){this.filterQuery=r},s.prototype.getQuery=function(){return this.filterQuery},s.prototype.setOrder=function(r,e){this.orderQuery="".concat(r," ").concat(e.toLocaleLowerCase())},s.prototype.getNextPage=function(){return be(this,void 0,void 0,function(){return we(this,function(r){return this.isNextPageAvailable()?(this.previousPageIndex++,this.previousPages.push(this.nextPageLink),[2,this.callGraphAPI(this.nextPageLink)]):[2,[]]})})},s.prototype.isNextPageAvailable=function(){return!!this.nextPageLink},s.prototype.getPreviousPage=function(){return be(this,void 0,void 0,function(){var r,e;return we(this,function(a){switch(a.label){case 0:return this.isPreviousPageAvailable()?(r=this.previousPages[this.previousPageIndex],[4,this.callGraphAPI(r)]):[2,[]];case 1:return e=a.sent(),this.previousPageIndex--,[2,e]}})})},s.prototype.isPreviousPageAvailable=function(){return this.previousPageIndex>=0&&!!this.previousPages[this.previousPageIndex]},s.prototype.getCurrentPage=function(){return this.previousPageIndex+1},s}(),z=function(){return z=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},z.apply(this,arguments)},Oe=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},je=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},tt=function(){function s(r,e,a){e===void 0&&(e=["listItem"]),a===void 0&&(a=["id","title","url"]),this.graphClient=r,this.entityTypes=e,this.selectFields=a,this.currentPage=0,this.pageSize=25,this.allItemsCount=-1,this.graphSearchEndpoint="https://graph.microsoft.com/beta/search/query"}return s.prototype.setRefiners=function(r){this.requestedRefiners=r||[]},s.prototype.applyRefiners=function(r){this.filters=r||void 0},s.prototype.buildSearchRequest=function(){var r,e={requests:[{entityTypes:this.entityTypes,from:this.currentPage*this.pageSize,to:(this.currentPage+1)*this.pageSize,query:null,sortProperties:null,fields:null,aggregations:this.requestedRefiners,aggregationFilters:((r=this.filters)===null||r===void 0?void 0:r.map(function(a){return"".concat(a.field,":").concat(a.filterValue)}))||void 0,size:this.pageSize}]};return this.getQuery()?(e.requests[0].query={queryString:this.getQuery()},this.queryTemplate&&(e.requests[0].query.queryTemplate=this.queryTemplate)):(e.requests[0].query={queryString:"*"},this.queryTemplate&&(e.requests[0].query.queryTemplate=this.queryTemplate)),this.orderColumn&&(e.requests[0].sortProperties=[{name:this.orderColumn,isDescending:this.isDescending}]),this.selectFields&&this.selectFields.length>0&&(e.requests[0].fields=this.selectFields),e},s.prototype.callForData=function(){return Oe(this,void 0,void 0,function(){var r,e,a,i;return je(this,function(t){switch(t.label){case 0:return[4,this.graphClient.post(this.graphSearchEndpoint,{body:JSON.stringify(this.buildSearchRequest()),headers:{accept:"application/json","content-type":"application/json"}})];case 1:return r=t.sent(),r.ok?[4,r.json()]:[3,3];case 2:return e=t.sent(),a=e.value[0].hitsContainers[0],this.allItemsCount=a.total,this.parseAggregations(a),this.allItemsCount>0?[2,a.hits.map(function(o){return z(z({},o.resource),{type:o.resource["@odata.type"],hitResourceIdId:o.resource.id,hitId:o.hitId,hitRank:o.rank,hitHighlights:o.highlights,hitSummary:o.summary})})]:[2,[]];case 3:return i=Error.bind,[4,r.text()];case 4:throw new(i.apply(Error,[void 0,t.sent()]))}})})},s.prototype.getData=function(){return Oe(this,void 0,void 0,function(){return je(this,function(r){return this.currentPage=0,[2,this.callForData()]})})},s.prototype.parseAggregations=function(r){try{this.currentAggregations=r.aggregations.map(function(e){return z(z({},e),{buckets:e.buckets.map(function(a){return z(z({},a),{value:a.value,count:a.count})})})})}catch{this.currentAggregations=[]}},s.prototype.setQuery=function(r){this.query=r},s.prototype.getQuery=function(){return this.query},s.prototype.setOrder=function(r,e){this.orderColumn=r,this.isDescending=e==="DESC"},s.prototype.getNextPage=function(){return Oe(this,void 0,void 0,function(){return je(this,function(r){return this.isNextPageAvailable()?(this.currentPage++,[2,this.callForData()]):[2,[]]})})},s.prototype.isNextPageAvailable=function(){return(this.currentPage+1)*this.pageSize<this.allItemsCount},s.prototype.getPreviousPage=function(){return Oe(this,void 0,void 0,function(){return je(this,function(r){return this.isPreviousPageAvailable()?(this.currentPage--,[2,this.callForData()]):[2,[]]})})},s.prototype.isPreviousPageAvailable=function(){return this.currentPage>0},s.prototype.getCurrentPage=function(){return this.currentPage},s.prototype.jumpToAPage=function(r){return this.currentPage=r,this.callForData()},s}(),Rr=function(){var s=function(r,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(a[t]=i[t])},s(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(r,e);function a(){this.constructor=r}r.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}(),nt=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},rt=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},kr=function(s){Rr(r,s);function r(e,a,i){a===void 0&&(a=!0),i===void 0&&(i=!0);var t=s.call(this,e,"https://graph.microsoft.com/v1.0/me/people",!0)||this;return t.loadPresence=a,t.loadPhoto=i,t.personTypeClass="Person",t.pageSize=7,t}return r.prototype.callGraphAPI=function(e){return nt(this,void 0,void 0,function(){var a,i;return rt(this,function(t){switch(t.label){case 0:return[4,s.prototype.callGraphAPI.call(this,e)];case 1:return a=t.sent(),i=[],this.loadPresence&&i.push.apply(i,a.map(this.appendPresence.bind(this))),this.loadPhoto&&i.push.apply(i,a.map(this.appendPhoto.bind(this))),i.length>0?[4,Promise.all(i)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2,a]}})})},r.prototype.appendPresence=function(e){return nt(this,void 0,void 0,function(){var a,i;return rt(this,function(t){switch(t.label){case 0:return[4,this.graphClient.get("v1.0/users/".concat(e.id,"/presence"))];case 1:return a=t.sent(),a.ok?(i=e,[4,a.json()]):[3,3];case 2:i.presence=t.sent(),t.label=3;case 3:return[2]}})})},r.prototype.appendPhoto=function(e){return nt(this,void 0,void 0,function(){var a,i;return rt(this,function(t){switch(t.label){case 0:return[4,this.graphClient.get("/v1.0/users/".concat(e.id,"/photo/$value"))];case 1:return a=t.sent(),a.ok?(i=e,[4,a.text()]):[3,3];case 2:i.photo=t.sent(),t.label=3;case 3:return[2]}})})},r.prototype.buildInitialQuery=function(){var e=this.getQuery(),a="".concat(this.resourceQuery,"?$top=").concat(this.pageSize);return this.orderQuery&&(a+="&$orderBy=".concat(this.orderQuery)),e&&(a+="&$search=".concat(e)),this.personTypeClass&&(a+="&$filter=personType/class eq '".concat(this.personTypeClass,"'")),a},r}(_r),xe=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Se=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Qt=function(){function s(r,e,a,i,t){a===void 0&&(a=!1),i===void 0&&(i=""),t===void 0&&(t=""),this.apiClient=r,this.resourceQuery=e,this.skipCountCheck=a,this.expandQuery=i,this.selectQuery=t,this.filterQuery="",this.orderQuery="",this.previousPages=new Map,this.currentPage=0,this.pageSize=25,this.allItemsCount=-1}return s.prototype.getAllItemsCount=function(){return xe(this,void 0,void 0,function(){var r,e,a,i;return Se(this,function(t){switch(t.label){case 0:return this.skipCountCheck?[2,1/0]:(r=this.getQuery(),e="".concat(this.resourceQuery,"/$count"),this.getQuery()&&(e+="?$filter=".concat(r)),[4,this.apiClient.get(e)]);case 1:return a=t.sent(),a.ok?(i=parseInt,[4,a.text()]):[3,3];case 2:return[2,i.apply(void 0,[t.sent(),10])];case 3:return[2]}})})},s.prototype.getData=function(){return xe(this,void 0,void 0,function(){var r,e,a;return Se(this,function(i){switch(i.label){case 0:return[4,Promise.all([this.callGraphAPI(this.buildInitialQuery()),this.getAllItemsCount()])];case 1:return r=i.sent(),e=r[0],a=r[1],this.allItemsCount=a,[2,e]}})})},s.prototype.buildInitialQuery=function(){var r=this.getQuery(),e="".concat(this.resourceQuery,"?$top=").concat(this.pageSize);return this.orderQuery&&(e+="&$orderby=".concat(this.orderQuery)),r&&(e+="&$filter=".concat(r)),this.expandQuery&&(e+="&$expand=".concat(this.expandQuery)),this.selectQuery&&(e+="&$select=".concat(this.selectQuery)),e},s.prototype.callGraphAPI=function(r){return xe(this,void 0,void 0,function(){var e,a,i,t;return Se(this,function(o){switch(o.label){case 0:return[4,this.apiClient.get(r)];case 1:return e=o.sent(),e.ok?[4,e.json()]:[3,3];case 2:return a=o.sent(),i=a.value,this.previousPages.set(this.currentPage+1,a["@odata.nextLink"]),[2,i];case 3:return t=Error.bind,[4,e.text()];case 4:throw new(t.apply(Error,[void 0,o.sent()]))}})})},s.prototype.setQuery=function(r){this.filterQuery=r},s.prototype.getQuery=function(){return this.filterQuery},s.prototype.setOrder=function(r,e){this.orderQuery="".concat(r," ").concat(e.toLocaleLowerCase())},s.prototype.getNextPage=function(){return xe(this,void 0,void 0,function(){var r;return Se(this,function(e){return this.isNextPageAvailable()?(this.currentPage++,r=this.previousPages.get(this.currentPage),r||(r=this.buildInitialQuery(),r+="&$skip="+this.currentPage*this.pageSize),[2,this.callGraphAPI(r)]):[2,[]]})})},s.prototype.isNextPageAvailable=function(){return!!this.previousPages.get(this.currentPage+1)||(this.currentPage+1)*this.pageSize<this.allItemsCount},s.prototype.getPreviousPage=function(){return xe(this,void 0,void 0,function(){var r,e;return Se(this,function(a){switch(a.label){case 0:return this.isPreviousPageAvailable()?(this.currentPage--,r=this.previousPages.get(this.currentPage),r||(r=this.buildInitialQuery(),this.currentPage*this.pageSize>0&&(r+="&$skip="+this.currentPage*this.pageSize)),[4,this.callGraphAPI(r)]):[2,[]];case 1:return e=a.sent(),[2,e]}})})},s.prototype.isPreviousPageAvailable=function(){return this.currentPage>0},s.prototype.getCurrentPage=function(){return this.currentPage},s}(),Er=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Tr=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Ir=function(){function s(r,e,a,i,t){i===void 0&&(i=""),t===void 0&&(t=12),this.graphClient=r,this.dataSource=e,this.resourceMetadata=a,this.filterExpresssion=i,this.maximumNumberOfResults=t}return s.prototype.getData=function(r){return Er(this,void 0,void 0,function(){var e,a;return Tr(this,function(i){switch(i.label){case 0:return[4,this.graphClient.post("https://graph.microsoft.com/beta/copilot/retrieval",{headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({queryString:r,dataSource:this.dataSource,resourceMetadata:this.resourceMetadata,maximumNumberOfResults:this.maximumNumberOfResults,filterExpresssion:this.filterExpresssion})})];case 1:if(e=i.sent(),!e.ok)throw new Error(e.statusText);return[4,e.json()];case 2:return a=i.sent(),[2,a.retrievalHits]}})})},s}(),Dr=function(){var s=function(r,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(a[t]=i[t])},s(r,e)};return function(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(r,e);function a(){this.constructor=r}r.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}(),Vt=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Ht=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},Or=function(s){Dr(r,s);function r(e,a,i,t,o){t===void 0&&(t=""),o===void 0&&(o="");var u=s.call(this,e,"".concat(a,"/api/data/v9.0/").concat(i),!1,t,o)||this;return u.dataverseEnv=a,u.tableName=i,u}return r.prototype.getData=function(){return Vt(this,void 0,void 0,function(){var e;return Ht(this,function(a){switch(a.label){case 0:return[4,this.callGraphAPI(this.buildInitialQuery())];case 1:return e=a.sent(),[2,e]}})})},r.prototype.buildInitialQuery=function(){var e=this.getQuery(),a=new URL(this.resourceQuery);return this.orderQuery&&a.searchParams.set("$orderby",this.orderQuery),e&&a.searchParams.set("$filter",e),this.expandQuery&&a.searchParams.set("$expand",this.expandQuery),this.selectQuery&&a.searchParams.set("$select",this.selectQuery),a.searchParams.set("$count","true"),a.toString()},r.prototype.callGraphAPI=function(e){return Vt(this,void 0,void 0,function(){var a,i,t,o;return Ht(this,function(u){switch(u.label){case 0:return[4,this.apiClient.get(e,{headers:{Prefer:"odata.maxpagesize=".concat(this.pageSize,",odata.include-annotations=*"),"OData-MaxVersion":"4.0","OData-Version":"4.0",accept:"application/json"}})];case 1:return a=u.sent(),a.ok?[4,a.json()]:[3,3];case 2:return i=u.sent(),t=i.value,this.previousPages.set(this.currentPage+1,i["@odata.nextLink"]),this.allItemsCount=i["@odata.count"],[2,t];case 3:return o=Error.bind,[4,a.text()];case 4:throw new(o.apply(Error,[void 0,u.sent()]))}})})},r}(Qt),Wt=function(){return Wt=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},Wt.apply(this,arguments)},jr=function(s,r,e,a){var i=arguments.length,t=i<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,e):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(s,r,e,a);else for(var u=s.length-1;u>=0;u--)(o=s[u])&&(t=(i<3?o(t):i>3?o(r,e,t):o(r,e))||t);return i>3&&t&&Object.defineProperty(r,e,t),t},J=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},K=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}};(function(){function s(r,e){e===void 0&&(e=!0);var a=this;this.config=r,this.usePopup=e,this.resourceTokenMap=new Map,this.resourceScopeMap=new Map,this.cacheService=new We,this.getCodeFromLoginWindow=function(i,t){try{var o=new URLSearchParams(i==null?void 0:i.location.search),u=o.get("code");u?(t(u),i.close()):i&&setTimeout(function(){return a.getCodeFromLoginWindow(i,t)})}catch{i&&setTimeout(function(){return a.getCodeFromLoginWindow(i,t)},1e3)}},this.config.tenantId=r.tenantId||"common",this.config.redirectUri=r.redirectUri||window.location.origin,this.getCodeVerifier(),this.state=Lt(108)}return s.prototype.getCodeVerifier=function(){this.cacheService.get("msal.codeVerifier")?this.codeVerifier=this.cacheService.get("msal.codeVerifier"):this.codeVerifier=Lt(43)},s.prototype.buildLoginUrl=function(r){var e=new URL("https://login.microsoftonline.com/".concat(this.config.tenantId||"common","/oauth2/v2.0/authorize"));return e.searchParams.append("client_id",this.config.clientId),e.searchParams.append("scope","".concat(r,"/.default openid profile offline_access")),e.searchParams.append("redirect_uri",this.config.redirectUri),e.searchParams.append("client-request-id",Sr()),e.searchParams.append("response_mode","query"),e.searchParams.append("response_type","code"),e.searchParams.append("code_challenge",this.codeVerifier),e.searchParams.append("code_challenge_method","plain"),e.searchParams.append("prompt","select_account"),e.searchParams.append("client_info","1"),e.searchParams.append("nonce","8a9afd0b-47f6-4678-9289-1b1bf5bfa20f"),e.searchParams.append("state",this.state),e.toString()},s.prototype.loginUser=function(r){return J(this,void 0,void 0,function(){var e,a,i,t,o,u,l,n=this;return K(this,function(c){switch(c.label){case 0:return e=this.buildLoginUrl(r),a="",this.usePopup?(i=window.open(e,"login","width=600,height=600"),i?[4,new Promise(function(d,g){return n.getCodeFromLoginWindow(i,function(y){a=y,d()})})]:[3,2]):[3,3];case 1:c.sent(),c.label=2;case 2:return[3,4];case 3:if(t=new URLSearchParams(window.location.search),o=t.get("code"),u=t.get("error"),o)return this.cacheService.remove("msal.codeVerifier"),a=o,l=new URL(window.location.href),l.searchParams.delete("code"),l.searchParams.delete("state"),l.searchParams.delete("error"),l.searchParams.delete("client_info"),l.searchParams.delete("expires_in"),l.searchParams.delete("ext_expires_in"),l.searchParams.delete("session_state"),window.history.replaceState({},"",l.toString()),[2,a];if(u)throw l.searchParams.delete("error"),new Error(u);this.cacheService.set("msal.codeVerifier",this.codeVerifier),window.location.href=e,c.label=4;case 4:return[2,a]}})})},s.prototype.getAccessTokenFromCode=function(r,e){return J(this,void 0,void 0,function(){var a,i,t,o,u;return K(this,function(l){switch(l.label){case 0:return[4,fetch("https://login.microsoftonline.com/".concat(this.config.tenantId||"common","/oauth2/v2.0/token"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams({client_id:this.config.clientId,scope:"".concat(r,"/.default openid profile offline_access"),redirect_uri:this.config.redirectUri,grant_type:"authorization_code",code:e,code_verifier:this.codeVerifier})})];case 1:return a=l.sent(),a.ok?[4,a.json()]:[3,3];case 2:return i=l.sent(),[2,i];case 3:return o=(t=console).log,u=["Unable to get access token from code",a.status,a.statusText],[4,a.text()];case 4:throw o.apply(t,u.concat([l.sent()])),new Error("Unable to get access token from code")}})})},s.prototype.getAccessTokenFromRefreshToken=function(r,e){return J(this,void 0,void 0,function(){var a,i,t,o;return K(this,function(u){switch(u.label){case 0:return[4,fetch("https://login.microsoftonline.com/".concat(this.config.tenantId||"common","/oauth2/v2.0/token"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams({client_id:this.config.clientId,scope:"".concat(r,"/.default openid profile offline_access"),grant_type:"refresh_token",refresh_token:e})})];case 1:return a=u.sent(),a.ok?[4,a.json()]:[3,3];case 2:return i=u.sent(),[2,i];case 3:return u.trys.push([3,5,,7]),[4,a.json()];case 4:return t=u.sent(),t.error_codes&&t.error_codes.length>0&&t.error_codes[0]===700084&&(this.cacheService.remove("msal.".concat(this.config.clientId,".").concat(r,".authResult")),this.resourceTokenMap.has(r)&&this.resourceTokenMap.delete(r)),[2,this.getAuthResult(r)];case 5:return u.sent(),[4,a.text()];case 6:throw o=u.sent(),new Error(o);case 7:return[2]}})})},s.prototype.getAuthResult=function(r){return J(this,void 0,void 0,function(){var e,a;return K(this,function(i){switch(i.label){case 0:if(e=this.cacheService.get("msal.".concat(this.config.clientId,".").concat(r,".authResult")),!e)return[3,2];try{if(Je.isTokenValid(e.access_token))return[2,e]}catch{console.log("Unable to verify token validity")}return e.refresh_token?[4,this.getAccessTokenFromRefreshToken(r,e.refresh_token)]:[3,2];case 1:return e=i.sent(),this.resourceTokenMap.set(r,e.access_token),this.cacheService.set("msal.".concat(this.config.clientId,".").concat(r,".authResult"),e),[2,e];case 2:return[4,this.loginUser(r)];case 3:return a=i.sent(),[4,this.getAccessTokenFromCode(r,a)];case 4:return e=i.sent(),this.cacheService.set("msal.".concat(this.config.clientId,".").concat(r,".authResult"),e),this.resourceTokenMap.set(r,e.access_token),[2,e]}})})},s.prototype.isAuthenticated=function(){return J(this,void 0,void 0,function(){var r,e,a=this;return K(this,function(i){return r=Object.keys(localStorage).find(function(t){return t.startsWith("msal.".concat(a.config.clientId,"."))&&t.endsWith(".authResult")}),r?(e=this.cacheService.get(r),[2,!!(e!=null&&e.id_token)&&Je.isTokenValid(e.id_token)]):[2,!1]})})},s.prototype.logout=function(){return J(this,void 0,void 0,function(){var r,e,a,i;return K(this,function(t){for(this.resourceTokenMap.clear(),r=Object.keys(localStorage),e=0,a=r;e<a.length;e++)i=a[e],i.startsWith("msal.".concat(this.config.clientId,"."))&&this.cacheService.remove(i);return[2]})})},s.prototype.clearCache=function(){return J(this,void 0,void 0,function(){return K(this,function(r){return this.resourceTokenMap.clear(),vr.clearStorageKeys(this.config.clientId),[2]})})},s.prototype.getAccessToken=function(r){return J(this,void 0,void 0,function(){var e,a;return K(this,function(i){switch(i.label){case 0:return e=this.resourceTokenMap.get(r),e&&Je.isTokenValid(e)?[2,e]:[4,this.getAuthResult(r)];case 1:return a=i.sent(),[2,a.access_token]}})})},jr([ze("msal-access-token-{0}")],s.prototype,"getAccessToken",null),s})();var zt=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Jt=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},fe={emptyMask:0,viewListItems:1,addListItems:2,editListItems:3,deleteListItems:4,approveItems:5,openItems:6,viewVersions:7,deleteVersions:8,cancelCheckout:9,managePersonalViews:10,manageLists:12,viewFormPages:13,anonymousSearchAccessList:14,open:17,viewPages:18,addAndCustomizePages:19,applyThemeAndBorder:20,applyStyleSheets:21,viewUsageData:22,createSSCSite:23,manageSubwebs:24,createGroups:25,managePermissions:26,browseDirectories:27,browseUserInfo:28,addDelPrivateWebParts:29,updatePersonalWebParts:30,manageWeb:31,anonymousSearchAccessWebLists:32,useClientIntegration:37,useRemoteAPIs:38,manageAlerts:39,createAlerts:40,editMyUserInfo:41,enumeratePermissions:63,fullMask:65},Nr=function(){function s(r,e){this.spHttpClient=r,this.siteUrl=e}return s.hasPermission=function(r,e){if(e===65)return(r.High&32767)===32767&&r.Low===65535;var a=e-1,i=1;return a>0&&a<32?(i=i<<a,(r.Low&i)!==0):a>=32&&a<64?(i=i<<a-32,(r.High&i)!==0):!1},s.prototype.checkUserPermissions=function(r,e){return zt(this,void 0,void 0,function(){var a,i,t,o,u,l;return Jt(this,function(n){switch(n.label){case 0:return a="".concat(this.siteUrl,"/_api/web").concat(e||"","/getUserEffectivePermissions('").concat(encodeURIComponent("i:0#.f|membership|"+r),"')"),[4,this.spHttpClient.get(a,{headers:{accept:"application/json"}})];case 1:return i=n.sent(),[4,i.json()];case 2:t=n.sent(),o=[];for(u in fe)l=s.hasPermission(t,fe[u]),l&&o.push(u);return[2,o]}})})},s.prototype.checkCurrentUserPermissions=function(r){return zt(this,void 0,void 0,function(){var e,a,i,t,o,u;return Jt(this,function(l){switch(l.label){case 0:return e="".concat(this.siteUrl,"/_api/web/").concat(r,"/EffectiveBasePermission"),[4,this.spHttpClient.get(e,{headers:{accept:"application/json"}})];case 1:return a=l.sent(),[4,a.json()];case 2:i=l.sent(),t=[];for(o in fe)u=s.hasPermission(i,fe[o]),u&&t.push(o);return[2,t]}})})},s}(),de=function(){return de=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},de.apply(this,arguments)},Ar=function(s,r,e,a){var i=arguments.length,t=i<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,e):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(s,r,e,a);else for(var u=s.length-1;u>=0;u--)(o=s[u])&&(t=(i<3?o(t):i>3?o(r,e,t):o(r,e))||t);return i>3&&t&&Object.defineProperty(r,e,t),t},Fr=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Lr=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}};(function(){function s(r,e){this.graphClient=r,this.updatePresence=e,this.key="persona-cache-",this.cacheExpiration=1e3*60*60*4,this.storageService=new We}return s.prototype.getUser=function(r,e){return e===void 0&&(e="48x48"),Fr(this,void 0,void 0,function(){var a,i,t,y,o,u,l,n,c,d,x,g,y,v,S,x,S;return Lr(this,function(C){switch(C.label){case 0:return a=r,r&&r.indexOf("@")>-1?(i="/users/".concat(r,"?$select=id"),[4,this.graphClient.get(i)]):[3,3];case 1:return t=C.sent(),t.status===404?[2,null]:[4,t.json()];case 2:y=C.sent(),a=y.id,C.label=3;case 3:return o=this.storageService.get(this.key+r),u=o==null?void 0:o.data,l=a?"/users/".concat(a):"/me",!u||o.expiration<new Date().getTime()?[4,Promise.all([this.graphClient.get(l+"?$select=id,displayName,mail,jobTitle,department,officeLocation,mobilePhone,businessPhones,userPrincipalName,usageLocation"),this.graphClient.get(l+"/photos/".concat(e,"/$value")),this.graphClient.get(l+"/presence")])]:[3,6];case 4:return n=C.sent(),c=n[0],d=n[1],x=n[2],[4,Promise.all([c.json(),d.text(),x.json()])];case 5:return g=C.sent(),y=g[0],v=g[1],S=g[2],u=de(de({},y),{photo:"data:image/png;base64,".concat(v.replace('"',"").replace('"',"")),presence:S}),this.storageService.set(this.key+r,{data:u,expiration:new Date().getTime()+this.cacheExpiration}),[3,9];case 6:return this.updatePresence?[4,this.graphClient.get(l+"/presence")]:[3,9];case 7:return x=C.sent(),[4,x.json()];case 8:S=C.sent(),u=de(de({},u),{presence:S}),this.storageService.set(this.key+r,{data:u,expiration:new Date().getTime()+this.cacheExpiration}),C.label=9;case 9:return[2,u]}})})},Ar([ze("getUser-{0}")],s.prototype,"getUser",null),s})();var Kt=function(s,r,e,a){function i(t){return t instanceof e?t:new e(function(o){o(t)})}return new(e||(e=Promise))(function(t,o){function u(c){try{n(a.next(c))}catch(d){o(d)}}function l(c){try{n(a.throw(c))}catch(d){o(d)}}function n(c){c.done?t(c.value):i(c.value).then(u,l)}n((a=a.apply(s,r||[])).next())})},Yt=function(s,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(n){return function(c){return l([n,c])}}function l(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(s,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},$r=function(){function s(r,e){this.searchClient=r,this.managedProperties=e,this.comparers=[":","=","<",">","<=",">="],this.queryTemplate=""}return s.prototype.getSuggestions=function(r){var e;return Kt(this,void 0,void 0,function(){var a,i,t,o,l,u,l,n,c,d,g,y,v;return Yt(this,function(x){switch(x.label){case 0:return a=r.split(" "),i=a[a.length-1],t=this.comparers.find(function(S){return i.indexOf(S)>0}),o=!0,t&&(l=i.split(t),i=l[l.length-1],o=!1),o?(u=this.managedProperties.filter(function(S){return S.toLocaleLowerCase().indexOf(i.toLowerCase())>=0}),[2,{value:u,areSuggestionsProps:!0}]):[3,1];case 1:return i=a[a.length-1],this.searchClient.pageSize=10,l=i.split(t),n=l[0],this.searchClient.selectFields=[n],this.searchClient.setRefiners([{field:"ManagedProperties",size:1,bucketDefinition:{sortBy:"count",isDescending:!0,minimumCount:1e3}}]),this.searchClient.setQuery(r+"*"),[4,this.searchClient.getData()];case 2:if(c=x.sent(),d=(e=c[0])===null||e===void 0?void 0:e.fields,d){g=n;for(y in d)y.toLocaleLowerCase()===n.toLocaleLowerCase()&&(g=y);return v=c.map(function(S){return S.fields[g]}),[2,{value:v.filter(function(S,C){return v.indexOf(S)===C}),areSuggestionsProps:!1}]}return[2,{value:[],areSuggestionsProps:!1}]}})})},s}(),qr=function(){function s(r){this.graphClient=r}return s.prototype.withClient=function(r){return this.graphClient=r,this},s.prototype.withManagedPropertiesRelatedQuery=function(r){return this.query=r,this},s.prototype.build=function(){return Kt(this,void 0,void 0,function(){var r,e,a;return Yt(this,function(i){switch(i.label){case 0:return this.searchClient||(this.searchClient=new tt(this.graphClient,["listItem"],["ID"])),this.searchClient.setRefiners([{field:"ManagedProperties",size:1e3,bucketDefinition:{sortBy:"count",isDescending:!0,minimumCount:1}}]),this.searchClient.setQuery(this.query||"*"),this.searchClient.pageSize=1,[4,this.searchClient.getData()];case 1:return i.sent(),r=this.searchClient.currentAggregations.find(function(t){return t.field==="ManagedProperties"}),e=r.buckets.map(function(t){return t.key}),a=new $r(this.searchClient,e),this.query&&(a.queryTemplate="{searchTerms} AND ".concat(this.query)),[2,a]}})})},s}(),Xt=function(){return Xt=Object.assign||function(s){for(var r,e=1,a=arguments.length;e<a;e++){r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},Xt.apply(this,arguments)};const it=b.createContext({graphClient:new oe}),B=()=>b.useContext(it),Ur=s=>{const{authProvider:r}=Ie(),e=()=>{if(s.graphClient)return s.graphClient;if(r)return new wr(new et(r,new oe))},[a,i]=b.useState(e());return b.useEffect(()=>{i(e())},[s.graphClient,r]),a&&h.jsx(it.Provider,{value:{graphClient:a},children:s.children})},at=b.createContext({spClient:new oe,siteUrl:""}),st=()=>b.useContext(at),Br=s=>{const{authProvider:r}=Ie(),e=()=>{if(s.spClient)return s.spClient;if(r){let t=new et(r,new oe);return t.resourceUri=new URL(s.siteUrl).origin,t}},[a,i]=b.useState(e());return b.useEffect(()=>{i(e())},[s.spClient,r]),a&&h.jsx(at.Provider,{value:{spClient:a,siteUrl:s.siteUrl},children:s.children})},ot=b.createContext({dataverseClient:new oe}),Zt=()=>b.useContext(ot),Gr=s=>{const{authProvider:r}=Ie(),e=()=>{if(s.dataverseClient)return s.dataverseClient;if(r){let t=new et(r,new oe);return t.resourceUri=s.dataverseResource,s.autoBatch&&(t=new Pr(t,s.dataverseResource,s.apiPath,500)),t}},[a,i]=b.useState(e());return b.useEffect(()=>{i(e())},[s.dataverseClient,r]),a&&h.jsx(ot.Provider,{value:{dataverseClient:a,dataverseResource:s.dataverseResource},children:s.children})},ct=typeof window>"u"?global:window,ut="@griffel/";function en(s,r){return ct[Symbol.for(ut+s)]||(ct[Symbol.for(ut+s)]=r),ct[Symbol.for(ut+s)]}const lt=en("DEBUG_RESET_CLASSES",{}),Pe=en("DEFINITION_LOOKUP_TABLE",{}),Ce="data-make-styles-bucket",tn="data-priority",ft="data-container",Mr="r",_e=7,V="___",nn="_",rn=process.env.NODE_ENV==="production"?V.length+_e:V.length+_e+nn.length+_e,Qr=0,an=1;function dt(s){for(var r=0,e,a=0,i=s.length;i>=4;++a,i-=4)e=s.charCodeAt(a)&255|(s.charCodeAt(++a)&255)<<8|(s.charCodeAt(++a)&255)<<16|(s.charCodeAt(++a)&255)<<24,e=(e&65535)*1540483477+((e>>>16)*59797<<16),e^=e>>>24,r=(e&65535)*1540483477+((e>>>16)*59797<<16)^(r&65535)*1540483477+((r>>>16)*59797<<16);switch(i){case 3:r^=(s.charCodeAt(a+2)&255)<<16;case 2:r^=(s.charCodeAt(a+1)&255)<<8;case 1:r^=s.charCodeAt(a)&255,r=(r&65535)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,r=(r&65535)*1540483477+((r>>>16)*59797<<16),((r^r>>>15)>>>0).toString(36)}function ht(s){const r=s.length;if(r===_e)return s;for(let e=r;e<_e;e++)s+="0";return s}function sn(s,r,e=[]){return process.env.NODE_ENV==="production"?V+ht(dt(s+r)):V+ht(dt(s+r))+nn+ht(dt(e.join("")))}function on(s,r){let e="",a="";for(const i in s){const t=s[i];if(t===0){a+=i+" ";continue}const o=Array.isArray(t),u=r==="rtl"?(o?t[1]:t)+" ":(o?t[0]:t)+" ";e+=u,a+=u}return[e.slice(0,-1),a.slice(0,-1)]}function cn(s,r){const e={};for(const a in s){const[i,t]=on(s[a],r);if(t===""){e[a]="";continue}const o=sn(t,r),u=o+(i===""?"":" "+i);Pe[o]=[s[a],r],e[a]=u}return e}const Ne={};function un(){let s=null,r="",e="";const a=new Array(arguments.length);let i="";for(let g=0;g<arguments.length;g++){const y=arguments[g];if(typeof y=="string"&&y!==""){const v=y.indexOf(V);if(v===-1)process.env.NODE_ENV!=="production"&&y.split(" ").forEach(x=>{x.startsWith(Mr)&<[x]&&(i?console.error(`mergeClasses(): a passed string contains multiple classes produced by makeResetStyles (${y} & ${r}, this will lead to non-deterministic behavior. Learn more:https://griffel.js.org/react/api/make-reset-styles#limitations
|
|
49
|
+
Source string: ${y}`):i=x)}),r+=y+" ";else{const x=y.substr(v,rn);v>0&&(r+=y.slice(0,v)),e+=x,a[g]=x}process.env.NODE_ENV!=="production"&&y.indexOf(V,v+1)!==-1&&console.error(`mergeClasses(): a passed string contains multiple identifiers of atomic classes (classes that start with "${V}"), it's possible that passed classes were concatenated in a wrong way. Source string: ${y}`)}}if(e==="")return r.slice(0,-1);const t=Ne[e];if(t!==void 0)return r+t;const o=[];for(let g=0;g<arguments.length;g++){const y=a[g];if(y){const v=Pe[y];v?(o.push(v[Qr]),process.env.NODE_ENV!=="production"&&s!==null&&s!==v[an]&&console.error(`mergeClasses(): a passed string contains an identifier (${y}) that has different direction (dir="${v[1]?"rtl":"ltr"}") setting than other classes. This is not supported. Source string: ${arguments[g]}`),s=v[an]):process.env.NODE_ENV!=="production"&&console.error(`mergeClasses(): a passed string contains an identifier (${y}) that does not match any entry in cache. Source string: ${arguments[g]}`)}}const u=Object.assign.apply(Object,[{}].concat(o)),[l,n]=on(u,s),c=sn(n,s,a),d=c+" "+l;return Ne[e]=d,Pe[c]=[u,s],r+d}const ln={},fn=new Set,he={getChildrenSequences:s=>{const r=Object.keys(Ne).find(e=>Ne[e].startsWith(s));return r?r.split(V).filter(e=>e.length).map(e=>V+e):[]},addCSSRule:s=>{fn.add(s)},addSequenceDetails:(s,r)=>{Object.entries(s).forEach(([e,a])=>{ln[a.substring(0,rn)]={slotName:e,sourceURL:r}})},getCSSRules:()=>Array.from(fn),getSequenceDetails:s=>ln[s]};function dn(s,r){return Array.isArray(s)?r==="rtl"?s[1]:s[0]:s||""}function Vr(s,r,e,a){const i=s[0],t=s[1];return Object.entries(i).map(([o,u])=>{const l=dn(u,t);let n;if(e&&r){const c=e.find(({className:d})=>d===l);!c&&r[0][o]?n=dn(r[0][o],r[1]):c&&r[0][o]?n=(a?a.filter(({debugClassNames:g})=>g.filter(({className:y})=>y===l).length>0).length>0:!1)?c.className:c.overriddenBy:(!c&&!r[0][o]||c&&!r[0][o])&&(n=void 0)}return{className:l,overriddenBy:n}})}function hn(s,r){const e=Pe[s];if(e===void 0)return;const a=r?Pe[r.sequenceHash]:void 0,i=Vr(e,a,r==null?void 0:r.debugClassNames,r==null?void 0:r.children),t={sequenceHash:s,direction:e[1],children:[],debugClassNames:i};return he.getChildrenSequences(t.sequenceHash).reverse().forEach(u=>{const l=hn(u,t);l&&t.children.push(l)}),t.children.length||(t.rules={},t.debugClassNames.forEach(({className:u})=>{const l=he.getSequenceDetails(s);l&&(t.slot=l.slotName,t.sourceURL=l.sourceURL);const n=he.getCSSRules().find(c=>c.includes(u));t.rules[u]=n})),t}function Hr(s){if(lt[s]===void 0)return;const a={sequenceHash:s,direction:"ltr",children:[],debugClassNames:[{className:s}]};a.rules={},a.slot="makeResetStyles()";const[{className:i}]=a.debugClassNames,t=he.getCSSRules().filter(o=>o.includes(`.${i}`));return a.rules[i]=t.join(""),a}function Wr(s,r){const e=s?hn(s):void 0,a=r?Hr(r):void 0;return!e&&!a?void 0:e?a?{sequenceHash:e.sequenceHash+a.sequenceHash,direction:e.direction,children:[e,a],debugClassNames:[...e.debugClassNames,...a.debugClassNames]}:e:a}function zr(s){const r=s.defaultView;if(!r||r.__GRIFFEL_DEVTOOLS__)return;const e={getInfo:a=>{let i,t;for(const o of a.classList)o.startsWith(V)&&(i=o),lt[o]&&(t=o);return Wr(i,t)}};Object.defineProperty(r,"__GRIFFEL_DEVTOOLS__",{configurable:!1,enumerable:!1,get(){return e}})}const Ae=(()=>{var s;try{return!!(typeof window<"u"&&(!((s=window.sessionStorage)===null||s===void 0)&&s.getItem("__GRIFFEL_DEVTOOLS__")))}catch{return!1}})(),gt="<unknown>";function Jr(s){return Zr(s)||ni(s)||ii(s)}const Kr=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)?\)?\s*$/i,Yr=/^\s*at ()((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)\s*$/i,Xr=/\((\S*)\)/;function Zr(s){const r=Kr.exec(s)||Yr.exec(s);if(!r)return null;let e=r[2];const a=e&&e.indexOf("native")===0,i=e&&e.indexOf("eval")===0,t=Xr.exec(e);return i&&t!==null&&(e=t[1]),{loc:a?null:r[2],name:r[1]||gt}}const ei=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)\s*$/i,ti=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ni(s){const r=ei.exec(s);if(!r)return null;let e=r[3];const a=e&&e.indexOf(" > eval")>-1,i=ti.exec(e);return a&&i!==null&&(e=i[1]),{loc:r[3],name:r[1]||gt}}const ri=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?)\s*$/i;function ii(s){const r=ri.exec(s);return r?{loc:r[3],name:r[1]||gt}:null}function ai(){const s=String(new Error().stack).split(`
|
|
50
|
+
`),r=si(s);if(r===void 0)return;const e=Jr(r);return e==null?void 0:e.loc}function si(s){for(let r=s.length-1;r>=0;--r)if(s[r].includes("at getSourceURLfromError"))return s[r+3]}function oi(s){if(!Array.isArray(s))return[s];if(process.env.NODE_ENV!=="production"&&s.length>2)throw new Error("CSS Bucket contains an entry with greater than 2 items, please report this to https://github.com/microsoft/griffel/issues");return s}function ci(s,r,e,a){const i=[];if(a[Ce]=r,a[tn]=String(e),s)for(const o in a)s.setAttribute(o,a[o]);function t(o){return s!=null&&s.sheet?s.sheet.insertRule(o,s.sheet.cssRules.length):i.push(o)}return{elementAttributes:a,insertRule:t,element:s,bucketName:r,cssRules(){return s!=null&&s.sheet?Array.from(s.sheet.cssRules).map(o=>o.cssText):i}}}const gn=["r","d","l","v","w","f","i","h","a","s","k","t","m","c","x"].reduce((s,r,e)=>(s[r]=e,s),{});function ui(s,r,e){return s==="m"||s==="x"?s+r+e:s+e}function li(s,r,e,a,i={}){var t,o;const u=s==="m",l=s==="x",n=i.m,c=i.x,d=(t=i.p)!==null&&t!==void 0?t:0,g=ui(s,(o=c??n)!==null&&o!==void 0?o:"0",d);if(!a.stylesheets[g]){const y=r&&r.createElement("style"),v=ci(y,s,d,{...a.styleElementAttributes,...u&&{media:n},...l&&{[ft]:c}});a.stylesheets[g]=v,r!=null&&r.head&&y&&r.head.insertBefore(y,di(r,e,s,a,i))}return a.stylesheets[g]}function fi(s,r,e){return s.getAttribute(Ce)===r?r==="m"?e.m===s.media:r==="x"?e.x===s.getAttribute(ft):!0:!1}function di(s,r,e,a,i={}){var t,o,u;const l=gn[e],n=(t=i.m)!==null&&t!==void 0?t:"",c=(o=i.x)!==null&&o!==void 0?o:"",d=(u=i.p)!==null&&u!==void 0?u:0;let g=C=>l-gn[C.getAttribute(Ce)],y=s.head.querySelectorAll(`[${Ce}]`);if(e==="m"||e==="x"){const C=s.head.querySelectorAll(`[${Ce}="${e}"]`);C.length&&(y=C,g=e==="m"?_=>a.compareMediaQueries(n,_.media):_=>{var D;return a.compareContainerQueries(c,(D=_.getAttribute(ft))!==null&&D!==void 0?D:"")})}const v=C=>fi(C,e,i)?d-Number(C.getAttribute(tn)):g(C),x=y.length;let S=x-1;for(;S>=0;){const C=y.item(S);if(v(C)>0)return C.nextSibling;S--}return x>0?y.item(0):r?r.nextSibling:null}const hi=["-moz-placeholder","-moz-focus-inner","-moz-focusring","-ms-input-placeholder","-moz-read-write","-moz-read-only"].join("|"),gi=new RegExp(`:(${hi})`);function yn(s,r){try{s.insertRule(r)}catch(e){process.env.NODE_ENV!=="production"&&!gi.test(r)&&console.error(`There was a problem inserting the following rule: "${r}"`,e)}}let yi=0;const vi=(s,r)=>s<r?-1:s>r?1:0;function pi(s=typeof document>"u"?void 0:document,r={}){const{classNameHashSalt:e,unstable_filterCSSRule:a,insertionPoint:i,styleElementAttributes:t,compareMediaQueries:o=vi,compareContainerQueries:u=o}=r,l={classNameHashSalt:e,insertionCache:{},stylesheets:{},styleElementAttributes:Object.freeze(t),compareMediaQueries:o,compareContainerQueries:u,id:`d${yi++}`,insertCSSRules(n){for(const c in n){const d=n[c];for(let g=0,y=d.length;g<y;g++){const[v,x]=oi(d[g]),S=li(c,s,i||null,l,x);l.insertionCache[v]||(l.insertionCache[v]=c,process.env.NODE_ENV!=="production"&&Ae&&he.addCSSRule(v),a?a(v)&&yn(S,v):yn(S,v))}}}};return s&&process.env.NODE_ENV!=="production"&&Ae&&zr(s),l}const mi=()=>{const s={};return function(e,a){s[e.id]===void 0&&(e.insertCSSRules(a),s[e.id]=!0)}};function bi(s,r,e=mi){const a=e();let i=null,t=null,o;process.env.NODE_ENV!=="production"&&Ae&&(o=ai());function u(l){const{dir:n,renderer:c}=l,d=n==="ltr";d?i===null&&(i=cn(s,n)):t===null&&(t=cn(s,n)),a(c,r);const g=d?i:t;return process.env.NODE_ENV!=="production"&&Ae&&he.addSequenceDetails(g,o),g}return u}function wi(){return typeof window<"u"&&!!(window.document&&window.document.createElement)}const vn=U.useInsertionEffect?U.useInsertionEffect:void 0,xi=()=>{const s={};return function(e,a){if(vn&&wi()){vn(()=>{e.insertCSSRules(a)},[e,a]);return}s[e.id]===void 0&&(e.insertCSSRules(a),s[e.id]=!0)}},Si=U.createContext(pi());function Pi(){return U.useContext(Si)}const Ci=U.createContext("ltr");function _i(){return U.useContext(Ci)}function pn(s,r){const e=bi(s,r,xi);return function(){const i=_i(),t=Pi();return e({dir:i,renderer:t})}}const Ri=pn({root:{mc9l5x:"f1w7gpdv",Bg96gwp:"fez10in"},rtl:{Bz10aip:"f13rod7r"}},{d:[".f1w7gpdv{display:inline;}",".fez10in{line-height:0;}",".f13rod7r{transform:scaleX(-1);}"]}),mn=b.createContext(void 0),ki={};mn.Provider;const Ei=()=>{const s=b.useContext(mn);return s??ki},Ti="fui-Icon",Ii="data-fui-icon",Di=(s,r)=>{const{filled:e,idPrefix:a,title:i,primaryFill:t="currentColor",...o}=s,u={...o,fill:t},l=Ei(),n=!!(r!=null&&r.flipInRtl&&(l==null?void 0:l.textDirection)==="rtl");return i&&(u["aria-label"]=i),!u["aria-label"]&&!u["aria-labelledby"]?u["aria-hidden"]=!0:u.role="img",u[Ii]="",{state:u,isRtlFlip:n}},Oi=(s,r)=>{const e=Ri(),{state:a,isRtlFlip:i}=Di(s,r);return a.className=un(e.root,i&&e.rtl,a.className),a},ji=pn({root:{B8gzw0y:"f1dd5bof"}},{m:[["@media (forced-colors: active){.f1dd5bof{forced-color-adjust:auto;}}",{m:"(forced-colors: active)"}]]}),yt="url(#",bn=(s,r,e)=>{const[a,i,...t]=s;let o=i;if(e&&i){const u={};for(const l in i){const n=i[l];if(typeof n!="string")u[l]=n;else if(l==="id")u[l]=e+n;else{const c=n.indexOf(yt);u[l]=c<0?n:n.slice(0,c+yt.length)+e+n.slice(c+yt.length)}}o=u}return b.createElement(a,{...o,key:r},...t.map((u,l)=>bn(u,l,e)))},Ni=s=>s==="1em"?"20":s,wn=(s,r,e)=>typeof s!="string"&&(r!=null&&r.color||Array.isArray(s[0]))?s.map((a,i)=>bn(a,i,e)):void 0,Ai=()=>{},Fi=(s,r)=>{const e=wn(s,r);return e?function(i){return b.useMemo(()=>i?wn(s,r,i):e,[i])}:Ai},Li=(s,r,e)=>typeof r=="string"?b.createElement("svg",{...s,dangerouslySetInnerHTML:{__html:r}}):e?b.createElement("svg",s,...e):b.createElement("svg",s,...r.map(a=>b.createElement("path",{d:a,fill:s.fill}))),Y=(s,r,e,a)=>{const i=Ni(r),t=Fi(e,a),o=b.forwardRef((u,l)=>{const n=ji(),c=Oi(u,{flipInRtl:a==null?void 0:a.flipInRtl}),d=t(u.idPrefix),g={...c,className:un(Ti,c.className,n.root),ref:l,width:r,height:r,viewBox:`0 0 ${i} ${i}`,xmlns:"http://www.w3.org/2000/svg"};return Li(g,e,d)});return o.displayName=s,o},$i=Y("SendRegular","1em",["M2.18 2.11a.5.5 0 0 1 .54-.06l15 7.5a.5.5 0 0 1 0 .9l-15 7.5a.5.5 0 0 1-.7-.58L3.98 10 2.02 2.63a.5.5 0 0 1 .16-.52Zm2.7 8.39-1.61 6.06L16.38 10 3.27 3.44 4.88 9.5h6.62a.5.5 0 1 1 0 1H4.88Z"],{flipInRtl:!0}),qi=Y("FilterRegular","1em",["M7.5 13h5a.5.5 0 0 1 .09 1H7.5a.5.5 0 0 1-.09-1h5.09-5Zm-2-4h9a.5.5 0 0 1 .09 1H5.5a.5.5 0 0 1-.09-1h9.09-9Zm-2-4h13a.5.5 0 0 1 .09 1H3.5a.5.5 0 0 1-.09-1H16.5h-13Z"]),Ui=Y("DismissRegular","1em",["m4.09 4.22.06-.07a.5.5 0 0 1 .63-.06l.07.06L10 9.29l5.15-5.14a.5.5 0 0 1 .63-.06l.07.06c.18.17.2.44.06.63l-.06.07L10.71 10l5.14 5.15c.18.17.2.44.06.63l-.06.07a.5.5 0 0 1-.63.06l-.07-.06L10 10.71l-5.15 5.14a.5.5 0 0 1-.63.06l-.07-.06a.5.5 0 0 1-.06-.63l.06-.07L9.29 10 4.15 4.85a.5.5 0 0 1-.06-.63l.06-.07-.06.07Z"]),xn=Y("Search20Regular","20",["M13.73 14.44a6.5 6.5 0 1 1 .7-.7l3.42 3.4a.5.5 0 0 1-.63.77l-.07-.06-3.42-3.41Zm-.71-.71A5.54 5.54 0 0 0 15 9.5a5.5 5.5 0 1 0-1.98 4.23Z"]),Bi=Y("Open16Regular","16",["M4.5 3C3.67 3 3 3.67 3 4.5v7c0 .83.67 1.5 1.5 1.5h7c.83 0 1.5-.67 1.5-1.5V9.27a.5.5 0 0 1 1 0v2.23a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 11.5v-7A2.5 2.5 0 0 1 4.5 2h2.23a.5.5 0 0 1 0 1H4.5Zm4.27-.5c0-.28.22-.5.5-.5h4.23c.28 0 .5.22.5.5v4.23a.5.5 0 0 1-1 0V3.71L9.62 7.08a.5.5 0 1 1-.7-.7L12.29 3H9.27a.5.5 0 0 1-.5-.5Z"]),Gi=Y("ChevronLeft16Regular","16",["M10.35 3.15c.2.2.2.5 0 .7L6.21 8l4.14 4.15a.5.5 0 0 1-.7.7l-4.5-4.5a.5.5 0 0 1 0-.7l4.5-4.5c.2-.2.5-.2.7 0Z"]),Mi=Y("ChevronRight16Regular","16",["M5.65 3.15a.5.5 0 0 0 0 .7L9.79 8l-4.14 4.15a.5.5 0 0 0 .7.7l4.5-4.5a.5.5 0 0 0 0-.7l-4.5-4.5a.5.5 0 0 0-.7 0Z"]),Qi=Y("Dismiss24Regular","24",["m4.4 4.55.07-.08a.75.75 0 0 1 .98-.07l.08.07L12 10.94l6.47-6.47a.75.75 0 1 1 1.06 1.06L13.06 12l6.47 6.47c.27.27.3.68.07.98l-.07.08a.75.75 0 0 1-.98.07l-.08-.07L12 13.06l-6.47 6.47a.75.75 0 0 1-1.06-1.06L10.94 12 4.47 5.53a.75.75 0 0 1-.07-.98l.07-.08-.07.08Z"]),vt=["title","path","description","listItemId","identityListItemId","identityListId","identitySiteCollectionId","identityWebId","lastModifiedTime","viewsLifeTime","viewsRecent","owstaxidmetadataalltagsinfo","driveId","author","authorOwsUser"],Sn="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/xlsx.png",Pn="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/docx.png",Cn="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pptx.png",_n="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/mpp.png",Re="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/photo.png",Vi="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pdf.png",Hi="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/txt.png",Rn="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/email.png",Wi="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/csv.png",zi="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pub.png",Ji="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/accdb.png",pt="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/zip.png",mt="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/genericfile.png",kn="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/code.png",Ki="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/html.png",Yi="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/xml.png",Xi="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/spo.png",ke="https://static2.sharepointonline.com/files/fabric/assets/item-types/32/video.png",$e=class $e{static getFileImageUrl(r){if(!r)return mt;let e=mt;const a=r.split("."),i=a[a.length-1];if(!i)return e;switch(i.toLowerCase()){case"xlsx":e=Sn;break;case"xls":e=Sn;break;case"docx":e=Pn;break;case"doc":e=Pn;break;case"pptx":e=Cn;break;case"ppt":e=Cn;break;case"mppx":e=_n;break;case"mpp":e=_n;break;case"csv":e=Wi;break;case"pdf":e=Vi;break;case"txt":e=Hi;break;case"jpg":e=Re;break;case"msg":e=Rn;break;case"jpeg":e=Re;break;case"png":e=Re;break;case"ico":e=Re;break;case"tiff":e=Re;break;case"eml":e=Rn;break;case"pub":e=zi;break;case"accdb":e=Ji;break;case"zip":e=pt;break;case"7z":e=pt;break;case"tar":e=pt;break;case"js":e=kn;break;case"json":e=kn;break;case"html":e=Ki;break;case"xml":e=Yi;break;case"aspx":e=Xi;break;case"mp4":e=ke;break;case"mov":e=ke;break;case"wmv":e=ke;break;case"ogg":e=ke;break;case"webm":e=ke;break;default:e=mt;break}return e}};$e.getShortName=r=>{if(!r)return"";const e=r.split("."),a=e[0].substring(0,25),i=e[e.length-1];return`${a}...${i}`},$e.isOndrive=async r=>r?r.indexOf("my.sharepoint.com")>-1:!1;let Fe=$e;const re=class re{};re.getThumbnailUrl=(r,e="medium")=>`https://graph.microsoft.com/v1.0/sites/${r.identitySiteCollectionId}/sites/${r.identityWebId}/lists/${r.identityListId}/items/${r.listItemId}/microsoft.graph.listitem/driveItem/thumbnails/0/${e}/content`,re.getThumbnailImageFromGraphApiCall=async(r,e)=>{const a=await r.get(e);if(a.headers["content-type"]==="application/json")return"data:image/png;base64,"+(await a.text()).replace('"',"").replace('"',"");if(a.status===302)return a.headers.Location;if(a.status===404)return"";const i=await a.arrayBuffer();return`data:image/jpeg;base64,${Buffer.from(new Uint8Array(i).reduce((o,u)=>o+String.fromCharCode(u),"")).toString("base64")}`},re.getThumbnailImageFromGraph=async(r,e,a="medium")=>{const i=re.getThumbnailUrl(r,a);return await re.getThumbnailImageFromGraphApiCall(e,i)};let bt=re;function Zi(s){let r=0;for(let e=0;e<s.length;e++){const a=s.charCodeAt(e);r=(r<<5)-r+a,r|=0}return r}const ea=m.makeStyles({title:{...m.shorthands.margin(0,0,"12px")},description:{...m.shorthands.margin(0,0,"12px")},card:{width:"20rem",maxWidth:"100%",height:"fit-content"},image:{width:"20rem",height:"7rem"},text:{...m.shorthands.margin(0)},imageIconWrapper:{width:"20rem!important",height:"7rem!important",display:"flex!important",justifyContent:"center",alignItems:"center",backgroundColor:m.tokens.colorNeutralBackground3}}),En=s=>{const{graphClient:r}=B(),e=ea(),[a,i]=b.useState(void 0);return b.useEffect(()=>{bt.getThumbnailImageFromGraph(s.document.fields,r).then(t=>{i(t)}).catch(t=>{console.error(t)})},[]),h.jsxs(m.Card,{className:e.card,children:[h.jsx(m.CardPreview,{children:a?h.jsx("img",{src:a,alt:s.document.fields.title,className:e.image}):h.jsx("div",{className:e.imageIconWrapper,children:h.jsx("div",{children:h.jsx("img",{src:Fe.getFileImageUrl(s.document.fields.path),width:"32px",height:"32px",alt:s.document.fields.title})})})}),h.jsx(m.CardHeader,{image:h.jsx("img",{src:Fe.getFileImageUrl(s.document.fields.path),width:"32px",height:"32px",alt:s.document.fields.title}),header:h.jsx(m.Body1,{children:h.jsx("b",{children:s.document.fields.title})}),description:h.jsx(m.Caption1,{children:s.document.fields.author}),action:h.jsx(m.Button,{appearance:"transparent","aria-label":"More options"})}),h.jsx("p",{className:e.text,children:s.document.fields.description}),h.jsx(m.CardFooter,{children:h.jsx(m.Button,{as:"a",href:s.document.fields.path,appearance:"primary",icon:h.jsx(Bi,{}),children:"Open"})})]})},ta=m.makeStyles({wrapper:{},searchInput:{},searchResults:{display:"flex",flexWrap:"wrap",flexDirection:"row",...m.shorthands.gap(m.tokens.spacingHorizontalL,m.tokens.spacingVerticalL)}}),na=s=>{var y;const{graphClient:r}=B(),e=ta(),a=b.useMemo(()=>{var x,S,C,_,D,F,A;var v=new tt(r,[((x=s.dataProviderProps)==null?void 0:x.entityType)??"listItem"],((S=s.dataProviderProps)==null?void 0:S.selectFields)||vt);return v.queryTemplate=(C=s.dataProviderProps)==null?void 0:C.queryTemplate,v.pageSize=(_=s.dataProviderProps)==null?void 0:_.pageSize,(D=s.dataProviderProps)!=null&&D.aggregations&&v.setRefiners((F=s.dataProviderProps)==null?void 0:F.aggregations),v.setQuery(((A=s.dataProviderProps)==null?void 0:A.initialQuery)??""),v},[r,s.dataProviderProps]),[i,t]=b.useState(!0),[o,u]=b.useState(((y=s.dataProviderProps)==null?void 0:y.initialQuery)??""),[l,n]=b.useState([]),[c,d]=b.useState(void 0);b.useEffect(()=>{a.setQuery(o),t(!0),a.getData().then(v=>{n(v),d(void 0)}).catch(v=>{d(v.message)}).finally(()=>{t(!1)})},[o]);const g=()=>s!=null&&s.searchInputComponent?h.jsx(s.searchInputComponent,{onSearch:v=>{u(v)}}):h.jsx(m.Input,{contentBefore:h.jsx(xn,{}),placeholder:"Search",value:o,onChange:v=>{u(v.target.value)}});return h.jsxs("div",{children:[h.jsx("div",{children:g()}),h.jsxs("div",{children:[i&&h.jsx(m.Spinner,{label:"Loading..."}),!i&&c&&h.jsxs("div",{children:["Error: ",c]})]}),h.jsx("div",{className:e.searchResults,children:l.map((v,x)=>h.jsx("div",{children:s!=null&&s.onResultRendering?s.onResultRendering(v):h.jsx(En,{document:v})},x))})]})},ra=m.makeStyles({wrapper:{},searchInput:{},searchResults:{display:"flex",flexWrap:"wrap",flexDirection:"row",...m.shorthands.gap(m.tokens.spacingHorizontalL,m.tokens.spacingVerticalL)}}),ia=s=>{var y;const{graphClient:r}=B(),e=ra(),a=b.useMemo(()=>{var x,S;var v=new Ir(r,"sharePoint",((x=s.dataProviderProps)==null?void 0:x.selectFields)||vt,(S=s.dataProviderProps)==null?void 0:S.queryTemplate);return v},[r,s.dataProviderProps]),[i,t]=b.useState(!0),[o,u]=b.useState(((y=s.dataProviderProps)==null?void 0:y.initialQuery)??""),[l,n]=b.useState([]),[c,d]=b.useState(void 0);b.useEffect(()=>{Xe.debounce("copilot-search",async()=>{t(!0),a.getData(o).then(v=>{n(v),d(void 0)}).catch(v=>{d(v.message)}).finally(()=>{t(!1)})},1e3)},[o]);const g=()=>s!=null&&s.searchInputComponent?h.jsx(s.searchInputComponent,{onSearch:v=>{u(v)}}):h.jsx(m.Input,{style:{width:"500px"},contentBefore:h.jsx(xn,{}),placeholder:"Search",value:o,onChange:v=>{u(v.target.value)}});return h.jsxs("div",{children:[h.jsx("div",{children:g()}),h.jsxs("div",{children:[i&&h.jsx(m.Spinner,{label:"Loading..."}),!i&&c&&h.jsxs("div",{children:["Error: ",c]})]}),h.jsx("div",{className:e.searchResults,children:l.map((v,x)=>h.jsx("div",{children:s!=null&&s.onResultRendering?s.onResultRendering(v):h.jsx(En,{document:{fields:v.resourceMetadata,...v}})},x))})]})},aa=m.makeStyles({root:{paddingBottom:m.tokens.spacingVerticalM,position:"relative"},searchInput:{minWidth:"800px"},suggestionsSurface:{position:"absolute",top:"100%",marginTop:"0rem",zIndex:2,backgroundColor:m.tokens.colorNeutralBackgroundAlpha2,width:"800px",transform:"scaleY(0)",transformOrigin:"top",transitionProperty:"all",transitionTimingFunction:m.tokens.curveDecelerateMid,transitionDuration:m.tokens.durationSlow},suggestionsSurfaceVisible:{transform:"scaleY(1)"},suggestionsWrapper:{display:"flex",flexDirection:"column",rowGap:m.tokens.spacingVerticalM,maxHeight:"15rem",overflowY:"auto",alignItems:"flex-start"},suggestionsList:{listStyleType:"none",paddingLeft:"0px"},suggestionButton:{"&:focus":{...m.shorthands.borderColor(m.tokens.colorBrandBackground)}}}),sa=[":","=","<",">","<=",">="];function oa(s){const r=aa(),{graphClient:e}=B(),[a,i]=b.useState(!1),[t,o]=b.useState([]),[u,l]=b.useState(!0),[n,c]=b.useState(""),[d,g]=b.useState(!0),[y,v]=b.useState(),x=b.useRef(),S=b.useRef(),C=b.useRef(new qr(e));return b.useEffect(()=>{s.query&&C.current.withManagedPropertiesRelatedQuery(s.query),C.current.build().then(_=>{v(_),g(!1)})},[]),h.jsxs("div",{className:r.root,children:[h.jsx(m.Input,{ref:x,className:r.searchInput,contentAfter:d?h.jsx(m.Spinner,{size:"tiny"}):h.jsx(m.Button,{appearance:"transparent",title:"Search",onClick:()=>{s.onSearch(n)},icon:h.jsx($i,{})}),value:n,onChange:(_,D)=>{c(D.value),Xe.debounce("search-input",async()=>{g(!0);const F=await y.getSuggestions(D.value);o(F.value),l(F.areSuggestionsProps),F.value&&F.value.length>0&&i(!0),g(!1)},500)},onKeyDown:_=>{var D;if(_.key==="Enter"&&s.onSearch(n),_.key==="ArrowDown"){const F=(D=S.current)==null?void 0:D.firstChild;if(F){const A=F.firstChild;if(A){A.focus(),_.preventDefault();return}}}_.key==="Escape"&&i(!1)}}),h.jsxs("div",{className:m.mergeClasses(r.suggestionsSurface,a&&r.suggestionsSurfaceVisible),onBlur:()=>{},children:[h.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:h.jsx(m.Button,{tabIndex:-1,appearance:"subtle",onClick:()=>{i(!1)},title:"Close",icon:h.jsx(Ui,{})})}),h.jsx("div",{className:r.suggestionsWrapper,children:h.jsxs("ul",{className:r.suggestionsList,ref:S,onKeyDown:_=>{var G;const D=S==null?void 0:S.current.querySelectorAll("button"),F=_.target;let A=null;if(D.forEach((Z,H)=>{Z===F&&(A=H)}),_.key==="ArrowUp")if(A===0){(G=x.current)==null||G.focus(),_.preventDefault();return}else{D.item(A-1).focus(),_.preventDefault();return}if(_.key==="ArrowDown")if(A===D.length-1){D.item(0).focus(),_.preventDefault();return}else{D.item(A+1).focus(),_.preventDefault();return}},children:[u&&t.map(_=>h.jsx("li",{children:h.jsx(m.Button,{className:r.suggestionButton,appearance:"transparent",onClick:()=>{var G;const D=n.split(u?" ":":"),F=D[D.length-1],A=n.replace(F,_+":");c(A),i(!1),l(!1),(G=x.current)==null||G.focus()},children:_},_)})),!u&&t.map((_,D)=>h.jsx("li",{children:h.jsx(m.Button,{className:r.suggestionButton,appearance:"transparent",onClick:()=>{var H;const F=n.split(" ");let A=F[F.length-1],G=sa.find(k=>A.indexOf(k)>0);G&&(A=A.split(G)[1]);const Z=n.replace(A,_.replace(/ /g,"+"));c(Z),i(!1),l(!0),(H=x.current)==null||H.focus(),s.onSearch(Z)},children:_},D)}))]})})]})]})}var ca=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,la=(s,r,e,a)=>{for(var i=a>1?void 0:a?ua(r,e):r,t=s.length-1,o;t>=0;t--)(o=s[t])&&(i=(a?o(r,e,i):o(i))||i);return a&&i&&ca(r,e,i),i};class wt{constructor(r,e){this.graphClient=r,this.updatePresence=e,this.key="persona-cache-",this.cacheExpiration=1e3*60*60*4,this.storageService=new We}async getUser(r,e="48x48"){let a=r;if(r&&r.indexOf("@")>-1){const u=`/users/${r}?$select=id`,l=await this.graphClient.get(u);if(l.status===404)return null;a=(await l.json()).id}let i=this.storageService.get(this.key+r),t=i==null?void 0:i.data;const o=a?`/users/${a}`:"/me";if(!t||i.expiration<new Date().getTime()){const[u,l,n]=await Promise.all([this.graphClient.get(o+"?$select=id,displayName,mail,jobTitle,department,officeLocation,mobilePhone,businessPhones,userPrincipalName,usageLocation"),this.graphClient.get(o+`/photos/${e}/$value`),this.graphClient.get(o+"/presence")]),[c,d,g]=await Promise.all([u.json(),l.text(),n.json()]);t={...c,photo:`data:image/png;base64,${d.replace('"',"").replace('"',"")}`,presence:g},this.storageService.set(this.key+r,{data:t,expiration:new Date().getTime()+this.cacheExpiration})}else if(this.updatePresence){const l=await(await this.graphClient.get(o+"/presence")).json();t={...t,presence:l},this.storageService.set(this.key+r,{data:t,expiration:new Date().getTime()+this.cacheExpiration})}return t}}la([ze("getUser-{0}")],wt.prototype,"getUser",1);function Le(s){var d,g,y,v,x;const{id:r}=s;let e=s.graphClient;const a=S=>{switch(S){case"":return"offline";case"Available":return"available";case"Busy":return"busy";case"Away":return"away";case"DoNotDisturb":return"do-not-disturb";case"Offline":return"offline";case"PresenceUnknown":return"unknown";case"OutOfOffice":return"out-of-office";case"Blocked":return"blocked";case"BeRightBack":return"away";case"BusyIdle":return"busy";case"AvailableIdle":return"available";default:return S==null?void 0:S.toLowerCase()}},i=b.useRef(new wt(e,s.showPresence)),[t,o]=b.useState(!s.user),[u,l]=b.useState(s.user),n=async()=>{const S=await i.current.getUser(r);l({...s.user,...S}),o(!1)};if(b.useEffect(()=>{s.user||n()},[r]),t)return h.jsx(m.Spinner,{});const c=(u==null?void 0:u.displayName)||s.name||s.title||s.id;return h.jsx(m.Persona,{primaryText:c,secondaryText:u==null?void 0:u.jobTitle,avatar:{image:{src:u==null?void 0:u.photo},initials:((d=u==null?void 0:u.displayName)==null?void 0:d.split(" ").map(S=>S[0]).join(""))||((g=s.name)==null?void 0:g.split(" ").map(S=>S[0]).join(""))},presence:s.showPresence?{status:a((y=u==null?void 0:u.presence)==null?void 0:y.availability),outOfOffice:(x=(v=u==null?void 0:u.presence)==null?void 0:v.outOfOfficeSettings)==null?void 0:x.isOutOfOffice}:void 0,...s})}function fa(s){const{graphClient:r}=B();return h.jsx(Le,{...s,graphClient:r})}function X(s){const[r,e]=b.useState(s.value||[]),[a,i]=b.useState(!1),[t,o]=b.useState(""),[u,l]=b.useState(s.value||[]),n=c=>Xe.debounce(`entityPicker-${s.additionalKey}`,async()=>{i(!0);try{const d=await s.onDataRequested(c);e([...d,...u].reduce((g,y)=>g.find(x=>x.id===y.id)?g:g.concat([y]),[])),i(!1)}catch(d){console.error(d),i(!1)}},500);return b.useEffect(()=>{n(t)},[t,s.additionalKey]),s.renderOverride?h.jsx(h.Fragment,{children:s.renderOverride(r,a,n)}):h.jsxs(m.Field,{label:s.label,hint:s.description,children:[h.jsx(m.Combobox,{value:t,multiselect:s.multiSelect,freeform:!0,onChange:c=>{o(c.target.value)},size:s.size,disabled:s.disabled,onOptionSelect:(c,d)=>{let g=[];const y=r.find(v=>v.id===d.optionValue);u.some(v=>v.id===d.optionValue)?g=u.filter(v=>v.id!==d.optionValue):s.multiSelect?g=[...u,y]:g=[y],g=g.filter(v=>!!v),s.onEntitySelected&&s.onEntitySelected(g),l(g),o(g.map(v=>v.displayName).join(", "))},defaultSelectedOptions:u.map(c=>c.id),children:r.map(c=>h.jsx(m.Option,{text:c.displayName,value:c.id,children:s.onSuggestionRendering?s.onSuggestionRendering(c):c.displayName},encodeURIComponent(c.id)))}),a&&h.jsx(m.ProgressBar,{})]})}function da(s){const{graphClient:r}=B();return h.jsx(Tn,{...s,graphClient:r})}function Tn(s){const r=async()=>(await(await s.graphClient.get(`/teams/${s.teamId}/channels?$select=id,displayName`)).json()).value;b.useEffect(()=>{r()},[s.teamId]);const e=async a=>await r();return h.jsx(X,{additionalKey:`team-${s.teamId}-channels`,...s,onDataRequested:e})}function ha(s){const{graphClient:r}=B();return h.jsx(In,{...s,graphClient:r,siteId:s.siteId})}function In(s){const r=async e=>{let a=s.siteId?`/sites/${s.siteId}/drives?$select=id,name`:"/me/drives?$select=id,name";return e&&(a+=`&$filter=startswith(name, '${e}')`),(await(await s.graphClient.get(a)).json()).value.map(o=>({id:o.id,displayName:o.name}))};return h.jsx(X,{additionalKey:`drive-picker-${s.siteId}`,...s,onDataRequested:r})}function ga(s){const{graphClient:r}=B();return h.jsx(Dn,{...s,graphClient:r})}function Dn(s){const r=async e=>{let a="/teams?$select=id,displayName&$top=8";return e&&(a+=`&$filter=startswith(displayName, '${e}')`),(await(await s.graphClient.get(a)).json()).value};return h.jsx(X,{additionalKey:"team-site-picker",...s,onDataRequested:r})}function ya(s){const{graphClient:r}=B();return h.jsx(On,{...s,graphClient:r})}function On(s){const r=new kr(s.graphClient,!0,!0),e=async a=>(r.setQuery(a),await r.getData());return h.jsx(X,{...s,additionalKey:"people-picker",onDataRequested:e,onSuggestionRendering:a=>(a.photo&&(a.photo=`data:image/png;base64,${a.photo.replace('"',"").replace('"',"")}`),h.jsx(Le,{showPresence:!0,user:a,graphClient:s.graphClient}))})}function va(s){const{graphClient:r}=B();return h.jsx(jn,{...s,graphClient:r})}function jn(s){const r=b.useRef(new tt(s.graphClient,["site"],["id","displayName"])),e=async a=>(r.current.setQuery(a||"*"),await r.current.getData());return h.jsx(X,{...s,onDataRequested:e})}function Nn(s){const[r,e]=b.useState(s.initialRender),[a,i]=b.useState(!0);return b.useEffect(()=>{s.permissionCheck().then(t=>{e(t)}).finally(()=>i(!1))},[]),a&&s.placeholder?h.jsx(h.Fragment,{children:s.placeholder}):r?h.jsx(h.Fragment,{children:s.children}):h.jsx(h.Fragment,{})}function pa(s){const{spClient:r,siteUrl:e}=st();return h.jsx(An,{...s,siteUrl:e,spClient:r})}function An(s){return h.jsx(Nn,{placeholder:s.placeholder,permissionCheck:async()=>{var r=`${s.siteUrl}/_api/web/EffectiveBasePermissions`,e=await s.spClient.get(r,{headers:{accept:"application/json"}}),a=await e.json(),i=[];for(var t in fe){var o=Nr.hasPermission(a,fe[t]);o&&i.push(t)}return i.indexOf(s.role)>=0},children:s.children},`${s.role}-${s.siteUrl}`)}function Fn(s){return h.jsx(Nn,{placeholder:s.placeholder,permissionCheck:async()=>{const r=`/me/transitiveMemberOf/${s.groupId}?$select=id`;return(await s.graphClient.get(r)).ok},children:s.children},s.groupId)}function ma(s){const{graphClient:r}=B();return h.jsx(Fn,{...s,graphClient:r})}class Ln{constructor(r,e,a){this.dataverseClient=r,this.dataverseEnv=e,this.tableName=a,this.dataFields=[],this.getFieldSuggestions=async(i,t)=>{if(i.type==="User"){let n=`${this.dataverseEnv}/api/data/v9.0/systemusers?`;if(t&&t.length>0){const g=new He;for(const y of t)y.type||(y.type="Text"),y.name=i.expandFields[0],g.withFieldQuery(y);n+=`$filter=${g.build()}&`}return n+=`$select=${i.expandFields.join(",")}`,(await(await this.dataverseClient.get(n,{headers:{prefer:"odata.include-annotations=*"}})).json()).value.map(g=>({id:g[i.relatedId],displayName:g[i.expandFields[0]]}))}let o=`${this.dataverseEnv}/api/data/v9.0/${this.tableName}?`;if(t&&t.length>0){const n=new He;for(const c of t)c.type||(c.type="Text"),n.withFieldQuery(c,c.joinBy||"And");o+=`$filter=${n.build()}&`}i.type==="Lookup"?o+=`$apply=groupby((${i.name}/${i.relatedId||i.name+"_id"},${i.name}/${i.expandFields[0]}))`:i.type=="DateTime"?o+=`$apply=aggregate(${i.name} with min as ${i.name})`:o+=`$apply=groupby((${i.name}))`;const l=await(await this.dataverseClient.get(o,{headers:{prefer:"odata.include-annotations=*"}})).json();if(i.type==="Lookup"||i.type==="User"){if(l.value.length===0)return[];let n="",c="";const d=l.value[0];for(const g in d)g.indexOf(i.relatedId)>=0&&(n=g),g.indexOf(i.expandFields[0])>=0&&(c=g);return l.value.map(g=>({id:g[n],displayName:g[c]}))}return l.value.map(n=>({id:n[i.name],displayName:n[`${i.name}@OData.Community.Display.V1.FormattedValue`]?n[`${i.name}@OData.Community.Display.V1.FormattedValue`]:n[i.name]}))},this.dataProvider=new Or(r,e,a),this.dataProvider.pageSize=25}getTotalRows(){return this.dataProvider.allItemsCount}mapToExpand(r){return r.expandFields?`${r.name}($select=${r.expandFields.join(",")})`:r.name}setFields(r){this.dataProvider.selectQuery=r.filter(e=>e.type!=="Lookup").map(e=>e.name).join(","),this.dataProvider.expandQuery=r.filter(e=>e.type==="Lookup"||e.type==="User").map(e=>this.mapToExpand(e)).join(","),this.dataFields=r}getData(r,e,a){if(r&&r.length>0){const i=new He;for(const o of r)o.type||(o.type="Text"),i.withFieldQuery(o,o.joinBy||"And");const t=i.build();this.dataProvider.setQuery(t)}else this.dataProvider.setQuery("");if(e){let i=e,t=this.dataFields.find(o=>o.name===i);t&&t.type==="Lookup"?i=`${t.name}/${t.expandFields[0]}`:t&&t.type==="User"&&(i=`${t.name}/fullname`),this.dataProvider.setOrder(i,a||"ASC")}return this.dataProvider.getData()}getNextPage(){return this.dataProvider.getNextPage()}isNextPageAvailable(){return this.dataProvider.isNextPageAvailable()}getPreviousPage(){return this.dataProvider.getPreviousPage()}isPreviousPageAvailable(){return this.dataProvider.isPreviousPageAvailable()}}class xt{isRendererApplicable(r){return r.type==="DateTime"}renderField(r,e,a){if(!e)return h.jsx("span",{children:"-"});const i=new Date(String(e));return isNaN(i.getTime())?h.jsx("span",{children:"-"}):h.jsx("span",{children:i.toLocaleDateString()})}}class ba{constructor(){this.renderers=[new xt]}registerRenderer(r){this.renderers.unshift(r)}isRendererApplicable(r){return!!this.renderers.find(e=>e.isRendererApplicable(r))}renderField(r,e,a){const i=this.renderers.find(t=>t.isRendererApplicable(r));return i?i.renderField(r,e,a):typeof e=="string"?h.jsx("div",{children:e}):h.jsx("div",{children:JSON.stringify(e)})}}const wa=m.makeStyles({root:{display:"flex",justifyContent:"end",gap:m.tokens.spacingHorizontalS},button:{},activeFilterButton:{backgroundColor:m.tokens.colorBrandBackground,color:m.tokens.colorNeutralForegroundOnBrand}});function xa(s){const[r,e]=b.useState(!1),a=wa(),i=s.initialQueryFields&&s.initialQueryFields.length>0;return h.jsxs("div",{className:a.root,children:[i&&s.onClearFilters&&h.jsx(m.Button,{"aria-label":"Clear all filters",appearance:"subtle",onClick:s.onClearFilters,children:"Clear filters"}),h.jsx(m.Button,{"aria-label":"Open filter pane",icon:h.jsx(qi,{}),className:i?a.activeFilterButton:void 0,onClick:()=>{e(!0)}}),h.jsxs(m.Drawer,{type:"overlay",separator:!0,open:r,onOpenChange:(t,{open:o})=>e(o),position:"end",children:[h.jsx(m.DrawerHeader,{children:h.jsx(m.DrawerHeaderTitle,{action:h.jsx(m.Button,{appearance:"subtle","aria-label":"Close",icon:h.jsx(Qi,{}),onClick:()=>e(!1)}),children:"Filter"})}),h.jsx(m.DrawerBody,{children:s.filterFields.map(t=>h.jsx(m.Field,{label:t.label||t.name,children:s.renderFilter(t,s.onFilterSet,s.initialQueryFields)},t.name))}),i&&s.onClearFilters&&h.jsx(m.DrawerFooter,{children:h.jsx(m.Button,{appearance:"secondary",onClick:()=>{var t;(t=s.onClearFilters)==null||t.call(s),e(!1)},children:"Clear all filters"})})]})]})}const Sa=m.makeStyles({root:{position:"relative"},loadingWrapper:{position:"absolute",width:"100%",height:"min-content",paddingTop:m.tokens.spacingVerticalM,paddingBottom:m.tokens.spacingHorizontalM,backgroundColor:m.tokens.colorNeutralBackgroundAlpha,zIndex:9999},errorWrapper:{marginBottom:m.tokens.spacingVerticalM},pagination:{display:"flex",width:"100%",justifyContent:"center",gap:m.tokens.spacingHorizontalL,marginTop:m.tokens.spacingVerticalM}});function St(s){var H;const r=Sa(),e=b.useMemo(()=>{const k=new ba;if(s.customRenderers)for(const O of s.customRenderers)k.registerRenderer(O);return k},[s.customRenderers]),a=b.useMemo(()=>s.fieldsToRender.map(k=>m.createTableColumn({columnId:k.name,renderHeaderCell:()=>h.jsx(m.Text,{weight:"semibold",children:k.label||k.name}),renderCell:O=>e.renderField(k,O[k.name],O),compare:(O,N)=>O[k.name]-N[k.name]})),[s.fieldsToRender]),[i,t]=b.useState({sortColumn:(H=s.fieldsToRender.find(k=>!k.disableSorting))==null?void 0:H.name,sortDirection:"ascending"}),o=(k,O)=>{t(O)},[u,l]=b.useState([]),[n,c]=b.useState(!0),[d,g]=b.useState(null),[y,v]=b.useState([]),[x,S]=b.useState(new Set),C=b.useMemo(()=>s.dataService.isNextPageAvailable(),[s.dataService,u]),_=b.useMemo(()=>s.dataService.isPreviousPageAvailable(),[s.dataService,u]),D=b.useCallback((k,O)=>{if(s.getRowId)return s.getRowId(k);const N=k;return N.id?String(N.id):N.Id?String(N.Id):N.ID?String(N.ID):O},[s.getRowId]),F=b.useMemo(()=>{const k=new Map;return u.forEach((O,N)=>{k.set(D(O,N),O)}),k},[u,D]),A=(k,O)=>{if(S(O.selectedItems),s.onSelectionChange){const N=[];O.selectedItems.forEach(ge=>{const M=F.get(ge);M&&N.push(M)}),s.onSelectionChange(N)}},G=b.useMemo(()=>s.fieldsToRender.filter(k=>!k.disableFiltering),[s.fieldsToRender]),Z=b.useCallback(()=>{v([])},[]);return b.useEffect(()=>{var O;c(!0),g(null),s.dataService.setFields(s.fieldsToRender);const k=[];s.systemFilter&&s.systemFilter.length>0&&k.push(...s.systemFilter),y&&y.length>0&&k.push(...y),s.dataService.getData(k,(O=i==null?void 0:i.sortColumn)==null?void 0:O.toString(),(i==null?void 0:i.sortDirection)=="ascending"?"ASC":"DESC").then(N=>{l(N),s.onDataFetched&&s.onDataFetched([],s.dataService.getTotalRows())}).catch(N=>{g((N==null?void 0:N.message)||"An error occurred while loading data"),l([])}).finally(()=>c(!1))},[s.systemFilter,i,y]),h.jsxs("div",{className:r.root,children:[n&&h.jsx("div",{className:r.loadingWrapper,children:h.jsx(m.Spinner,{size:"huge"})}),d&&h.jsx("div",{className:r.errorWrapper,children:h.jsx(m.MessageBar,{intent:"error",children:h.jsxs(m.MessageBarBody,{children:[h.jsx(m.MessageBarTitle,{children:"Error"}),d]})})}),s.renderFilter&&h.jsx(xa,{filterFields:G,initialQueryFields:y,onFilterSet:(k,O)=>{const N=[...y.filter(ge=>ge.name!==k.name)];O&&O.length>0&&N.push(...O),v(N)},onClearFilters:Z,renderFilter:s.renderFilter}),h.jsxs(m.DataGrid,{items:u,columns:a,sortable:!0,sortState:i,onSortChange:o,selectionMode:s.selectionMode,selectedItems:x,onSelectionChange:A,getRowId:k=>D(k,u.indexOf(k)),children:[h.jsx(m.DataGridHeader,{children:h.jsx(m.DataGridRow,{selectionCell:s.selectionMode==="multiselect"?{checkboxIndicator:{"aria-label":"Select all rows"}}:void 0,children:({renderHeaderCell:k})=>h.jsx(m.DataGridHeaderCell,{children:k()})})}),h.jsx(m.DataGridBody,{children:({item:k,rowId:O})=>h.jsx(m.DataGridRow,{selectionCell:s.selectionMode?{checkboxIndicator:{"aria-label":"Select row"},radioIndicator:{"aria-label":"Select row"}}:void 0,children:({renderCell:N})=>h.jsx(m.DataGridCell,{children:N(k)})},O)})]}),h.jsxs("div",{className:r.pagination,children:[h.jsx(m.Button,{icon:h.jsx(Gi,{}),disabled:!_,onClick:()=>{s.dataService.getPreviousPage().then(k=>l(k)).finally(()=>c(!1))},"aria-label":"Previous page","data-testid":"datagrid-prev-page"}),h.jsx(m.Button,{icon:h.jsx(Mi,{}),disabled:!C,onClick:()=>{s.dataService.getNextPage().then(k=>l(k)).finally(()=>c(!1))},"aria-label":"Next page","data-testid":"datagrid-next-page"})]})]})}class Pa{constructor(r){this.graphClient=r}isRendererApplicable(r){return r.type==="User"}renderField(r,e,a){if(!e||typeof e!="object")return h.jsx("span",{children:"-"});const i=e,t=i.azureactivedirectoryobjectid;if(!t){const o=i.fullname;return h.jsx("span",{children:o?String(o):"-"})}return h.jsx(Le,{graphClient:this.graphClient,id:String(t)})}}class Ca{isRendererApplicable(r){return r.type==="Lookup"}renderField(r,e,a){if(!e||typeof e!="object")return h.jsx("span",{children:"-"});const i=e;if(r.expandFields&&r.expandFields[0]){const t=i[r.expandFields[0]];return h.jsx("span",{children:t!=null?String(t):"-"})}return h.jsx("span",{children:JSON.stringify(e)})}}function _a(s){const r=async e=>{const a=[];return s.additionalFilters&&a.push(...s.additionalFilters),e&&a.push({name:s.column.type==="Lookup"?`${s.column.name}/${s.column.expandFields[0]}`:s.column.name,type:s.column.type,value:e,comparer:"Contains"}),s.getFieldSuggestions(s.column,a)};return h.jsx(X,{additionalKey:`${s.table}-${s.column.name}`,...s,onDataRequested:r})}class Ra{isRendererApplicable(r){return r.type==="Choice"}renderField(r,e,a){return e?h.jsx("span",{children:a[r.name+"@OData.Community.Display.V1.FormattedValue"]}):h.jsx("span",{children:"-"})}}function ka(s){const{dataverseClient:r,dataverseResource:e}=Zt(),{graphClient:a}=B(),i=b.useMemo(()=>{const t=[new Pa(a)];return s.customRenderers&&t.push(...s.customRenderers),t},[a,s.customRenderers]);return h.jsx($n,{...s,dataverseClient:r,dataverseEnv:e,customRenderers:i})}function $n(s){const r=b.useMemo(()=>{let a=[new Ca,new xt,new Ra];return s.customRenderers&&a.push(...s.customRenderers),a},[s.customRenderers]),e=b.useMemo(()=>new Ln(s.dataverseClient,s.dataverseEnv,s.tableName),[s.dataverseEnv,s.tableName]);return h.jsx(St,{dataService:e,fieldsToRender:s.fieldsToRender,customRenderers:r,selectionMode:s.selectionMode,systemFilter:s.systemFilter,getRowId:s.getRowId,onSelectionChange:s.onSelectionChange,onDataFetched:s.onDataFetched,renderFilter:(a,i,t)=>s.filterComponents&&s.filterComponents.find(o=>o.fieldName===a.name)?s.filterComponents.find(o=>o.fieldName===a.name).filterComponent(a,i,t):h.jsx(_a,{additionalFilters:t,onEntitySelected:o=>{if(o){const u=o.map(l=>({name:a.type=="Lookup"||a.type=="User"?`${a.name}/${a.relatedId}`:a.name,type:a.type,label:a.label,value:l.id,comparer:"Eq"}));i({...a,name:a.type=="Lookup"||a.type=="User"?`${a.name}/${a.relatedId}`:a.name},u)}},table:s.tableName,column:a,getFieldSuggestions:(o,u)=>e.getFieldSuggestions(o,s.systemFilter)})})}class qn{constructor(r,e,a,i=25){this.spHttpClient=r,this.siteUrl=e,this.listId=a,this.rowLimit=i,this.getFieldSuggestions=async(t,o)=>{let u=`${this.siteUrl}/_api/web/lists('${this.listId}')/RenderListFilterData?FieldInternalName='${t.name}'`;if(o&&o.length>0){let v="";for(let x=0;x<o.length;x++){const S=o[x],C=x+1;v+=`&FilterField${C}=${S.name}&FilterValue${C}=${encodeURIComponent(S.value)}&FilterType${C}=${S.type||"Text"}`}u+=v}const l=await this.spHttpClient.post(u,{headers:{accept:"application/json"}}),n=new DOMParser,c=await l.text(),g=n.parseFromString(c==null?void 0:c.replace("SELECTED",""),"application/xml").getElementsByTagName("OPTION"),y=[];for(let v=0;v<g.length;v++){const x=g.item(v);y.push({id:x.getAttribute("Value"),displayName:x.innerHTML})}return y},this.dataProvider=new Cr(r,e,a),this.dataProvider.pageSize=i}setFields(r){this.dataProvider.selectedFields=r.map(e=>e.name)}getTotalRows(){return this.dataProvider.allItemsCount}async getData(r,e,a){const i=new hr;return r&&r.length>0&&(r.forEach(t=>i.withFieldQuery(t)),this.dataProvider.setQuery(i.build())),e&&this.dataProvider.setOrder(e,a),this.dataProvider.getData()}getNextPage(){return this.dataProvider.getNextPage()}isNextPageAvailable(){return this.dataProvider.isNextPageAvailable()}getPreviousPage(){return this.dataProvider.getPreviousPage()}isPreviousPageAvailable(){return this.dataProvider.isPreviousPageAvailable()}}function Ea(s){const r=async e=>{const a=[];return s.additionalFilters&&a.push(...s.additionalFilters),e&&a.push({name:s.column.name,type:s.column.type,value:e,comparer:"Contains"}),s.getFieldSuggestions(s.column,a)};return h.jsx(X,{additionalKey:`${s.listId}-${s.column.name}-${Zi(s.additionalFilters?s.additionalFilters.map(e=>e.name+e.value).join(";"):"")}`,...s,onDataRequested:r})}class Ta{isRendererApplicable(r){return r.type==="User"}renderField(r,e,a){if(!e||!Array.isArray(e)||e.length===0)return h.jsx("span",{children:"-"});const i=e;return h.jsx("span",{children:i.map((t,o)=>h.jsxs("span",{children:[t.title||t.email||"Unknown",o<i.length-1?", ":""]},o))})}}function Ia(s){const{spClient:r,siteUrl:e}=st();return h.jsx(Un,{...s,siteUrl:e,spClient:r})}function Un(s){const r=b.useMemo(()=>{let a=[];return a.push(new Ta,new xt),s.customRenderers&&a.push(...s.customRenderers),a},[s.customRenderers]),e=b.useMemo(()=>new qn(s.spClient,s.siteUrl,s.listId,s.rowLimit),[s.spClient,s.listId,s.siteUrl]);return h.jsx(St,{dataService:e,fieldsToRender:s.fieldsToRender,customRenderers:r,selectionMode:s.selectionMode,rowLimit:s.rowLimit,getRowId:s.getRowId,onSelectionChange:s.onSelectionChange,renderFilter:(a,i,t)=>h.jsx(Ea,{additionalFilters:t,onEntitySelected:o=>{if(o){const u=o.map(l=>({name:a.name,type:a.type,label:a.label,value:l.id,comparer:"Eq"}));i({...a,name:a.name},u)}},listId:s.listId,column:a,getFieldSuggestions:e.getFieldSuggestions})})}class Da{constructor(r,e){this.graphClient=r,this.entityEndpoint=e,this.dataProvider=new Qt(r,e,!0)}getTotalRows(){return this.dataProvider.allItemsCount}mapToExpand(r){return r.expandFields?`${r.name}($select=${r.expandFields.join(",")})`:r.name}setFields(r){this.dataProvider.selectQuery=r.filter(e=>e.type!=="Lookup").map(e=>e.name).join(","),this.dataProvider.expandQuery=r.filter(e=>e.type==="Lookup"||e.type==="User").map(e=>this.mapToExpand(e)).join(",")}getData(r,e,a){if(r){const i=new jt;for(const o of r)i.withFieldQuery(o);const t=i.build();this.dataProvider.setQuery(t)}return e&&this.dataProvider.setOrder(e,a||"ASC"),this.dataProvider.getData()}getNextPage(){return this.dataProvider.getNextPage()}isNextPageAvailable(){return this.dataProvider.isNextPageAvailable()}getPreviousPage(){return this.dataProvider.getPreviousPage()}isPreviousPageAvailable(){return this.dataProvider.isPreviousPageAvailable()}async getFieldSuggestions(r,e){return[]}}P.AbstractGraphEntityPicker=X,P.AuthenticationContext=Ve,P.AuthenticationContextProvider=dr,P.ChannelPicker=da,P.ChannelPickerStandalone=Tn,P.DataverseContext=ot,P.DataverseContextProvider=Gr,P.DataverseTableDataGridService=Ln,P.DataverseTableGrid=ka,P.DataverseTableGridStandalone=$n,P.DrivePicker=ha,P.DrivePickerStandalone=In,P.GenericDataGrid=St,P.GraphContext=it,P.GraphContextProvider=Ur,P.GraphEntityDataGridService=Da,P.GraphGroupMembershipTrimmedComponent=ma,P.GraphGroupMembershipTrimmedComponentStandalone=Fn,P.GraphPersona=fa,P.GraphPersonaStandalone=Le,P.M365CopilotSearch=ia,P.M365Search=na,P.PeoplePicker=ya,P.PeoplePickerStandalone=On,P.PersonaService=wt,P.SPContext=at,P.SPContextProvider=Br,P.SPListDataGrid=Ia,P.SPListDataGridService=qn,P.SPListDataGridStandalone=Un,P.SPPermissionTrimmedComponent=pa,P.SPPermissionTrimmedComponentStandalone=An,P.SearchInputWithSuggestions=oa,P.SitePicker=va,P.SitePickerStandalone=jn,P.TeamPicker=ga,P.TeamPickerStandalone=Dn,P.defaultSelectFields=vt,P.useAuthentication=Ie,P.useDataverse=Zt,P.useGraph=B,P.useSP=st,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -8,5 +8,6 @@ export interface IDataGridService<T> {
|
|
|
8
8
|
isNextPageAvailable(): boolean;
|
|
9
9
|
getPreviousPage(): Promise<T[]>;
|
|
10
10
|
isPreviousPageAvailable(): boolean;
|
|
11
|
+
getTotalRows(): number;
|
|
11
12
|
getFieldSuggestions(field: DataField, existingFilters?: IQueryField[]): Promise<IEntityWithIdAndDisplayName[]>;
|
|
12
13
|
}
|
|
@@ -2,6 +2,9 @@ import { IHttpClient, IQueryField, ODataPagedDataProvider } from "mgwdev-m365-he
|
|
|
2
2
|
import { DataField } from "../../model/DataField";
|
|
3
3
|
import { IDataGridService } from "./DataGridService";
|
|
4
4
|
import { IEntityWithIdAndDisplayName } from "../../model/IEntityWithIdAndDisplayName";
|
|
5
|
+
export interface IQueryFieldWithJoinBy extends IQueryField {
|
|
6
|
+
joinBy?: "And" | "Or";
|
|
7
|
+
}
|
|
5
8
|
export declare class DataverseTableDataGridService<T> implements IDataGridService<T> {
|
|
6
9
|
protected dataverseClient: IHttpClient;
|
|
7
10
|
protected dataverseEnv: string;
|
|
@@ -9,12 +12,13 @@ export declare class DataverseTableDataGridService<T> implements IDataGridServic
|
|
|
9
12
|
protected dataProvider: ODataPagedDataProvider<T>;
|
|
10
13
|
protected dataFields: DataField[];
|
|
11
14
|
constructor(dataverseClient: IHttpClient, dataverseEnv: string, tableName: string);
|
|
15
|
+
getTotalRows(): number;
|
|
12
16
|
private mapToExpand;
|
|
13
17
|
setFields(fields: DataField[]): void;
|
|
14
|
-
getData(queryFields?:
|
|
18
|
+
getData(queryFields?: IQueryFieldWithJoinBy[], orderBy?: string, orderDir?: "ASC" | "DESC"): Promise<T[]>;
|
|
15
19
|
getNextPage(): Promise<T[]>;
|
|
16
20
|
isNextPageAvailable(): boolean;
|
|
17
21
|
getPreviousPage(): Promise<T[]>;
|
|
18
22
|
isPreviousPageAvailable(): boolean;
|
|
19
|
-
getFieldSuggestions: (field: DataField, existingFilters?:
|
|
23
|
+
getFieldSuggestions: (field: DataField, existingFilters?: IQueryFieldWithJoinBy[]) => Promise<IEntityWithIdAndDisplayName[]>;
|
|
20
24
|
}
|
|
@@ -7,6 +7,7 @@ export declare class GraphEntityDataGridService<T> implements IDataGridService<T
|
|
|
7
7
|
protected entityEndpoint: string;
|
|
8
8
|
protected dataProvider: ODataPagedDataProvider<T>;
|
|
9
9
|
constructor(graphClient: IHttpClient, entityEndpoint: string);
|
|
10
|
+
getTotalRows(): number;
|
|
10
11
|
private mapToExpand;
|
|
11
12
|
setFields(fields: DataField[]): void;
|
|
12
13
|
getData(queryFields?: IQueryField[], orderBy?: string, orderDir?: "ASC" | "DESC"): Promise<T[]>;
|
|
@@ -6,9 +6,11 @@ export declare class SPListDataGridService<T> implements IDataGridService<T> {
|
|
|
6
6
|
protected spHttpClient: IHttpClient;
|
|
7
7
|
protected siteUrl: string;
|
|
8
8
|
protected listId: string;
|
|
9
|
+
rowLimit: number;
|
|
9
10
|
protected dataProvider: SPListItemCamlPagedDataProvider<T>;
|
|
10
|
-
constructor(spHttpClient: IHttpClient, siteUrl: string, listId: string);
|
|
11
|
+
constructor(spHttpClient: IHttpClient, siteUrl: string, listId: string, rowLimit?: number);
|
|
11
12
|
setFields(fields: DataField[]): void;
|
|
13
|
+
getTotalRows(): number;
|
|
12
14
|
getData(queryFields?: IQueryField[], orderBy?: string, orderDir?: "ASC" | "DESC"): Promise<T[]>;
|
|
13
15
|
getNextPage(): Promise<T[]>;
|
|
14
16
|
isNextPageAvailable(): boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mgwdev-m365-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "vite",
|
|
7
7
|
"build": "tsc && vite build",
|
|
@@ -20,22 +20,23 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@azure/msal-browser": "^5.9.0",
|
|
23
|
-
"@fluentui/react-components": "^9.68.3",
|
|
24
23
|
"@testing-library/react": "^16.2.0",
|
|
25
24
|
"handlebars": "^4.7.8",
|
|
26
25
|
"handlebars-group-by": "^1.0.1",
|
|
27
26
|
"handlebars-helpers": "^0.10.0",
|
|
28
27
|
"jspath": "^0.4.0",
|
|
29
|
-
"mgwdev-m365-helpers": "^0.3.
|
|
28
|
+
"mgwdev-m365-helpers": "^0.3.4",
|
|
30
29
|
"react": ">=16.8.0",
|
|
31
30
|
"react-dom": ">=16.8.0",
|
|
32
31
|
"vite-plugin-dts": "^3.6.4"
|
|
33
32
|
},
|
|
34
33
|
"peerDependencies": {
|
|
34
|
+
"@fluentui/react-components": "^9.74.3",
|
|
35
35
|
"react": ">=16.8.0",
|
|
36
36
|
"react-dom": ">=16.8.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@fluentui/react-components": "^9.74.3",
|
|
39
40
|
"@microsoft/rush-stack-compiler-4.7": "^0.1.0",
|
|
40
41
|
"@microsoft/sp-build-web": "^1.21.1",
|
|
41
42
|
"@testing-library/jest-dom": "^6.6.3",
|