@microsoft/teams-js 2.48.0 → 2.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/esm/_virtual/_polyfill-node.buffer.js +1 -1
- package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js +1 -1
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js +1 -1
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js +1 -1
- package/dist/esm/packages/teams-js/dts/public/app/app.d.ts +13 -0
- package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/dialogHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/idValidation.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/mediaUtil.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/messageObjects.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/utils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/videoEffectsUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/videoFrameTick.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/videoPerformanceMonitor.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/webStorageHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/private/conversations.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/customTelemetry.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/eligibility.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/sidePanel.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/view.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActions.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForDA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCommands.js +1 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity/tab.js +1 -1
- package/dist/esm/packages/teams-js/src/private/logs.js +1 -1
- package/dist/esm/packages/teams-js/src/private/meetingRoom.js +1 -1
- package/dist/esm/packages/teams-js/src/private/messageChannels/dataLayer.js +1 -1
- package/dist/esm/packages/teams-js/src/private/messageChannels/telemetry.js +1 -1
- package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/private/store.js +1 -1
- package/dist/esm/packages/teams-js/src/private/teams/fullTrust/fullTrust.js +1 -1
- package/dist/esm/packages/teams-js/src/private/teams/fullTrust/joinedTeams.js +1 -1
- package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
- package/dist/esm/packages/teams-js/src/private/widgetHosting/widgetHosting.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
- package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
- package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
- package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
- package/dist/esm/packages/teams-js/src/public/call.js +1 -1
- package/dist/esm/packages/teams-js/src/public/chat.js +1 -1
- package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
- package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/adaptiveCard.js +1 -1
- package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/bot.js +1 -1
- package/dist/esm/packages/teams-js/src/public/dialog/url/parentCommunication.js +1 -1
- package/dist/esm/packages/teams-js/src/public/geoLocation/geoLocation.js +1 -1
- package/dist/esm/packages/teams-js/src/public/liveShareHost.js +1 -1
- package/dist/esm/packages/teams-js/src/public/mail/handoff.js +1 -1
- package/dist/esm/packages/teams-js/src/public/mail/mail.js +1 -1
- package/dist/esm/packages/teams-js/src/public/media.js +1 -1
- package/dist/esm/packages/teams-js/src/public/meeting/meeting.js +1 -1
- package/dist/esm/packages/teams-js/src/public/monetization.js +1 -1
- package/dist/esm/packages/teams-js/src/public/navigation.js +1 -1
- package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/appButton.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/backStack.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/currentApp.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/pages.js +1 -1
- package/dist/esm/packages/teams-js/src/public/people.js +1 -1
- package/dist/esm/packages/teams-js/src/public/profile.js +1 -1
- package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
- package/dist/esm/packages/teams-js/src/public/search.js +1 -1
- package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
- package/dist/esm/packages/teams-js/src/public/sharing/history.js +1 -1
- package/dist/esm/packages/teams-js/src/public/sharing/sharing.js +1 -1
- package/dist/esm/packages/teams-js/src/public/shortcutRelay.js +1 -1
- package/dist/esm/packages/teams-js/src/public/stageView/self.js +1 -1
- package/dist/esm/packages/teams-js/src/public/stageView/stageView.js +1 -1
- package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
- package/dist/esm/packages/teams-js/src/public/teamsAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/thirdPartyCloudStorage.js +1 -1
- package/dist/esm/packages/teams-js/src/public/uuidObject.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/esm/packages/teams-js/src/public/videoEffects.js +1 -1
- package/dist/esm/packages/teams-js/src/public/visualMedia/image.js +1 -1
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
- package/dist/umd/MicrosoftTeams.js +484 -479
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js +0 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
|
24
24
|
|
|
25
25
|
### Production
|
|
26
26
|
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.48.
|
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.48.1/js/MicrosoftTeams.min.js) or point your package manager at them.
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
|
|
|
45
45
|
```html
|
|
46
46
|
<!-- Microsoft Teams JavaScript API (via CDN) -->
|
|
47
47
|
<script
|
|
48
|
-
src="https://res.cdn.office.net/teams-js/2.48.
|
|
49
|
-
integrity="sha384
|
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.48.1/js/MicrosoftTeams.min.js"
|
|
49
|
+
integrity="sha384-opiKcSoAwE9QEI+cc408L9oI0NWev5vi/CLyCCX57M7GuRKrXlC4nOxJ9z6cBoXS"
|
|
50
50
|
crossorigin="anonymous"
|
|
51
51
|
></script>
|
|
52
52
|
|
|
53
53
|
<!-- Microsoft Teams JavaScript API (via npm) -->
|
|
54
|
-
<script src="node_modules/@microsoft/teams-js@2.48.
|
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.48.1/dist/MicrosoftTeams.min.js"></script>
|
|
55
55
|
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"./_polyfill-node.global.js";var r=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)r[n]=t[n],e[t.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63}function u(t,e,n){for(var i,o,u=[],f=e;f<n;f+=3)i=(t[f]<<16)+(t[f+1]<<8)+t[f+2],u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}function f(t){var e;i||o();for(var n=t.length,f=n%3,s="",h=[],a=16383,c=0,l=n-f;c<l;c+=a)h.push(u(t,c,c+a>l?l:c+a));return 1===f?(e=t[n-1],s+=r[e>>2],s+=r[e<<4&63],s+="=="):2===f&&(e=(t[n-2]<<8)+t[n-1],s+=r[e>>10],s+=r[e>>4&63],s+=r[e<<2&63],s+="="),h.push(s),h.join("")}function s(t,r,e,n,i){var o,u,f=8*i-n-1,s=(1<<f)-1,h=s>>1,a=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-a)-1,p>>=-a,a+=f;a>0;o=256*o+t[r+c],c+=l,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=256*u+t[r+c],c+=l,a-=8);if(0===o)o=1-h;else{if(o===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=h}return(p?-1:1)*u*Math.pow(2,o-n)}function h(t,r,e,n,i,o){var u,f,s,h=8*o-i-1,a=(1<<h)-1,c=a>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=a):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=a?(f=0,u=a):u+c>=1?(f=(r*s-1)*Math.pow(2,i),u+=c):(f=r*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&f,p+=g,f/=256,i-=8);for(u=u<<i|f,h+=i;h>0;t[e+p]=255&u,p+=g,u/=256,h-=8);t[e+p-g]|=128*y}var a={}.toString,c=Array.isArray||function(t){return"[object Array]"==a.call(t)},l=50;function p(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(p()<r)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=y.prototype:(null===t&&(t=new y(r)),t.length=r),t}function y(t,r,e){if(!(y.TYPED_ARRAY_SUPPORT||this instanceof y))return new y(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return v(this,t)}return w(this,t,r,e)}function w(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);y.TYPED_ARRAY_SUPPORT?(t=r).__proto__=y.prototype:t=E(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!y.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|b(r,e);t=g(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(R(r)){var e=0|A(r.length);return 0===(t=g(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?g(t,0):E(t,r);if("Buffer"===r.type&&c(r.data))return E(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function v(t,r){if(d(r),t=g(t,r<0?0:0|A(r)),!y.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function E(t,r){var e=r.length<0?0:0|A(r.length);t=g(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function A(t){if(t>=p())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p().toString(16)+" bytes");return 0|t}function R(t){return!(null==t||!t._isBuffer)}function b(t,r){if(R(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return Q(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}function m(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,r,e);case"utf8":case"utf-8":return L(this,r,e);case"ascii":return D(this,r,e);case"latin1":case"binary":return x(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function P(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=y.from(r,n)),R(r))return 0===r.length?-1:T(t,r,e,n,i);if("number"==typeof r)return r&=255,y.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):T(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function T(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function U(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function B(t,r,e,n){return W(K(r,t.length-e),t,e,n)}function S(t,r,e,n){return W(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function Y(t,r,e,n){return S(t,r,e,n)}function I(t,r,e,n){return W(Q(r),t,e,n)}function C(t,r,e,n){return W(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?f(t):f(t.slice(r,e))}function L(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return function(t){var r=t.length;if(r<=M)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=M));return e}(n)}y.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,p(),y.poolSize=8192,y._augment=function(t){return t.__proto__=y.prototype,t},y.from=function(t,r,e){return w(null,t,r,e)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&y[Symbol.species]),y.alloc=function(t,r,e){return function(t,r,e,n){return d(r),r<=0?g(t,r):void 0!==e?"string"==typeof n?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}(null,t,r,e)},y.allocUnsafe=function(t){return v(null,t)},y.allocUnsafeSlow=function(t){return v(null,t)},y.isBuffer=X,y.compare=function(t,r){if(!R(t)||!R(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},y.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(t,r){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return y.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=y.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!R(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},y.byteLength=b,y.prototype._isBuffer=!0,y.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)_(this,r,r+1);return this},y.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)_(this,r,r+3),_(this,r+1,r+2);return this},y.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)_(this,r,r+7),_(this,r+1,r+6),_(this,r+2,r+5),_(this,r+3,r+4);return this},y.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?L(this,0,t):m.apply(this,arguments)},y.prototype.equals=function(t){if(!R(t))throw new TypeError("Argument must be a Buffer");return this===t||0===y.compare(this,t)},y.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},y.prototype.compare=function(t,r,e,n,i){if(!R(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),f=Math.min(o,u),s=this.slice(n,i),h=t.slice(r,e),a=0;a<f;++a)if(s[a]!==h[a]){o=s[a],u=h[a];break}return o<u?-1:u<o?1:0},y.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},y.prototype.indexOf=function(t,r,e){return P(this,t,r,e,!0)},y.prototype.lastIndexOf=function(t,r,e){return P(this,t,r,e,!1)},y.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return U(this,t,r,e);case"utf8":case"utf-8":return B(this,t,r,e);case"ascii":return S(this,t,r,e);case"latin1":case"binary":return Y(this,t,r,e);case"base64":return I(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function k(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=H(t[o]);return i}function N(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function z(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function F(t,r,e,n,i,o){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function j(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function q(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function J(t,r,e,n,i){return i||q(t,0,e,4),h(t,r,e,n,23,4),e+4}function Z(t,r,e,n,i){return i||q(t,0,e,8),h(t,r,e,n,52,8),e+8}y.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),y.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=y.prototype;else{var i=r-t;e=new y(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},y.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},y.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},y.prototype.readUInt8=function(t,r){return r||z(t,1,this.length),this[t]},y.prototype.readUInt16LE=function(t,r){return r||z(t,2,this.length),this[t]|this[t+1]<<8},y.prototype.readUInt16BE=function(t,r){return r||z(t,2,this.length),this[t]<<8|this[t+1]},y.prototype.readUInt32LE=function(t,r){return r||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},y.prototype.readUInt32BE=function(t,r){return r||z(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},y.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},y.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},y.prototype.readInt8=function(t,r){return r||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},y.prototype.readInt16LE=function(t,r){r||z(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt16BE=function(t,r){r||z(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt32LE=function(t,r){return r||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},y.prototype.readInt32BE=function(t,r){return r||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},y.prototype.readFloatLE=function(t,r){return r||z(t,4,this.length),s(this,t,!0,23,4)},y.prototype.readFloatBE=function(t,r){return r||z(t,4,this.length),s(this,t,!1,23,4)},y.prototype.readDoubleLE=function(t,r){return r||z(t,8,this.length),s(this,t,!0,52,8)},y.prototype.readDoubleBE=function(t,r){return r||z(t,8,this.length),s(this,t,!1,52,8)},y.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},y.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},y.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,255,0),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},y.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):V(this,t,r,!0),r+4},y.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,127,-128),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},y.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):V(this,t,r,!0),r+4},y.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeFloatLE=function(t,r,e){return J(this,t,r,!0,e)},y.prototype.writeFloatBE=function(t,r,e){return J(this,t,r,!1,e)},y.prototype.writeDoubleLE=function(t,r,e){return Z(this,t,r,!0,e)},y.prototype.writeDoubleBE=function(t,r,e){return Z(this,t,r,!1,e)},y.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!y.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},y.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=R(t)?t:K(new y(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function Q(t){return function(t){var r,u,f,s,h,a;i||o();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");h="="===t[c-2]?2:"="===t[c-1]?1:0,a=new n(3*c/4-h),f=h>0?c-4:c;var l=0;for(r=0,u=0;r<f;r+=4,u+=3)s=e[t.charCodeAt(r)]<<18|e[t.charCodeAt(r+1)]<<12|e[t.charCodeAt(r+2)]<<6|e[t.charCodeAt(r+3)],a[l++]=s>>16&255,a[l++]=s>>8&255,a[l++]=255&s;return 2===h?(s=e[t.charCodeAt(r)]<<2|e[t.charCodeAt(r+1)]>>4,a[l++]=255&s):1===h&&(s=e[t.charCodeAt(r)]<<10|e[t.charCodeAt(r+1)]<<4|e[t.charCodeAt(r+2)]>>2,a[l++]=s>>8&255,a[l++]=255&s),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function X(t){return null!=t&&(!!t._isBuffer||$(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&$(t.slice(0,0))}(t))}function $(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}export{y as Buffer,l as INSPECT_MAX_BYTES,X as isBuffer};
|
|
1
|
+
import t from"./_polyfill-node.global.js";var r=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)r[n]=t[n],e[t.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63}function u(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function f(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(u(n));return i.join("")}function s(t){var e;i||o();for(var n=t.length,u=n%3,s="",h=[],a=16383,c=0,l=n-u;c<l;c+=a)h.push(f(t,c,c+a>l?l:c+a));return 1===u?(e=t[n-1],s+=r[e>>2],s+=r[e<<4&63],s+="=="):2===u&&(e=(t[n-2]<<8)+t[n-1],s+=r[e>>10],s+=r[e>>4&63],s+=r[e<<2&63],s+="="),h.push(s),h.join("")}function h(t,r,e,n,i){var o,u,f=8*i-n-1,s=(1<<f)-1,h=s>>1,a=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-a)-1,p>>=-a,a+=f;a>0;o=256*o+t[r+c],c+=l,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=256*u+t[r+c],c+=l,a-=8);if(0===o)o=1-h;else{if(o===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=h}return(p?-1:1)*u*Math.pow(2,o-n)}function a(t,r,e,n,i,o){var u,f,s,h=8*o-i-1,a=(1<<h)-1,c=a>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=a):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=a?(f=0,u=a):u+c>=1?(f=(r*s-1)*Math.pow(2,i),u+=c):(f=r*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&f,p+=g,f/=256,i-=8);for(u=u<<i|f,h+=i;h>0;t[e+p]=255&u,p+=g,u/=256,h-=8);t[e+p-g]|=128*y}var c={}.toString,l=Array.isArray||function(t){return"[object Array]"==c.call(t)},p=50;function g(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,r){if(g()<r)throw new RangeError("Invalid typed array length");return w.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=w.prototype:(null===t&&(t=new w(r)),t.length=r),t}function w(t,r,e){if(!(w.TYPED_ARRAY_SUPPORT||this instanceof w))return new w(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return E(this,t)}return d(this,t,r,e)}function d(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);w.TYPED_ARRAY_SUPPORT?(t=r).__proto__=w.prototype:t=A(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!w.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(r,e);t=y(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(b(r)){var e=0|R(r.length);return 0===(t=y(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?y(t,0):A(t,r);if("Buffer"===r.type&&l(r.data))return A(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function v(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function E(t,r){if(v(r),t=y(t,r<0?0:0|R(r)),!w.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function A(t,r){var e=r.length<0?0:0|R(r.length);t=y(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function R(t){if(t>=g())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g().toString(16)+" bytes");return 0|t}function b(t){return!(null==t||!t._isBuffer)}function m(t,r){if(b(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return W(t).length;default:if(n)return Q(t).length;r=(""+r).toLowerCase(),n=!0}}function _(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,r,e);case"utf8":case"utf-8":return M(this,r,e);case"ascii":return x(this,r,e);case"latin1":case"binary":return k(this,r,e);case"base64":return L(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function P(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function T(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=w.from(r,n)),b(r))return 0===r.length?-1:U(t,r,e,n,i);if("number"==typeof r)return r&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):U(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function U(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function B(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function S(t,r,e,n){return X(Q(r,t.length-e),t,e,n)}function Y(t,r,e,n){return X(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function I(t,r,e,n){return Y(t,r,e,n)}function C(t,r,e,n){return X(W(r),t,e,n)}function O(t,r,e,n){return X(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function L(t,r,e){return 0===r&&e===t.length?s(t):s(t.slice(r,e))}function M(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return function(t){var r=t.length;if(r<=D)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=D));return e}(n)}w.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,g(),w.poolSize=8192,w._augment=function(t){return t.__proto__=w.prototype,t},w.from=function(t,r,e){return d(null,t,r,e)},w.TYPED_ARRAY_SUPPORT&&(w.prototype.__proto__=Uint8Array.prototype,w.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&w[Symbol.species]),w.alloc=function(t,r,e){return function(t,r,e,n){return v(r),r<=0?y(t,r):void 0!==e?"string"==typeof n?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}(null,t,r,e)},w.allocUnsafe=function(t){return E(null,t)},w.allocUnsafeSlow=function(t){return E(null,t)},w.isBuffer=$,w.compare=function(t,r){if(!b(t)||!b(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},w.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},w.concat=function(t,r){if(!l(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return w.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=w.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!b(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},w.byteLength=m,w.prototype._isBuffer=!0,w.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)P(this,r,r+1);return this},w.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)P(this,r,r+3),P(this,r+1,r+2);return this},w.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)P(this,r,r+7),P(this,r+1,r+6),P(this,r+2,r+5),P(this,r+3,r+4);return this},w.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):_.apply(this,arguments)},w.prototype.equals=function(t){if(!b(t))throw new TypeError("Argument must be a Buffer");return this===t||0===w.compare(this,t)},w.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},w.prototype.compare=function(t,r,e,n,i){if(!b(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),f=Math.min(o,u),s=this.slice(n,i),h=t.slice(r,e),a=0;a<f;++a)if(s[a]!==h[a]){o=s[a],u=h[a];break}return o<u?-1:u<o?1:0},w.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},w.prototype.indexOf=function(t,r,e){return T(this,t,r,e,!0)},w.prototype.lastIndexOf=function(t,r,e){return T(this,t,r,e,!1)},w.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return B(this,t,r,e);case"utf8":case"utf-8":return S(this,t,r,e);case"ascii":return Y(this,t,r,e);case"latin1":case"binary":return I(this,t,r,e);case"base64":return C(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function x(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function N(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=K(t[o]);return i}function z(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function F(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function j(t,r,e,n,i,o){if(!b(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function V(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function J(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Z(t,r,e,n,i){return i||J(t,0,e,4),a(t,r,e,n,23,4),e+4}function G(t,r,e,n,i){return i||J(t,0,e,8),a(t,r,e,n,52,8),e+8}w.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),w.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=w.prototype;else{var i=r-t;e=new w(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},w.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},w.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},w.prototype.readUInt8=function(t,r){return r||F(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,r){return r||F(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,r){return r||F(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,r){return r||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,r){return r||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},w.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},w.prototype.readInt8=function(t,r){return r||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,r){r||F(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt16BE=function(t,r){r||F(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt32LE=function(t,r){return r||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,r){return r||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,r){return r||F(t,4,this.length),h(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,r){return r||F(t,4,this.length),h(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,r){return r||F(t,8,this.length),h(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,r){return r||F(t,8,this.length),h(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},w.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},w.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},w.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):V(this,t,r,!0),r+2},w.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):V(this,t,r,!1),r+2},w.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):q(this,t,r,!0),r+4},w.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},w.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},w.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},w.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},w.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):V(this,t,r,!0),r+2},w.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):V(this,t,r,!1),r+2},w.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):q(this,t,r,!0),r+4},w.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},w.prototype.writeFloatLE=function(t,r,e){return Z(this,t,r,!0,e)},w.prototype.writeFloatBE=function(t,r,e){return Z(this,t,r,!1,e)},w.prototype.writeDoubleLE=function(t,r,e){return G(this,t,r,!0,e)},w.prototype.writeDoubleBE=function(t,r,e){return G(this,t,r,!1,e)},w.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!w.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},w.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!w.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=b(t)?t:Q(new w(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function K(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function W(t){return function(t){var r,u,f,s,h,a;i||o();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");h="="===t[c-2]?2:"="===t[c-1]?1:0,a=new n(3*c/4-h),f=h>0?c-4:c;var l=0;for(r=0,u=0;r<f;r+=4,u+=3)s=e[t.charCodeAt(r)]<<18|e[t.charCodeAt(r+1)]<<12|e[t.charCodeAt(r+2)]<<6|e[t.charCodeAt(r+3)],a[l++]=s>>16&255,a[l++]=s>>8&255,a[l++]=255&s;return 2===h?(s=e[t.charCodeAt(r)]<<2|e[t.charCodeAt(r+1)]>>4,a[l++]=255&s):1===h&&(s=e[t.charCodeAt(r)]<<10|e[t.charCodeAt(r+1)]<<4|e[t.charCodeAt(r+2)]>>2,a[l++]=s>>8&255,a[l++]=255&s),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function X(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function $(t){return null!=t&&(!!t._isBuffer||tt(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&tt(t.slice(0,0))}(t))}function tt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}export{w as Buffer,p as INSPECT_MAX_BYTES,$ as isBuffer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function n(t,n,e,r){return new(e||(e=Promise))(function(o,c){function p(t){try{u(r.next(t))}catch(t){c(t)}}function f(t){try{u(r.throw(t))}catch(t){c(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e(function(t){t(n)})).then(p,f)}u((r=r.apply(t,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;export{n as __awaiter,t as __rest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__module as e}from"../../../../../../_virtual/browser.js";import{c as o}from"./common.js";!function(e,C){C.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;o.splice(1,0,C,"color: inherit");let t=0,n=0;o[0].replace(/%[a-zA-Z%]/g,
|
|
1
|
+
import{__module as e}from"../../../../../../_virtual/browser.js";import{c as o}from"./common.js";!function(e,C){C.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;o.splice(1,0,C,"color: inherit");let t=0,n=0;o[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(t++,"%c"===e&&(n=t))}),o.splice(n,0,C)},C.save=function(e){try{e?C.storage.setItem("debug",e):C.storage.removeItem("debug")}catch(e){}},C.load=function(){let e;try{e=C.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},C.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},C.storage=function(){try{return localStorage}catch(e){}}(),C.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),C.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],C.log=console.debug||console.log||(()=>{}),e.exports=o(C);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(e,e.exports);var C=e.exports;export{C as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n=function(n){function t(e){let n,s,o,a=null;function l(...e){if(!l.enabled)return;const r=l,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(
|
|
1
|
+
import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n=function(n){function t(e){let n,s,o,a=null;function l(...e){if(!l.enabled)return;const r=l,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";a++;const o=t.formatters[s];if("function"==typeof o){const t=e[a];n=o.call(r,t),e.splice(a,1),a--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return l.namespace=e,l.useColors=t.useColors(),l.color=t.selectColor(e),l.extend=r,l.destroy=t.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(l),l}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n<s;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=e(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(e=>{t[e]=n[e]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};export{n as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"./native.js";import n from"./rng.js";import{unsafeStringify as o}from"./stringify.js";function t(t,m,i){if(r.randomUUID&&!
|
|
1
|
+
import r from"./native.js";import n from"./rng.js";import{unsafeStringify as o}from"./stringify.js";function t(t,m,i){if(r.randomUUID&&!t)return r.randomUUID();const f=(t=t||{}).random||(t.rng||n)();return f[6]=15&f[6]|64,f[8]=63&f[8]|128,o(f)}export{t as default};
|
|
@@ -73,6 +73,11 @@ export interface IFailedRequest {
|
|
|
73
73
|
* This property is currently unused.
|
|
74
74
|
*/
|
|
75
75
|
message?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional authorization header to be sent along with the failure notification.
|
|
78
|
+
* Currently only supported for SSR scenarios.
|
|
79
|
+
*/
|
|
80
|
+
authHeader?: string;
|
|
76
81
|
}
|
|
77
82
|
/**
|
|
78
83
|
* Represents the failure request sent during an erroneous app initialization.
|
|
@@ -482,7 +487,11 @@ export interface Context {
|
|
|
482
487
|
*/
|
|
483
488
|
export type themeHandler = (theme: string) => void;
|
|
484
489
|
/**
|
|
490
|
+
* @hidden
|
|
485
491
|
* This function is passed to registerOnContextChangeHandler. It is called every time the user changes their context.
|
|
492
|
+
*
|
|
493
|
+
* @internal
|
|
494
|
+
* Limited to Microsoft-internal use
|
|
486
495
|
*/
|
|
487
496
|
export type contextHandler = (context: Context) => void;
|
|
488
497
|
/**
|
|
@@ -565,12 +574,16 @@ export declare function notifyExpectedFailure(expectedFailureRequest: IExpectedF
|
|
|
565
574
|
*/
|
|
566
575
|
export declare function registerOnThemeChangeHandler(handler: themeHandler): void;
|
|
567
576
|
/**
|
|
577
|
+
* @hidden
|
|
568
578
|
* Registers a handler for content (context) changes.
|
|
569
579
|
*
|
|
570
580
|
* @remarks
|
|
571
581
|
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
|
|
572
582
|
*
|
|
573
583
|
* @param handler - The handler to invoke when the app's content context changes.
|
|
584
|
+
*
|
|
585
|
+
* @internal
|
|
586
|
+
* Limited to Microsoft-internal use
|
|
574
587
|
*/
|
|
575
588
|
export declare function registerOnContextChangeHandler(handler: contextHandler): void;
|
|
576
589
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001"],c={validOrigins:o};export{c as default,o as validOrigins};
|
|
1
|
+
var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"],c={validOrigins:o};export{c as default,o as validOrigins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.
|
|
1
|
+
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndHandleStatusAndReason as e,sendMessageToParent as t,callFunctionInHostAndHandleResponse as n,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,registerOnContextChangeHandler as p,initializeHandlers as u}from"./handlers.js";import{ensureInitialized as m,ensureInitializeCalled as c,processAdditionalValidOrigins as f}from"./internalAPIs.js";import{getLogger as d}from"./telemetry.js";import{isNullOrUndefined as g}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as h,runWithTimeout as S,normalizeAgeGroupValue as j,compareSDKVersions as v}from"./utils.js";import{Messages as w}from"../public/app/app.js";import{FrameContexts as y}from"../public/constants.js";import{initialize as z}from"../public/dialog/dialog.js";import{initialize as b}from"../public/menus.js";import{runtime as P,applyRuntimeConfig as C,generateVersionBasedTeamsRuntimeConfig as x,mapTeamsVersionToSupportedCapabilities as D,versionAndPlatformAgnosticTeamsRuntimeConfig as E}from"../public/runtime.js";import{version as V}from"../public/version.js";import{SimpleTypeResponseHandler as K}from"./responseHandler.js";import{initialize as _}from"../public/pages/config.js";const k=d("app");function A(i,e){if(h()){return k.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return S(()=>function(i,e){return new Promise(t=>{l.initializeCalled||(l.initializeCalled=!0,u(),l.initializePromise=o(e,i).then(({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:n=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=n;try{L("Parsing %s",t);let i=JSON.parse(t);if(L("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");i=j(i),t&&C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{L("Attempting to parse %s as an SDK version",t),isNaN(v(t,s))||(l.clientSupportedSDKVersion=t);let i=JSON.parse(n);if(L("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");i=j(i),C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;C(x(l.clientSupportedSDKVersion,E,D))}}l.initializeCompleted=!0}),b(),_(),z()),Array.isArray(e)&&f(e),void 0!==l.initializePromise?t(l.initializePromise):L("GlobalVars.initializePromise is unexpectedly undefined")})}(i,e),6e4,new Error("SDK initialization timed out."))}function F(i){t(i,w.AppLoaded,[V])}function H(i,e){t(i,w.ExpectedFailure,[e.reason,e.message])}function N(i,e){t(i,w.Failure,[e.reason,e.message,e.authHeader])}function R(e){return i(this,void 0,void 0,function*(){if(l.initializeCompleted)return J(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then(()=>J(e))})}function J(e){return i(this,void 0,void 0,function*(){return m(P)&&(null===(i=P.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?n(w.Success,[V],new K,e).then(()=>({hasFinishedSuccessfully:!0})):(t(e,w.Success,[V]),{hasFinishedSuccessfully:"unknown"});var i})}const L=k.extend("initializeHelper");function O(i,e){!g(e)&&c(),a(i,e)}function T(i,e){!g(e)&&c(),p(i,e)}function G(i,t){return new Promise(n=>{m(P,y.content,y.sidePanel,y.settings,y.task,y.stage,y.meetingStage),n(e(i,"executeDeepLink",t))})}export{A as appInitializeHelper,J as callNotifySuccessInHost,F as notifyAppLoadedHelper,H as notifyExpectedFailureHelper,N as notifyFailureHelper,R as notifySuccessHelper,G as openLinkHelper,T as registerOnContextChangeHandlerHelper,O as registerOnThemeChangeHandlerHelper};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as n}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.
|
|
1
|
+
import{__awaiter as n}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isChildProxyingEnabled as i,getCurrentFeatureFlagsState as o}from"../public/featureFlags.js";import{flushMessageQueue as s,getMessageIdsAsLogString as e}from"./communicationUtils.js";import{callHandler as r}from"./handlers.js";import{deserializeMessageRequest as t,serializeMessageResponse as d}from"./messageObjects.js";import{getLogger as a,getApiVersionTag as u}from"./telemetry.js";const c=a("childProxyingCommunication");class l{}function g(){l.window=null,l.origin=null,l.messageQueue=[]}function m(){return!!i()&&!!l.window}function f(n,o){return!!i()&&(l.window&&!l.window.closed&&n!==l.window||(l.window=n,l.origin=o),l.window&&l.window.closed?(l.window=null,l.origin=null,!1):l.window===n)}function w(i,d,a,c){return n(this,void 0,void 0,function*(){l.window===d&&(s(l.window,l.origin,l.messageQueue,"child"),function(n,i,s){if(void 0===n.data.id||void 0===n.data.func)return;const d=t(n.data),[a,c]=r(d.func,d.args);if(a&&void 0!==c)return p("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",e(d),d.func),void h(d.id,d.uuid,Array.isArray(c)?c:[c]);p("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",e(d),d.func),function(n,i,s){const r=i(u("v2","tasks.startTask"),n.func,n.args,!0,n.teamsJsInstanceId),t=l.origin;s(r.uuid,(...i)=>{if(!l.window)return;if(!o().disableEnforceOriginMatchForChildResponses&&t!==l.origin)return void p("Origin of child window has changed, not sending response back to child window");const s=i.pop();p("Message from parent being relayed to child, id: %s",e(n)),h(n.id,n.uuid,i,s)})}(d,i,s)}(i,a,c))})}l.messageQueue=[];const p=c.extend("handleIncomingMessageFromChild");function h(n,i,o,s){const r=l.window,t=function(n,i,o,s){return{id:n,uuid:i,args:o||[],isPartialResponse:s}}(n,i,o,s),a=d(t),u=l.origin;r&&u&&(p("Sending message %s to %s via postMessage, args = %o",e(a),"child",a.args),r.postMessage(a,u))}function v(n,i){const o=l.window,s=function(n,i){return{func:n,args:i||[]}}(n,i),e=l.origin;o&&e?o.postMessage(s,e):l.messageQueue.push(s)}export{w as handleIncomingMessageFromChild,v as sendMessageEventToChild,m as shouldEventBeRelayedToChild,f as shouldProcessChildMessage,g as uninitializeChildCommunication};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isSdkError as n,ErrorCode as t}from"../public/interfaces.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{isSerializable as r}from"../public/serializable.interface.js";import{UUID as i}from"../public/uuidObject.js";import{version as s}from"../public/version.js";import{uninitializeChildCommunication as a,shouldProcessChildMessage as c,handleIncomingMessageFromChild as d}from"./childCommunication.js";import{getMessageIdsAsLogString as u,flushMessageQueue as l}from"./communicationUtils.js";import{GlobalVars as g}from"./globalVars.js";import{callHandler as p}from"./handlers.js";import f from"./hostToAppTelemetry.js";import{serializeMessageRequest as m,deserializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getLogger as v,isFollowingApiVersionTagFormat as b}from"./telemetry.js";import{getCurrentTimestamp as W,ssrSafeWindow as M}from"./utils.js";import{validateOrigin as y}from"./validOrigins.js";const k=v("communication");class I{}class T{}function E(n,t){if(T.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void J("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,t=n.origin||n.originalEvent&&n.originalEvent.origin;return B(e,t).then((o=>{o?(!function(e,n){g.isFramelessWindow||I.parentWindow&&!I.parentWindow.closed&&e!==I.parentWindow||(I.parentWindow=e,I.parentOrigin=n);I.parentWindow&&I.parentWindow.closed&&(I.parentWindow=null,I.parentOrigin=null);l(I.parentWindow,I.parentOrigin,T.parentMessageQueue,"parent")}(e,t),e!==I.parentWindow?c(e,t)&&d(n,e,V,((e,n)=>T.callbacks.set(e,n))):Y(n)):J("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,t)}))}))}(n),I.currentWindow=I.currentWindow||M(),I.parentWindow=I.currentWindow.parent!==I.currentWindow.self?I.currentWindow.parent:I.currentWindow.opener,I.topWindow=I.currentWindow.top,(I.parentWindow||n)&&I.currentWindow.addEventListener("message",T.messageListener,!1),!I.parentWindow){const e=I.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));g.isFramelessWindow=!0,e.onNativeMessage=Y}try{return I.parentOrigin="*",S(t,"initialize",[s,o,n]).then((([e,n,t,o])=>(h(o,I.currentWindow,{onMessage:D,sendPostMessage:L}),{context:e,clientType:n,runtimeConfig:t,clientSupportedSDKVersion:o})))}finally{I.parentOrigin=null}}function j(){I.currentWindow&&I.currentWindow.removeEventListener("message",T.messageListener,!1),I.currentWindow=null,I.parentWindow=null,I.parentOrigin=null,T.parentMessageQueue=[],T.nextMessageId=0,T.callbacks.clear(),T.promiseCallbacks.clear(),T.portCallbacks.clear(),T.legacyMessageIdsToUuidMap={},f.clearMessages(),a()}function O(e,n,...t){return S(e,n,t).then((([e])=>e))}function R(e,n,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n)}))}function C(e,n,t,...o){return S(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||t)}))}function P(e,n,...t){return S(e,n,t).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!b(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((o=>{const r=V(e,n,t);var i;o((i=r.uuid,new Promise((e=>{T.promiseCallbacks.set(i,e)}))))}))}function x(e){return e.map((e=>r(e)?e.serialize():e))}function N(o,r,i,s,a){var c;return e(this,void 0,void 0,(function*(){const e=x(r),[d]=yield S(s,o,e);if(a&&a(d)||!a&&n(d))throw new Error(`${d.errorCode}, message: ${null!==(c=d.message)&&void 0!==c?c:"None"}`);if(i.validate(d))return i.deserialize(d);throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(d)}`)}))}function A(o,r,i,s){var a;return e(this,void 0,void 0,(function*(){const e=x(r),[c]=yield S(i,o,e);if(s&&s(c)||!s&&n(c))throw new Error(`${c.errorCode}, message: ${null!==(a=c.message)&&void 0!==a?a:"None"}`);if(void 0!==c)throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host`)}))}function U(e,n,t=void 0){if(!b(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=V(e,n,t);return r=o.uuid,new Promise(((e,n)=>{T.portCallbacks.set(r,((t,o)=>{t instanceof MessagePort?e(t):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var r}function $(e,n,t,o){let r;if(t instanceof Function?o=t:t instanceof Array&&(r=t),!b(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const i=V(e,n,r);o&&T.callbacks.set(i.uuid,o)}T.parentMessageQueue=[],T.topMessageQueue=[],T.nextMessageId=0,T.callbacks=new Map,T.promiseCallbacks=new Map,T.portCallbacks=new Map,T.legacyMessageIdsToUuidMap={};const z=k.extend("sendNestedAuthRequestToTopWindow");function L(e,n){const t=z,o=I.topWindow,r=function(e,n){const t=T.nextMessageId++,o=new i;return T.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),apiVersionTag:n,args:[],data:e}}(e,n);return t("Message %s information: %o",u(r),{actionName:r.func}),F(o,r)}const _=k.extend("sendRequestToTargetWindowHelper");function F(e,n){const t=_,o=function(e){return e===I.topWindow&&Z()?"top":e===I.parentWindow?"parent":null}(e),r=m(n);if(g.isFramelessWindow)I.currentWindow&&I.currentWindow.nativeInterface&&(t("Sending message %s to %s via framelessPostMessage interface",u(r),o),I.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(r)));else{const i=function(e){return e===I.topWindow&&Z()?I.topOrigin:e===I.parentWindow?I.parentOrigin:null}(e);e&&i?(t("Sending message %s to %s via postMessage",u(r),o),e.postMessage(r,i)):(t("Adding message %s to %s message queue",u(r),o),ee(e).push(n))}return n}const Q=k.extend("sendMessageToParentHelper");function V(e,n,t,o,r){const s=Q,a=I.parentWindow,c=function(e,n,t,o,r){const s=T.nextMessageId++,a=new i;T.legacyMessageIdsToUuidMap[s]=a;const c=!0===o?r:g.teamsJsInstanceId;return{id:s,uuid:a,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:t||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o,teamsJsInstanceId:c}}(e,n,t,o,r);return f.storeCallbackInformation(c.uuid,{name:n,calledAt:c.timestamp}),s("Message %s information: %o",u(c),{actionName:n,args:t}),F(a,c)}const J=k.extend("processIncomingMessage");const q=k.extend("processAuthBridgeMessage");function D(e,n){var t,o;const r=q;if(!e||!e.data||"object"!=typeof e.data)return void r("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:i}=e.data,[,s]=null!=i?i:[],a=(()=>{try{return JSON.parse(s)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void r("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.source),d=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);c?B(c,d)?(I.topWindow&&!I.topWindow.closed&&c!==I.topWindow||(I.topWindow=c,I.topOrigin=d),I.topWindow&&I.topWindow.closed&&(I.topWindow=null,I.topOrigin=null),l(I.topWindow,I.topOrigin,T.topMessageQueue,"top"),n(s)):r("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):r("Message being ignored by app because it is coming for a target that is null")}const H=k.extend("shouldProcessIncomingMessage");function B(n,t){return e(this,void 0,void 0,(function*(){if(I.currentWindow&&n===I.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(I.currentWindow&&I.currentWindow.location&&t&&t===I.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return H("Message has an invalid origin of %s",t),!1}const n=yield y(e);return n||H("Message has an invalid origin of %s",t),n}}))}const K=k.extend("handleIncomingMessageFromParent");function G(e,n){if(n){const t=[...e].find((([e,t])=>e.toString()===n.toString()));if(t)return t[0]}}function X(e,n){const t=G(n,e.uuid);t&&n.delete(t),e.uuid?T.legacyMessageIdsToUuidMap={}:delete T.legacyMessageIdsToUuidMap[e.id]}function Y(e){const n=K,t=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,r=w(o),i=function(e){const n=K;if(!e.uuid)return T.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,t=G(T.callbacks,n);if(t)return t;const o=G(T.promiseCallbacks,n);if(o)return o;const r=G(T.portCallbacks,n);if(r)return r}n("Received message %s that failed to produce a callbackId",u(e))}(r);if(i){const o=T.callbacks.get(i);n("Received a response from parent for message %s",i.toString()),f.handlePerformanceMetrics(i,r,n,t),o&&(n("Invoking the registered callback for message %s with arguments %o",i.toString(),r.args),o.apply(null,[...r.args,r.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",i.toString()),X(r,T.callbacks)));const s=T.promiseCallbacks.get(i);s&&(n("Invoking the registered promise callback for message %s with arguments %o",i.toString(),r.args),s(r.args),n("Removing registered promise callback for message %s",i.toString()),X(r,T.promiseCallbacks));const a=T.portCallbacks.get(i);if(a){let t;n("Invoking the registered port callback for message %s with arguments %o",i.toString(),r.args),e.ports&&e.ports[0]instanceof MessagePort&&(t=e.ports[0]),a(t,r.args),n("Removing registered port callback for message %s",i.toString()),X(r,T.portCallbacks)}r.uuid&&(T.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;f.handleOneWayPerformanceMetrics(o,n,t),n('Received a message from parent %s, action: "%s"',u(o),o.func),p(o.func,o.args)}else n("Received an unknown message: %O",e)}function Z(){return I.topWindow!==I.parentWindow}function ee(e){return e===I.topWindow&&Z()?T.topMessageQueue:e===I.parentWindow?T.parentMessageQueue:[]}function ne(e,n){let t;t=I.currentWindow.setInterval((()=>{0===ee(e).length&&(clearInterval(t),n())}),100)}export{I as Communication,A as callFunctionInHost,N as callFunctionInHostAndHandleResponse,E as initializeCommunication,U as requestPortFromParentWithVersion,P as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,C as sendAndHandleStatusAndReasonWithDefaultError,O as sendAndUnwrap,$ as sendMessageToParent,S as sendMessageToParentAsync,L as sendNestedAuthRequestToTopWindow,j as uninitializeCommunication,ne as waitForMessageQueue};
|
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isSdkError as n,ErrorCode as t}from"../public/interfaces.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{isSerializable as r}from"../public/serializable.interface.js";import{UUID as i}from"../public/uuidObject.js";import{version as s}from"../public/version.js";import{uninitializeChildCommunication as a,shouldProcessChildMessage as c,handleIncomingMessageFromChild as d}from"./childCommunication.js";import{getMessageIdsAsLogString as u,flushMessageQueue as l}from"./communicationUtils.js";import{GlobalVars as g}from"./globalVars.js";import{callHandler as p}from"./handlers.js";import f from"./hostToAppTelemetry.js";import{serializeMessageRequest as m,deserializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{isFollowingApiVersionTagFormat as v,getLogger as b}from"./telemetry.js";import{getCurrentTimestamp as W,ssrSafeWindow as M}from"./utils.js";import{validateOrigin as y}from"./validOrigins.js";const k=b("communication");class I{}class T{}function E(n,t){if(T.messageListener=n=>function(n){return e(this,void 0,void 0,function*(){if(!n||!n.data||"object"!=typeof n.data)return void J("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,t=n.origin||n.originalEvent&&n.originalEvent.origin;return B(e,t).then(o=>{o?(!function(e,n){g.isFramelessWindow||I.parentWindow&&!I.parentWindow.closed&&e!==I.parentWindow||(I.parentWindow=e,I.parentOrigin=n);I.parentWindow&&I.parentWindow.closed&&(I.parentWindow=null,I.parentOrigin=null);l(I.parentWindow,I.parentOrigin,T.parentMessageQueue,"parent")}(e,t),e!==I.parentWindow?c(e,t)&&d(n,e,V,(e,n)=>T.callbacks.set(e,n)):Y(n)):J("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,t)})})}(n),I.currentWindow=I.currentWindow||M(),I.parentWindow=I.currentWindow.parent!==I.currentWindow.self?I.currentWindow.parent:I.currentWindow.opener,I.topWindow=I.currentWindow.top,(I.parentWindow||n)&&I.currentWindow.addEventListener("message",T.messageListener,!1),!I.parentWindow){const e=I.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));g.isFramelessWindow=!0,e.onNativeMessage=Y}try{return I.parentOrigin="*",S(t,"initialize",[s,o,n]).then(([e,n,t,o])=>(h(o,I.currentWindow,{onMessage:D,sendPostMessage:L}),{context:e,clientType:n,runtimeConfig:t,clientSupportedSDKVersion:o}))}finally{I.parentOrigin=null}}function j(){I.currentWindow&&I.currentWindow.removeEventListener("message",T.messageListener,!1),I.currentWindow=null,I.parentWindow=null,I.parentOrigin=null,T.parentMessageQueue=[],T.nextMessageId=0,T.callbacks.clear(),T.promiseCallbacks.clear(),T.portCallbacks.clear(),T.legacyMessageIdsToUuidMap={},f.clearMessages(),a()}function O(e,n,...t){return S(e,n,t).then(([e])=>e)}function R(e,n,...t){return S(e,n,t).then(([e,n])=>{if(!e)throw new Error(n)})}function C(e,n,t,...o){return S(e,n,o).then(([e,n])=>{if(!e)throw new Error(n||t)})}function P(e,n,...t){return S(e,n,t).then(([e,n])=>{if(e)throw e;return n})}function S(e,n,t=void 0){if(!v(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise(o=>{const r=V(e,n,t);var i;o((i=r.uuid,new Promise(e=>{T.promiseCallbacks.set(i,e)})))})}function x(e){return e.map(e=>r(e)?e.serialize():e)}function N(o,r,i,s,a){var c;return e(this,void 0,void 0,function*(){const e=x(r),[d]=yield S(s,o,e);if(a&&a(d)||!a&&n(d))throw new Error(`${d.errorCode}, message: ${null!==(c=d.message)&&void 0!==c?c:"None"}`);if(i.validate(d))return i.deserialize(d);throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(d)}`)})}function A(o,r,i,s){var a;return e(this,void 0,void 0,function*(){const e=x(r),[c]=yield S(i,o,e);if(s&&s(c)||!s&&n(c))throw new Error(`${c.errorCode}, message: ${null!==(a=c.message)&&void 0!==a?a:"None"}`);if(void 0!==c)throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host`)})}function U(e,n,t=void 0){if(!v(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=V(e,n,t);return r=o.uuid,new Promise((e,n)=>{T.portCallbacks.set(r,(t,o)=>{t instanceof MessagePort?e(t):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))})});var r}function $(e,n,t,o){let r;if(t instanceof Function?o=t:t instanceof Array&&(r=t),!v(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const i=V(e,n,r);o&&T.callbacks.set(i.uuid,o)}T.parentMessageQueue=[],T.topMessageQueue=[],T.nextMessageId=0,T.callbacks=new Map,T.promiseCallbacks=new Map,T.portCallbacks=new Map,T.legacyMessageIdsToUuidMap={};const z=k.extend("sendNestedAuthRequestToTopWindow");function L(e,n){const t=z,o=I.topWindow,r=function(e,n){const t=T.nextMessageId++,o=new i;return T.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),apiVersionTag:n,args:[],data:e}}(e,n);return t("Message %s information: %o",u(r),{actionName:r.func}),F(o,r)}const _=k.extend("sendRequestToTargetWindowHelper");function F(e,n){const t=_,o=function(e){return e===I.topWindow&&Z()?"top":e===I.parentWindow?"parent":null}(e),r=m(n);if(g.isFramelessWindow)I.currentWindow&&I.currentWindow.nativeInterface&&(t("Sending message %s to %s via framelessPostMessage interface",u(r),o),I.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(r)));else{const i=function(e){return e===I.topWindow&&Z()?I.topOrigin:e===I.parentWindow?I.parentOrigin:null}(e);e&&i?(t("Sending message %s to %s via postMessage",u(r),o),e.postMessage(r,i)):(t("Adding message %s to %s message queue",u(r),o),ee(e).push(n))}return n}const Q=k.extend("sendMessageToParentHelper");function V(e,n,t,o,r){const s=Q,a=I.parentWindow,c=function(e,n,t,o,r){const s=T.nextMessageId++,a=new i;T.legacyMessageIdsToUuidMap[s]=a;const c=!0===o?r:g.teamsJsInstanceId;return{id:s,uuid:a,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:t||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o,teamsJsInstanceId:c}}(e,n,t,o,r);return f.storeCallbackInformation(c.uuid,{name:n,calledAt:c.timestamp}),s("Message %s information: %o",u(c),{actionName:n,args:t}),F(a,c)}const J=k.extend("processIncomingMessage");const q=k.extend("processAuthBridgeMessage");function D(e,n){var t,o;const r=q;if(!e||!e.data||"object"!=typeof e.data)return void r("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:i}=e.data,[,s]=null!=i?i:[],a=(()=>{try{return JSON.parse(s)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void r("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.source),d=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);c?B(c,d)?(I.topWindow&&!I.topWindow.closed&&c!==I.topWindow||(I.topWindow=c,I.topOrigin=d),I.topWindow&&I.topWindow.closed&&(I.topWindow=null,I.topOrigin=null),l(I.topWindow,I.topOrigin,T.topMessageQueue,"top"),n(s)):r("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):r("Message being ignored by app because it is coming for a target that is null")}const H=k.extend("shouldProcessIncomingMessage");function B(n,t){return e(this,void 0,void 0,function*(){if(I.currentWindow&&n===I.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(I.currentWindow&&I.currentWindow.location&&t&&t===I.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return H("Message has an invalid origin of %s",t),!1}const n=yield y(e);return n||H("Message has an invalid origin of %s",t),n}})}const K=k.extend("handleIncomingMessageFromParent");function G(e,n){if(n){const t=[...e].find(([e,t])=>e.toString()===n.toString());if(t)return t[0]}}function X(e,n){const t=G(n,e.uuid);t&&n.delete(t),e.uuid?T.legacyMessageIdsToUuidMap={}:delete T.legacyMessageIdsToUuidMap[e.id]}function Y(e){const n=K,t=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,r=w(o),i=function(e){const n=K;if(!e.uuid)return T.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,t=G(T.callbacks,n);if(t)return t;const o=G(T.promiseCallbacks,n);if(o)return o;const r=G(T.portCallbacks,n);if(r)return r}n("Received message %s that failed to produce a callbackId",u(e))}(r);if(i){const o=T.callbacks.get(i);n("Received a response from parent for message %s",i.toString()),f.handlePerformanceMetrics(i,r,n,t),o&&(n("Invoking the registered callback for message %s with arguments %o",i.toString(),r.args),o.apply(null,[...r.args,r.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",i.toString()),X(r,T.callbacks)));const s=T.promiseCallbacks.get(i);s&&(n("Invoking the registered promise callback for message %s with arguments %o",i.toString(),r.args),s(r.args),n("Removing registered promise callback for message %s",i.toString()),X(r,T.promiseCallbacks));const a=T.portCallbacks.get(i);if(a){let t;n("Invoking the registered port callback for message %s with arguments %o",i.toString(),r.args),e.ports&&e.ports[0]instanceof MessagePort&&(t=e.ports[0]),a(t,r.args),n("Removing registered port callback for message %s",i.toString()),X(r,T.portCallbacks)}r.uuid&&(T.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;f.handleOneWayPerformanceMetrics(o,n,t),n('Received a message from parent %s, action: "%s"',u(o),o.func),p(o.func,o.args)}else n("Received an unknown message: %O",e)}function Z(){return I.topWindow!==I.parentWindow}function ee(e){return e===I.topWindow&&Z()?T.topMessageQueue:e===I.parentWindow?T.parentMessageQueue:[]}function ne(e,n){let t;t=I.currentWindow.setInterval(()=>{0===ee(e).length&&(clearInterval(t),n())},100)}export{I as Communication,A as callFunctionInHost,N as callFunctionInHostAndHandleResponse,E as initializeCommunication,U as requestPortFromParentWithVersion,P as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,C as sendAndHandleStatusAndReasonWithDefaultError,O as sendAndUnwrap,$ as sendMessageToParent,S as sendMessageToParentAsync,L as sendNestedAuthRequestToTopWindow,j as uninitializeCommunication,ne as waitForMessageQueue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{
|
|
1
|
+
import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUrlPathForAppInstall as e,teamsDeepLinkUsersUrlParameterName as t,teamsDeepLinkUrlPathForChat as $,teamsDeepLinkTopicUrlParameterName as i,teamsDeepLinkMessageUrlParameterName as r,teamsDeepLinkAttendeesUrlParameterName as d,teamsDeepLinkUrlPathForCalendar as p,teamsDeepLinkStartTimeUrlParameterName as c,teamsDeepLinkEndTimeUrlParameterName as a,teamsDeepLinkSubjectUrlParameterName as m,teamsDeepLinkContentUrlParameterName as s,teamsDeepLinkUrlPathForCall as C,teamsDeepLinkWithVideoUrlParameterName as I,teamsDeepLinkSourceUrlParameterName as l}from"./deepLinkConstants.js";function u(e,d,p){if(0===e.length)throw new Error("Must have at least one user when creating a chat deep link");const c=`${t}=`+e.map(n=>encodeURIComponent(n)).join(","),a=void 0===d?"":`&${i}=${encodeURIComponent(d)}`,m=void 0===p?"":`&${r}=${encodeURIComponent(p)}`;return`${n}://${o}${$}?${c}${a}${m}`}function R(e,$,i){if(0===e.length)throw new Error("Must have at least one target when creating a call deep link");const r=`${t}=`+e.map(n=>encodeURIComponent(n)).join(","),d=void 0===$?"":`&${I}=${encodeURIComponent($)}`,p=void 0===i?"":`&${l}=${encodeURIComponent(i)}`;return`${n}://${o}${C}?${r}${d}${p}`}function U(e,t,$,i,r){const C=void 0===e?"":`${d}=`+e.map(n=>encodeURIComponent(n)).join(","),I=void 0===t?"":`&${c}=${encodeURIComponent(t)}`,l=void 0===$?"":`&${a}=${encodeURIComponent($)}`,u=void 0===i?"":`&${m}=${encodeURIComponent(i)}`,R=void 0===r?"":`&${s}=${encodeURIComponent(r)}`;return`${n}://${o}${p}?${C}${I}${l}${u}${R}`}function h(t){if(!t)throw new Error("App ID must be set when creating an app install dialog deep link");return`${n}://${o}${e}${encodeURIComponent(t)}`}export{h as createTeamsDeepLinkForAppInstallDialog,U as createTeamsDeepLinkForCalendar,R as createTeamsDeepLinkForCall,u as createTeamsDeepLinkForChat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ensureInitialized as t}from"./internalAPIs.js";import{
|
|
1
|
+
import{ensureInitialized as t}from"./internalAPIs.js";import{DialogDimension as e,FrameContexts as o,errorNotSupportedOnPlatform as r}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{sendMessageToParent as i}from"./communication.js";import{GlobalVars as n}from"./globalVars.js";import{registerHandler as a,removeHandler as l}from"./handlers.js";import{getApiVersionTag as m}from"./telemetry.js";import{isSupported as c,getDialogInfoFromUrlDialogInfo as u,getDialogInfoFromBotUrlDialogInfo as d}from"../public/dialog/url/url.js";import{isSupported as g}from"../public/dialog/url/bot.js";import{isSupported as f}from"../public/dialog/update.js";const p="v2";function h(e,n){if(t(s,o.content,o.sidePanel,o.task,o.meetingStage),!f())throw r;i(e,"tasks.updateTask",[n])}function b(e,n,d,g){if(t(s,o.content,o.sidePanel,o.meetingStage),!c())throw r;g&&a(m(p,"dialog.url.registerMessageForParentHandler"),"messageForParent",g);const f=u(n);i(e,"tasks.startTask",[f],(t,e)=>{null==d||d({err:t,result:e}),l("messageForParent")})}function k(e,n,c,u){if(t(s,o.content,o.sidePanel,o.meetingStage),!g())throw r;u&&a(m(p,"dialog.url.bot.registerMessageForParentHandler"),"messageForParent",u);const f=d(n);i(e,"tasks.startTask",[f],(t,e)=>{null==c||c({err:t,result:e}),l("messageForParent")})}function j(e,a,l){if(t(s,o.content,o.task),!c())throw r;n.frameContext===o.content&&console.warn("dialog.submit should not be called from FrameContext.content.\nIf dialog.submit was called from inside the dialog, please disregard this message.\nThis issue occurs due to a bug in Teams mobile where the dialog is incorrectly identified as being in the content FrameContext.\nWe are working to resolve this."),i(e,"tasks.completeTask",[a,l?Array.isArray(l)?l:[l]:[]])}function w(t){return{card:t.card,height:t.size?t.size.height:e.Small,width:t.size?t.size.width:e.Small,title:t.title}}function P(t){const e=w(t);return e.completionBotId=t.completionBotId,e}const F=[];function S(t){n.frameContext&&(n.frameContext===o.task?F.push(t):l("messageForChild"))}export{k as botUrlOpenHelper,p as dialogTelemetryVersionNumber,w as getDialogInfoFromAdaptiveCardDialogInfo,P as getDialogInfoFromBotAdaptiveCardDialogInfo,S as handleDialogMessage,F as storedMessages,h as updateResizeHelper,b as urlOpenHelper,j as urlSubmitHelper};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.
|
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getApiVersionTag as n,getLogger as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{shouldEventBeRelayedToChild as a,sendMessageEventToChild as t}from"./childCommunication.js";import{sendMessageToParent as o}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=r("handlers");class c{static initializeHandlers(){c.handlers.themeChange=x,c.handlers.contextChange=v,c.handlers.load=S,c.handlers.beforeUnload=A,i()}static uninitializeHandlers(){c.handlers={},c.themeChangeHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.contextChangeHandler=null}}function f(){c.initializeHandlers()}function m(){c.uninitializeHandlers()}c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.hostToAppPerformanceMetricsHandler=null,c.contextChangeHandler=null;const H=u.extend("callHandler");function h(e,n){const r=c.handlers[e];if(r){H("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return a()?(t(e,n),[!1,void 0]):(H("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,a=[]){r?(c.handlers[n]=r,l&&o(e,"registerHandler",[n,...a])):delete c.handlers[n]}function g(e){delete c.handlers[e]}function b(e){return null!=c.handlers[e]}function C(e,n,r,a,t){r&&d(l,...a),t&&t(),p(e,n,r)}function U(e,n){c.themeChangeHandler=n,!s(n)&&o(e,"registerHandler",["themeChange"])}function T(e,n){c.contextChangeHandler=n,!s(n)&&o(e,"registerHandler",["contextChange"])}function x(e){c.themeChangeHandler&&c.themeChangeHandler(e),a()&&t("themeChange",[e])}function v(e){c.contextChangeHandler&&c.contextChangeHandler(e),a()&&t("contextChange",[e])}function y(e){c.hostToAppPerformanceMetricsHandler=e}function j(e){c.hostToAppPerformanceMetricsHandler&&c.hostToAppPerformanceMetricsHandler(e)}function O(e,n){c.loadHandler=n,!s(n)&&o(e,"registerHandler",["load"])}function S(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;c.resumeHandler?(c.resumeHandler(n),a()&&t("load",[n])):c.loadHandler&&(c.loadHandler(e),a()&&t("load",[e]))}function _(e,n){c.beforeUnloadHandler=n,!s(n)&&o(e,"registerHandler",["beforeUnload"])}function A(){return e(this,void 0,void 0,function*(){const e=()=>{o(n("v2","handleBeforeUnload"),"readyToUnload",[])};c.beforeSuspendOrTerminateHandler?(yield c.beforeSuspendOrTerminateHandler(),a()?t("beforeUnload"):e()):c.beforeUnloadHandler&&c.beforeUnloadHandler(e)||(a()?t("beforeUnload"):e())})}function P(e){c.beforeSuspendOrTerminateHandler=e,!s(e)&&o(n("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function z(e){c.resumeHandler=e,!s(e)&&o(n("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,v as handleContextChange,j as handleHostToAppPerformanceMetrics,x as handleThemeChange,f as initializeHandlers,P as registerBeforeSuspendOrTerminateHandler,_ as registerBeforeUnloadHandler,p as registerHandler,C as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,T as registerOnContextChangeHandler,O as registerOnLoadHandler,z as registerOnResumeHandler,U as registerOnThemeChangeHandler,g as removeHandler,m as uninitializeHandlers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AppId as i}from"../public/appId.js";import{hasScriptTags as t}from"./utils.js";function n(i){if(!e(i))throw new Error(`Potential app id (${i}) is invalid; its length ${i.length} is not within the length limits (${r}-${a}).`)}function o(i){if(t(i))throw new Error(`Potential app id (${i}) is invalid; it contains script tags.`);if(s(i))throw new Error(`Potential app id (${i}) is invalid; it contains non-printable characters.`)}const r=4,a=256;function e(i){return i.length<a&&i.length>r}function s(i){return[...i].some(
|
|
1
|
+
import{AppId as i}from"../public/appId.js";import{hasScriptTags as t}from"./utils.js";function n(i){if(!e(i))throw new Error(`Potential app id (${i}) is invalid; its length ${i.length} is not within the length limits (${r}-${a}).`)}function o(i){if(t(i))throw new Error(`Potential app id (${i}) is invalid; it contains script tags.`);if(s(i))throw new Error(`Potential app id (${i}) is invalid; it contains non-printable characters.`)}const r=4,a=256;function e(i){return i.length<a&&i.length>r}function s(i){return[...i].some(i=>{const t=i.charCodeAt(0);return t<32||t>126})}function l(t){if(!(t instanceof i))throw new Error(`Potential app id (${t}) is invalid; it is not an instance of AppId class.`)}export{s as doesStringContainNonPrintableCharacters,e as isStringWithinAppIdLengthLimits,a as maximumValidAppIdLength,r as minimumValidAppIdLength,l as validateAppIdInstance,o as validateSafeContent,n as validateStringLength};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as e}from"../public/runtime.js";import{
|
|
1
|
+
import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as e}from"../public/runtime.js";import{defaultSDKVersionForCompatCheck as n,errorLibraryNotInitialized as o,userOriginUrlValidationRegExp as r}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{getLogger as s}from"./telemetry.js";import{compareSDKVersions as a}from"./utils.js";const f=s("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function p(){if(!l.initializeCalled)throw c(o),new Error(o)}function m(i,...t){if(!l.initializeCompleted)throw d("%s. initializeCalled: %s",o,l.initializeCalled.toString()),new Error(o);if(t&&t.length>0){let i=!1;for(let e=0;e<t.length;e++)if(t[e]===l.frameContext){i=!0;break}if(!i)throw new Error(`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${l.frameContext}".`)}return e(i)}function u(i=n){const t=a(l.clientSupportedSDKVersion,i);return!isNaN(t)&&t>=0}function C(){return l.hostClientType==i.android||l.hostClientType==i.ios||l.hostClientType==i.ipados||l.hostClientType==i.visionOS}function h(i=n){if(!C()){throw{errorCode:t.NOT_SUPPORTED_ON_PLATFORM}}if(!u(i)){throw{errorCode:t.OLD_PLATFORM}}}function w(i){let t=l.additionalValidOrigins.concat(i.filter(i=>"string"==typeof i&&r.test(i)));const e={};t=t.filter(i=>!e[i]&&(e[i]=!0,!0)),l.additionalValidOrigins=t}export{p as ensureInitializeCalled,m as ensureInitialized,u as isCurrentSDKVersionAtLeast,C as isHostClientMobile,w as processAdditionalValidOrigins,h as throwExceptionIfMobileApiIsNotSupported};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.
|
|
1
|
+
import{__rest as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{CartStatus as e}from"../public/marketplace.js";import t from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(r){try{return r.cartItems=s(r.cartItems),r}catch(r){throw new Error("Error deserializing cart")}}function s(r){return r.map(r=>{if(r.imageURL){const e=new URL(r.imageURL);r.imageURL=e}return r.accessories&&(r.accessories=s(r.accessories)),r})}const i=e=>{try{return e.map(e=>{const{imageURL:t,accessories:o}=e,s=r(e,["imageURL","accessories"]),n=Object.assign({},s);return t&&(n.imageURL=t.href),o&&(n.accessories=i(o)),n})}catch(r){throw new Error("Error serializing cart items")}};function n(r){if(!Array.isArray(r)||0===r.length)throw new Error("cartItems must be a non-empty array");for(const e of r)c(e),a(e.accessories)}function a(r){if(null!=r){if(!Array.isArray(r)||0===r.length)throw new Error("CartItem.accessories must be a non-empty array");for(const e of r){if(e.accessories)throw new Error("Item in CartItem.accessories cannot have accessories");c(e)}}}function c(r){if(!r.id)throw new Error("cartItem.id must not be empty");if(!r.name)throw new Error("cartItem.name must not be empty");u(r.price),f(r.quantity)}function m(r){if(null!=r){if(!r)throw new Error("id must not be empty");if(!1===t(r))throw new Error("id must be a valid UUID")}}function u(r){if("number"!=typeof r||r<0)throw new Error(`price ${r} must be a number not less than 0`);if(parseFloat(r.toFixed(3))!==r)throw new Error(`price ${r} must have at most 3 decimal places`)}function f(r){if("number"!=typeof r||r<=0||parseInt(r.toString())!==r)throw new Error(`quantity ${r} must be an integer greater than 0`)}function p(r){if(!Object.values(e).includes(r))throw new Error(`cartStatus ${r} is not valid`)}export{o as deserializeCart,s as deserializeCartItems,i as serializeCartItems,a as validateAccessoryItems,c as validateBasicCartItem,n as validateCartItems,p as validateCartStatus,u as validatePrice,f as validateQuantity,m as validateUuid};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{FileFormat as e,MediaType as n}from"../public/media.js";import{videoAndImageMediaAPISupportVersion as t,nonFullScreenVideoModeAPISupportVersion as r,imageOutputFormatsAPISupportVersion as l}from"./constants.js";import{throwExceptionIfMobileApiIsNotSupported as o}from"./internalAPIs.js";function u(e,n){if(null==e||null==n||e.length<=0)return null;let t=null,r=1;return e.sort((e,n)=>e.sequence>n.sequence?1:-1),e.forEach(e=>{e.sequence==r&&(t=t?new Blob([t,e.file],{type:n}):new Blob([e.file],{type:n}),r++)}),t}function i(e,n){if(null==e||null==n)return null;const t=atob(e.chunk),r=new Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const l=new Uint8Array(r),o=new Blob([l],{type:n});return{sequence:e.chunkSequence,file:o}}function c(e){s(e)?o(t):p(e)?o(r):d(e)&&o(l)}function a(e){return!(e.mediaType!=n.Video||!e.videoProps||!e.videoProps.videoController)}function f(e){return!(null==e||e.maxMediaCount>10)}function d(e){var t;return!((null==e?void 0:e.mediaType)!=n.Image||!(null===(t=null==e?void 0:e.imageProps)||void 0===t?void 0:t.imageOutputFormats))}function s(e){return!(!e||e.mediaType!=n.VideoAndImage&&!e.videoAndImageProps)}function p(e){return!(!e||e.mediaType!=n.Video||!e.videoProps||e.videoProps.isFullScreenMode)}function m(n,t,r){return null!=n&&null!=t&&t==e.ID&&null!=r}function I(e){return!(null==e||e.length<=0||e.length>10)}function v(e){return!e||!(null===e.timeOutIntervalInSec||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec<=0||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec>60)}function g(e){if(e){if(e.title&&"string"!=typeof e.title)return!1;if(e.setSelected&&"object"!=typeof e.setSelected)return!1;if(e.openOrgWideSearchInChatOrChannel&&"boolean"!=typeof e.openOrgWideSearchInChatOrChannel)return!1;if(e.singleSelect&&"boolean"!=typeof e.singleSelect)return!1}return!0}export{u as createFile,i as decodeAttachment,d as isMediaCallForImageOutputFormats,p as isMediaCallForNonFullScreenVideoMode,s as isMediaCallForVideoAndImageInputs,a as isVideoControllerRegistered,c as throwExceptionIfMediaCallIsNotSupportedOnMobile,m as validateGetMediaInputs,g as validatePeoplePickerInput,v as validateScanBarCodeInput,f as validateSelectMediaInputs,I as validateViewImagesInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.
|
|
1
|
+
import{__rest as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{UUID as t}from"../public/uuidObject.js";const u=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})},s=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},n=u=>{const{uuidAsString:s}=u,n=i(u,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:s?new t(s):void 0})},r=t=>{const{uuid:u}=t,s=i(t,["uuid"]),n=null==u?void 0:u.toString();return Object.assign(Object.assign({},s),{uuidAsString:n})};export{s as deserializeMessageRequest,n as deserializeMessageResponse,u as serializeMessageRequest,r as serializeMessageResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AppId as t}from"../public/appId.js";import{
|
|
1
|
+
import{AppId as t}from"../public/appId.js";import{errorNotSupportedOnPlatform as e,FrameContexts as n}from"../public/constants.js";import{isSupported as i}from"../public/pages/pages.js";import{runtime as r}from"../public/runtime.js";import{shouldEventBeRelayedToChild as o,sendMessageEventToChild as s}from"./childCommunication.js";import{sendAndUnwrap as a,sendMessageToParent as c,sendAndHandleStatusAndReasonWithDefaultError as u,sendAndHandleStatusAndReason as p}from"./communication.js";import{registerHandler as m}from"./handlers.js";import{ensureInitialized as f}from"./internalAPIs.js";import{getApiVersionTag as g}from"./telemetry.js";import{isSupported as b}from"../public/pages/tabs.js";import{isSupported as l,navigateBack as d}from"../public/pages/backStack.js";import{isSupported as w}from"../public/pages/config.js";const h="v2";function P(t,o){return new Promise(s=>{if(f(r,n.content,n.sidePanel,n.settings,n.remove,n.task,n.stage,n.meetingStage),!i())throw e;s(u(t,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",o))})}function j(t){return new Promise(n=>{if(f(r),!l())throw e;n(u(t,"navigateBack","Back navigation is not supported in the current client or context."))})}function v(t,n){return new Promise(i=>{if(f(r),!b())throw e;i(u(t,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",n))})}function I(t,n){if(f(r),!i())throw e;c(t,"returnFocus",[n])}function S(t,n){return new Promise(i=>{if(f(r),!b())throw e;i(a(t,"getTabInstances",n))})}function k(t,n){return new Promise(i=>{if(f(r),!b())throw e;i(a(t,"getMruTabInstances",n))})}function U(t,o){if(f(r,n.content,n.sidePanel,n.meetingStage),!i())throw e;c(t,"shareDeepLink",[o.subPageId,o.subPageLabel,o.subPageWebUrl])}function B(t,o){if(f(r,n.content),!i())throw e;c(t,"setFrameContext",[o])}function T(t,i){if(f(r,n.settings,n.remove),!w())throw e;c(t,"settings.setValidityState",[i])}function C(t){return new Promise(o=>{if(f(r,n.content,n.settings,n.remove,n.sidePanel),!i())throw e;o(a(t,"settings.getSettings"))})}function L(t,i){return new Promise(o=>{if(f(r,n.content,n.settings,n.sidePanel),!w())throw e;o(p(t,"settings.setSettings",i))})}function O(e){return e.appId instanceof t}function x(e){return Object.assign(Object.assign({},e),{appId:new t(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}function y(t){return Object.assign(Object.assign({},t),{appId:t.appId.toString(),webUrl:t.webUrl?t.webUrl.toString():void 0})}let D;function F(t){D=t}function R(){m(g("v2","pages.backStack.registerBackButtonPressHandler"),"backButtonPress",A,!1)}function A(){D&&D()||(o()?s("backButtonPress",[]):d())}export{j as backStackNavigateBackHelper,L as configSetConfigHelper,T as configSetValidityStateHelper,y as convertAppNavigationParametersToNavigateToAppParams,x as convertNavigateToAppParamsToAppNavigationParameters,C as getConfigHelper,k as getMruTabInstancesHelper,S as getTabInstancesHelper,R as initializeBackStackHelper,O as isAppNavigationParametersObject,P as navigateCrossDomainHelper,h as pagesTelemetryVersionNumber,I as returnFocusHelper,F as setBackButtonPressHandler,B as setCurrentFrameHelper,U as shareDeepLinkHelper,v as tabsNavigateToTabHelper};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Buffer as t}from"../../../../_virtual/_polyfill-node.buffer.js";import{minAdaptiveCardVersion as e}from"../public/constants.js";import{LegalAgeGroupClassification as n}from"../public/interfaces.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import o from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function i(t){return(t,e)=>{if(!t)throw new Error(e)}}function s(t,e){if("string"!=typeof t||"string"!=typeof e)return NaN;const n=t.split("."),r=e.split(".");function o(t){return/^\d+$/.test(t)}if(!n.every(o)||!r.every(o))return NaN;for(;n.length<r.length;)n.push("0");for(;r.length<n.length;)r.push("0");for(let t=0;t<n.length;++t)if(Number(n[t])!=Number(r[t]))return Number(n[t])>Number(r[t])?1:-1;return 0}function u(){return r()}function c(t){return Object.keys(t).forEach(
|
|
1
|
+
import{Buffer as t}from"../../../../_virtual/_polyfill-node.buffer.js";import{minAdaptiveCardVersion as e}from"../public/constants.js";import{LegalAgeGroupClassification as n}from"../public/interfaces.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import o from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function i(t){return(t,e)=>{if(!t)throw new Error(e)}}function s(t,e){if("string"!=typeof t||"string"!=typeof e)return NaN;const n=t.split("."),r=e.split(".");function o(t){return/^\d+$/.test(t)}if(!n.every(o)||!r.every(o))return NaN;for(;n.length<r.length;)n.push("0");for(;r.length<n.length;)r.push("0");for(let t=0;t<n.length;++t)if(Number(n[t])!=Number(r[t]))return Number(n[t])>Number(r[t])?1:-1;return 0}function u(){return r()}function c(t){return Object.keys(t).forEach(e=>{null!==t[e]&&void 0!==t[e]&&"object"==typeof t[e]&&c(t[e])}),Object.freeze(t)}function a(t,e,...n){const r=t(...n);return r.then(t=>{e&&e(void 0,t)}).catch(t=>{e&&e(t)}),r}function l(t,e,...n){const r=t(...n);return r.then(()=>{e&&e(null)}).catch(t=>{e&&e(t)}),r}function f(t,e,...n){const r=t(...n);return r.then(t=>{e&&e(null,t)}).catch(t=>{e&&e(t,null)}),r}function p(t,e,n){return new Promise((r,o)=>{const i=setTimeout(o,e,n);t().then(t=>{clearTimeout(i),r(t)}).catch(t=>{clearTimeout(i),o(t)})})}function d(t){const e=new URL("https://teams.microsoft.com/l/entity/"+encodeURIComponent(t.appId.toString())+"/"+encodeURIComponent(t.pageId));return t.webUrl&&e.searchParams.append("webUrl",t.webUrl.toString()),(t.chatId||t.channelId||t.subPageId)&&e.searchParams.append("context",JSON.stringify({chatId:t.chatId,channelId:t.channelId,subEntityId:t.subPageId})),e.toString()}function m(t){return!(s(`${t.majorVersion}.${t.minorVersion}`,`${e.majorVersion}.${e.minorVersion}`)>=0)}function h(t){return"https:"===t.protocol}function b(e,n){return new Promise((r,o)=>{if(e||o("MimeType cannot be null or empty."),n||o("Base64 string cannot be null or empty."),e.startsWith("image/")){const t=atob(n),o=new Uint8Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);r(new Blob([o],{type:e}))}const i=t.from(n,"base64").toString();r(new Blob([i],{type:e}))})}function g(t){return new Promise((e,n)=>{0===t.size&&n(new Error("Blob cannot be empty."));const r=new FileReader;r.onloadend=()=>{r.result?e(r.result.toString().split(",")[1]):n(new Error("Failed to read the blob"))},r.onerror=()=>{n(r.error)},r.readAsDataURL(t)})}function w(){if(y())throw new Error("window object undefined at SSR check");return window}function y(){return"undefined"==typeof window}function j(t,e){if(E(t)||!function(t){return t.length<256&&t.length>4}(t)||!function(t){for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n<32||n>126)return!1}return!0}(t))throw e||new Error("id is not valid.")}function I(t,e){const n=t.toString().toLocaleLowerCase();if(E(n))throw new Error("Invalid Url");if(n.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!h(t))throw new Error("Url should be a valid https url")}function v(t){const e=document.createElement("a");return e.href=t,new URL(e.href)}function E(t){return new RegExp(`${/<script[^>]*>|<script[^&]*>|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|<\/script[^&]*>|%3C\/script[^%]*%3E/gi.source}`,"gi").test(t)}function O(t){if(!t)throw new Error("id must not be empty");if(!1===o(t))throw new Error("id must be a valid UUID")}const U=!!performance&&"now"in performance;function N(){return U?performance.now()+performance.timeOrigin:void 0}function S(t,e=0){if(e>1e3)return!1;if(void 0===t||"boolean"==typeof t||"number"==typeof t||"bigint"==typeof t||"string"==typeof t||null===t)return!0;if(Array.isArray(t))return t.every(t=>S(t,e+1));return!("object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t)||Object.getPrototypeOf(t)!==Object.prototype&&null!==Object.getPrototypeOf(t))&&Object.keys(t).every(n=>S(t[n],e+1))}function P(t){var e,r;if(!(null===(r=null===(e=t.hostVersionsInfo)||void 0===e?void 0:e.appEligibilityInformation)||void 0===r?void 0:r.ageGroup))return t;const o=t.hostVersionsInfo.appEligibilityInformation.ageGroup;return"nonadult"!==(null==o?void 0:o.toLowerCase())?t:Object.assign(Object.assign({},t),{hostVersionsInfo:Object.assign(Object.assign({},t.hostVersionsInfo),{appEligibilityInformation:Object.assign(Object.assign({},t.hostVersionsInfo.appEligibilityInformation),{ageGroup:n.NotAdult})})})}export{b as base64ToBlob,a as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,f as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,l as callCallbackWithSdkErrorFromPromiseAndReturnPromise,s as compareSDKVersions,d as createTeamsAppLink,c as deepFreeze,v as fullyQualifyUrlString,u as generateGUID,g as getBase64StringFromBlob,N as getCurrentTimestamp,i as getGenericOnCompleteHandler,E as hasScriptTags,y as inServerSideRenderingEnvironment,m as isHostAdaptiveCardSchemaVersionUnsupported,S as isPrimitiveOrPlainObject,h as isValidHttpsURL,P as normalizeAgeGroupValue,p as runWithTimeout,w as ssrSafeWindow,j as validateId,I as validateUrl,O as validateUuid};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.
|
|
1
|
+
import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{ORIGIN_LIST_FETCH_TIMEOUT_IN_MS as t,validOriginsCdnEndpoint as r,validOriginsFallback as n}from"./constants.js";import{GlobalVars as e}from"./globalVars.js";import{getLogger as o}from"./telemetry.js";import{inServerSideRenderingEnvironment as l,isValidHttpsURL as s}from"./utils.js";let a=[];const u=o("validateOrigin");let c;function f(){return i(this,void 0,void 0,function*(){c||(yield g())})}function d(){return 0===a.length}function g(e=!1){return i(this,void 0,void 0,function*(){if(!d()&&!e)return a;if(c)return c;if(l())return a=n,n;{u("Initiating fetch call to acquire valid origins list from CDN");const i=new AbortController,e=setTimeout(()=>i.abort(),t);return c=fetch(r,{signal:i.signal}).then(i=>{if(clearTimeout(e),!i.ok)throw new Error("Invalid Response from Fetch Call");return u("Fetch call completed and retrieved valid origins list from CDN"),i.json().then(i=>{if(function(i){let t=JSON.parse(i);try{t=JSON.parse(i)}catch(i){return!1}if(!t.validOrigins)return!1;for(const i of t.validOrigins)try{new URL("https://"+i)}catch(t){return u("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}return!0}(JSON.stringify(i)))return a=i.validOrigins,a;throw new Error("Valid origins list retrieved from CDN is invalid")})}).catch(i=>("AbortError"===i.name?u(`validOrigins fetch call to CDN failed due to Timeout of ${t} ms. Defaulting to fallback list`):u("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),a=n,a)),c}})}function p(i,t){if("*."===i.substring(0,2)){const r=i.substring(1);if(t.length>r.length&&t.split(".").length===r.split(".").length&&t.substring(t.length-r.length)===r)return!0}else if(i===t)return!0;return!1}function h(i,t){const r=d()?n:a;return m(i,r)?Promise.resolve(!0):(u("Origin %s is not in the local valid origins list, fetching from CDN",i),g(t).then(t=>m(i,t)))}function m(i,t){if(!s(i))return u("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1;const r=i.host;if(t.some(i=>p(i,r)))return!0;for(const i of e.additionalValidOrigins){if(p("https://"===i.substring(0,8)?i.substring(8):i,r))return!0}return u("Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o",i,t,e.additionalValidOrigins),!1}f();export{f as prefetchOriginsFromCDN,h as validateOrigin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.
|
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{errorNotSupportedOnPlatform as t}from"../public/constants.js";import{EffectFailureReason as r}from"../public/videoEffects.js";import{sendMessageToParent as i}from"./communication.js";import{registerHandler as o}from"./handlers.js";import{getApiVersionTag as a}from"./telemetry.js";import{inServerSideRenderingEnvironment as n,ssrSafeWindow as s}from"./utils.js";const d="v2";function h(t,r,i,o){var a,s;return e(this,void 0,void 0,function*(){const e=f();!n()&&(null===(s=null===(a=window.chrome)||void 0===a?void 0:a.webview)||void 0===s||s.registerTextureStream(t,e)),l(yield u(t,i,o),new m(i,r),e.writable)})}function c(t,r,i,o){var a,s;return e(this,void 0,void 0,function*(){const e=f();!n()&&(null===(s=null===(a=window.chrome)||void 0===a?void 0:a.webview)||void 0===s||s.registerTextureStream(t,e)),l(yield u(t,i,o),new v(i,r),e.writable)})}function u(r,i,o){return e(this,void 0,void 0,function*(){if(n())throw t;const e=s().chrome;try{null==o||o.reportGettingTextureStream(r);const t=(yield e.webview.getTextureStream(r)).getVideoTracks();if(0===t.length)throw new Error(`No video track in stream ${r}`);return null==o||o.reportTextureStreamAcquired(),t[0]}catch(e){throw i(`Failed to get video track from stream ${r}, error: ${e}`),new Error(`Internal error: can't get video track from stream ${r}`)}})}function f(){if(n())throw t;const e=window.MediaStreamTrackGenerator;if(!e)throw t;return new e({kind:"video"})}function l(e,t,r){new(0,s().MediaStreamTrackProcessor)({track:e}).readable.pipeThrough(new TransformStream(t)).pipeTo(r)}class m{constructor(t,r){this.notifyError=t,this.videoFrameHandler=r,this.transform=(t,r)=>e(this,void 0,void 0,function*(){const e=t.timestamp;if(null!==e)try{const i=yield this.videoFrameHandler({videoFrame:t}),o=new VideoFrame(i,{timestamp:e});r.enqueue(o),t.close(),i.close()}catch(e){t.close(),this.notifyError(e)}else this.notifyError("timestamp of the original video frame is null")})}}class w{constructor(e,t){if(this.headerBuffer=e,this.notifyError=t,this.ONE_TEXTURE_INPUT_ID=1869900081,this.INVALID_HEADER_ERROR="Invalid video frame header",this.UNSUPPORTED_LAYOUT_ERROR="Unsupported texture layout",this.headerDataView=new Uint32Array(e),this.headerDataView.length<8)throw this.notifyError(this.INVALID_HEADER_ERROR),new Error(this.INVALID_HEADER_ERROR);if(this.headerDataView[0]!==this.ONE_TEXTURE_INPUT_ID)throw this.notifyError(this.UNSUPPORTED_LAYOUT_ERROR),new Error(this.UNSUPPORTED_LAYOUT_ERROR)}get oneTextureLayoutId(){return this.headerDataView[0]}get version(){return this.headerDataView[1]}get frameRowOffset(){return this.headerDataView[2]}get frameFormat(){return this.headerDataView[3]}get frameWidth(){return this.headerDataView[4]}get frameHeight(){return this.headerDataView[5]}get multiStreamHeaderRowOffset(){return this.headerDataView[6]}get multiStreamCount(){return this.headerDataView[7]}}class E{constructor(e,t){this.metadataMap=new Map,this.AUDIO_INFERENCE_RESULT_STREAM_ID=828664161,this.ATTRIBUTE_ID_MAP_STREAM_ID=1296320833;const r=new Uint32Array(e);for(let i=0,o=0;i<t;i++){const t=r[o++],i=r[o++],a=r[o++],n=new Uint8Array(e,i,a);this.metadataMap.set(t,n)}}get audioInferenceResult(){return this.metadataMap.get(this.AUDIO_INFERENCE_RESULT_STREAM_ID)}get attributes(){const e=this.metadataMap.get(this.ATTRIBUTE_ID_MAP_STREAM_ID);if(void 0===e)return;const t=new Map,r=new TextDecoder("utf-8");let i=0;const o=e[i]+(e[++i]<<8)+(e[++i]<<16)+(e[++i]<<24);for(let a=0;a<o&&i<e.length-1;a++){const o=e[++i]+(e[++i]<<8)+(e[++i]<<16)+(e[++i]<<24),a=e.findIndex((e,t,r)=>0==e&&t>i),n=r.decode(e.slice(++i,a)),s=this.metadataMap.get(o);void 0!==s&&t.set(n,s);i=a+(4-(a-i)%4-1)}return t}}class v{constructor(r,i){this.notifyError=r,this.videoFrameHandler=i,this.shouldDiscardAudioInferenceResult=!1,this.transform=(t,r)=>e(this,void 0,void 0,function*(){const e=t.timestamp;if(null!==e)try{const{videoFrame:i,metadata:{audioInferenceResult:o,attributes:a}={}}=yield this.extractVideoFrameAndMetadata(t),n=yield this.videoFrameHandler({videoFrame:i,audioInferenceResult:o,attributes:a}),s=new VideoFrame(n,{timestamp:e});r.enqueue(s),i.close(),t.close(),n.close()}catch(e){t.close(),this.notifyError(e)}else this.notifyError("timestamp of the original video frame is null")}),this.extractVideoFrameAndMetadata=r=>e(this,void 0,void 0,function*(){if(n())throw t;if("NV12"!==r.format)throw this.notifyError("Unsupported video frame pixel format"),new Error("Unsupported video frame pixel format");const e={x:0,y:0,width:r.codedWidth,height:2},i=new ArrayBuffer(e.width*e.height*3/2);yield r.copyTo(i,{rect:e});const o=new w(i,this.notifyError),a={x:0,y:o.multiStreamHeaderRowOffset,width:r.codedWidth,height:r.codedHeight-o.multiStreamHeaderRowOffset},s=new ArrayBuffer(a.width*a.height*3/2);yield r.copyTo(s,{rect:a});const d=new E(s,o.multiStreamCount);return{videoFrame:new VideoFrame(r,{timestamp:r.timestamp,visibleRect:{x:0,y:o.frameRowOffset,width:o.frameWidth,height:o.frameHeight}}),metadata:{audioInferenceResult:this.shouldDiscardAudioInferenceResult?void 0:d.audioInferenceResult,attributes:d.attributes}}}),o(a(d,"videoEffectsUtils.transformerWithMetadata.constructor"),"video.mediaStream.audioInferenceDiscardStatusChange",({discardAudioInferenceResult:e})=>{this.shouldDiscardAudioInferenceResult=e})}}function p(e,t){return(o,n)=>{null==t||t.reportApplyingVideoEffect(o||"",n),e(o,n).then(()=>{null==t||t.reportVideoEffectChanged(o||"",n),i(a(d,"videoEffectsUtils.reportVideoEffectChanged"),"video.videoEffectReadiness",[!0,o,void 0,n])}).catch(e=>{const t=e in r?e:r.InitializationFailure;i(a(d,"videoEffectsUtils.effectFailure"),"video.videoEffectReadiness",[!1,o,t,n])})}}export{p as createEffectParameterChangeCallback,h as processMediaStream,c as processMediaStreamWithMetadata};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{generateGUID as t}from"./utils.js";class e{static setTimeout(s,a){const o=performance.now(),c=t();return e.setTimeoutCallbacks[c]={callback:s,timeoutInMs:a,startedAtInMs:o},c}static clearTimeout(t){delete e.setTimeoutCallbacks[t]}static setInterval(t,s){e.setTimeout(
|
|
1
|
+
import{generateGUID as t}from"./utils.js";class e{static setTimeout(s,a){const o=performance.now(),c=t();return e.setTimeoutCallbacks[c]={callback:s,timeoutInMs:a,startedAtInMs:o},c}static clearTimeout(t){delete e.setTimeoutCallbacks[t]}static setInterval(t,s){e.setTimeout(function a(){t(),e.setTimeout(a,s)},s)}static tick(){const t=performance.now(),s=[];for(const a in e.setTimeoutCallbacks){const o=e.setTimeoutCallbacks[a];t-o.startedAtInMs>=o.timeoutInMs&&s.push(a)}for(const t of s){e.setTimeoutCallbacks[t].callback(),delete e.setTimeoutCallbacks[t]}}}e.setTimeoutCallbacks={};export{e as VideoFrameTick};
|