@mescius/wijmo.pdf.security 5.20261.45-nightly.d20260106.t072437 → 5.20261.45-nightly.d20260108.t163148

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.45-nightly.d20260106.t072437
3
+ * Wijmo Library 5.20261.45-nightly.d20260108.t163148
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- "use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.pdf.security"));var K_MAX_LENGTH=2147483647;function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError(`The value "${e}" is invalid for option "size"`);var t=new Uint8Array(e);Object.setPrototypeOf(t,Buffer.prototype);return t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}exports.Buffer=Buffer;function from(e,t,r){if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var o=fromObject(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}Buffer.from=(e,t,r)=>from(e,t,r);Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError(`The value "${e}" is invalid for option "size"`)}function allocUnsafe(e){assertSize(e);return createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){var t=e.length<0?0:0|checked(e.length),r=createBuffer(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(e){if(Buffer.isBuffer(e)){const t=0|checked(e.length),r=createBuffer(t);if(0===r.length)return r;e.copy(r,0,0,t);return r}return void 0!==e.length?"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e):"Buffer"===e.type&&Array.isArray(e.data)?fromArrayLike(e.data):void 0}function checked(e){if(e>=K_MAX_LENGTH)throw new RangeError(`Attempt to allocate Buffer larger than maximum size: 0x${K_MAX_LENGTH.toString(16)} bytes`);return 0|e}Buffer.isBuffer=function isBuffer(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype};function slowToString(e,t,r){var n=!1;(void 0===t||t<0)&&(t=0);if(t>this.length)return"";(void 0===r||r>this.length)&&(r=this.length);if(r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";e||(e="utf8");for(;;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var e=this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)};function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){const t=e[o];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1];if(128==(192&r)){c=(31&t)<<6|63&r;c>127&&(i=c)}break;case 3:r=e[o+1];n=e[o+2];if(128==(192&r)&&128==(192&n)){c=(15&t)<<12|(63&r)<<6|63&n;c>2047&&(c<55296||c>57343)&&(i=c)}break;case 4:r=e[o+1];n=e[o+2];a=e[o+3];if(128==(192&r)&&128==(192&n)&&128==(192&a)){c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a;c>65535&&c<1114112&&(i=c)}}}if(null===i){i=65533;s=1}else if(i>65535){i-=65536;n.push(i>>>10&1023|55296);i=56320|1023&i}n.push(i);o+=s}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){const t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;){const o=Math.min(n+MAX_ARGUMENTS_LENGTH,t);r+=String.fromCharCode.apply(String,e.slice(n,o));n=o}return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0);(!r||r<0||r>n)&&(r=n);var o="";for(let n=t;n<r;++n)o+=hexSliceLookupTable[e[n]];return o}function utf16leSlice(e,t,r){var n=e.slice(t,r),o="";for(let e=0;e<n.length;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}Buffer.prototype.slice=function slice(e,t){var r,n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n);t<e&&(t=e);return r=this.subarray(e,t)(Object).setPrototypeOf(r,Buffer.prototype)};Buffer.prototype.copy=function copy(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");r||(r=0);n||0===n||(n=this.length);t>=e.length&&(t=e.length);t||(t=0);n>0&&n<r&&(n=r);if(n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);e.length-t<n-r&&(n=e.length-t+r);var o=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(let n=o-1;n>=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return o};function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}var hexSliceLookupTable=(()=>{var e=new Array(256);for(let t=0;t<16;++t){const r=16*t;for(let n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n]}return e})();function inRange(e,t){if(e<t[0])return!1;let r=0,n=t.length/2;for(;r<=n;){const o=Math.floor((r+n)/2),i=2*o;if(e>=t[i]&&e<=t[i+1])return!0;e>t[i+1]?r=o+1:n=o-1}return!1}exports.inRange=inRange;const unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];exports.isUnassignedCodePoint=e=>inRange(e,unassigned_code_points);const commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];exports.isCommonlyMappedToNothing=e=>inRange(e,commonly_mapped_to_nothing);const non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];exports.isNonASCIISpaceCharacter=e=>inRange(e,non_ASCII_space_characters);const non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];exports.isProhibitedCharacter=e=>inRange(e,non_ASCII_space_characters)||inRange(e,prohibited_characters)||inRange(e,non_ASCII_controls_characters)||inRange(e,non_character_codepoints);const bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];exports.isBidirectionalRAL=e=>inRange(e,bidirectional_r_al);const bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];exports.isBidirectionalL=e=>inRange(e,bidirectional_l);const mapping2space=exports.isNonASCIISpaceCharacter,mapping2nothing=exports.isCommonlyMappedToNothing,getCodePoint=e=>e.codePointAt(0),first=e=>e[0],last=e=>e[e.length-1];function toCodePoints(e){const t=[],r=e.length;for(let n=0;n<r;n+=1){const o=e.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){const r=e.charCodeAt(n+1);if(r>=56320&&r<=57343){t.push(1024*(o-55296)+r-56320+65536);n+=1;continue}}t.push(o)}return t}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);{let e=[],t=0,r="";for(let n=0,o=arguments.length;n!==o;++n){let o=+arguments[n];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);if(o<=65535)t=e.push(o);else{o-=65536;t=e.push(55296+(o>>10),o%1024+56320)}if(t>=16383){r+=String.fromCharCode.apply(null,e);e.length=0}}return r+String.fromCharCode.apply(null,e)}}function saslprep(e,t={}){if("string"!=typeof e)throw new TypeError("Expected string.");if(0===e.length)return"";const r=toCodePoints(e).map(e=>mapping2space(e)?32:e).filter(e=>!mapping2nothing(e)),n=fromCodePoint.apply(null,r).normalize("NFKC"),o=toCodePoints(n);if(o.some(exports.isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==t.allowUnassigned){if(o.some(exports.isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}const i=o.some(exports.isBidirectionalRAL),s=o.some(exports.isBidirectionalL);if(i&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");const a=exports.isBidirectionalRAL(getCodePoint(n[0]));const c=exports.isBidirectionalRAL(getCodePoint(last(n)));if(i&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}exports.saslprep=saslprep;exports.CryptoJS=function(e,t){var r;"undefined"!=typeof window&&window.crypto&&(r=window.crypto);!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto);var cryptoSecureRandomInt=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(e){var t;F.prototype=e;t=new F;F.prototype=null;return t}}(),o={},i=o.lib={},s=i.Base={extend:function(e){var t=n(this);e&&t.mixIn(e);t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)});t.init.prototype=t;t.$super=this;return t},create:function(){var e=this.extend();e.init.apply(e,arguments);return e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=s.extend({init:function(e,t){e=this.words=e||[];this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;this.clamp();if(n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)t[n+i>>>2]=r[i>>>2];this.sigBytes+=o;return this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8;t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);e.words=this.words.slice(0);return e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(cryptoSecureRandomInt());return new a.init(t,e)}}),c=o.enc={},f=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16));n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},u=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e));this._data.concat(e);this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,c=i/(4*s),f=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*s,u=e.min(4*f,i);if(f){for(var p=0;p<f;p+=s)this._doProcessBlock(o,p);r=o.splice(0,f);n.sigBytes-=u}return new a.init(r,u)},clone:function(){var e=s.clone.call(this);e._data=this._data.clone();return e},_minBufferSize:0}),l=(i.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e);this.reset()},reset:function(){h.reset.call(this);this._doReset()},update:function(e){this._append(e);this._process();return this},finalize:function(e){e&&this._append(e);return this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new l.HMAC.init(e,r).finalize(t)}}}),o.algo={});return o}(Math);!function(e){var t=exports.CryptoJS,r=t.lib,n=r.WordArray,o=r.Hasher,i=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=i.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],f=e[t+2],u=e[t+3],p=e[t+4],h=e[t+5],l=e[t+6],d=e[t+7],y=e[t+8],g=e[t+9],_=e[t+10],m=e[t+11],S=e[t+12],v=e[t+13],w=e[t+14],C=e[t+15],B=i[0],x=i[1],A=i[2],R=i[3];B=FF(B,x,A,R,a,7,s[0]);R=FF(R,B,x,A,c,12,s[1]);A=FF(A,R,B,x,f,17,s[2]);x=FF(x,A,R,B,u,22,s[3]);B=FF(B,x,A,R,p,7,s[4]);R=FF(R,B,x,A,h,12,s[5]);A=FF(A,R,B,x,l,17,s[6]);x=FF(x,A,R,B,d,22,s[7]);B=FF(B,x,A,R,y,7,s[8]);R=FF(R,B,x,A,g,12,s[9]);A=FF(A,R,B,x,_,17,s[10]);x=FF(x,A,R,B,m,22,s[11]);B=FF(B,x,A,R,S,7,s[12]);R=FF(R,B,x,A,v,12,s[13]);A=FF(A,R,B,x,w,17,s[14]);B=GG(B,x=FF(x,A,R,B,C,22,s[15]),A,R,c,5,s[16]);R=GG(R,B,x,A,l,9,s[17]);A=GG(A,R,B,x,m,14,s[18]);x=GG(x,A,R,B,a,20,s[19]);B=GG(B,x,A,R,h,5,s[20]);R=GG(R,B,x,A,_,9,s[21]);A=GG(A,R,B,x,C,14,s[22]);x=GG(x,A,R,B,p,20,s[23]);B=GG(B,x,A,R,g,5,s[24]);R=GG(R,B,x,A,w,9,s[25]);A=GG(A,R,B,x,u,14,s[26]);x=GG(x,A,R,B,y,20,s[27]);B=GG(B,x,A,R,v,5,s[28]);R=GG(R,B,x,A,f,9,s[29]);A=GG(A,R,B,x,d,14,s[30]);B=HH(B,x=GG(x,A,R,B,S,20,s[31]),A,R,h,4,s[32]);R=HH(R,B,x,A,y,11,s[33]);A=HH(A,R,B,x,m,16,s[34]);x=HH(x,A,R,B,w,23,s[35]);B=HH(B,x,A,R,c,4,s[36]);R=HH(R,B,x,A,p,11,s[37]);A=HH(A,R,B,x,d,16,s[38]);x=HH(x,A,R,B,_,23,s[39]);B=HH(B,x,A,R,v,4,s[40]);R=HH(R,B,x,A,a,11,s[41]);A=HH(A,R,B,x,u,16,s[42]);x=HH(x,A,R,B,l,23,s[43]);B=HH(B,x,A,R,g,4,s[44]);R=HH(R,B,x,A,S,11,s[45]);A=HH(A,R,B,x,C,16,s[46]);B=II(B,x=HH(x,A,R,B,f,23,s[47]),A,R,a,6,s[48]);R=II(R,B,x,A,d,10,s[49]);A=II(A,R,B,x,w,15,s[50]);x=II(x,A,R,B,h,21,s[51]);B=II(B,x,A,R,S,6,s[52]);R=II(R,B,x,A,u,10,s[53]);A=II(A,R,B,x,_,15,s[54]);x=II(x,A,R,B,c,21,s[55]);B=II(B,x,A,R,y,6,s[56]);R=II(R,B,x,A,C,10,s[57]);A=II(A,R,B,x,l,15,s[58]);x=II(x,A,R,B,v,21,s[59]);B=II(B,x,A,R,p,6,s[60]);R=II(R,B,x,A,m,10,s[61]);A=II(A,R,B,x,f,15,s[62]);x=II(x,A,R,B,g,21,s[63]);i[0]=i[0]+B|0;i[1]=i[1]+x|0;i[2]=i[2]+A|0;i[3]=i[3]+R|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;var i=e.floor(n/4294967296),s=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);r[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);t.sigBytes=4*(r.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=o.clone.call(this);e._hash=this._hash.clone();return e}});function FF(e,t,r,n,o,i,s){var a=e+(t&r|~t&n)+o+s;return(a<<i|a>>>32-i)+t}function GG(e,t,r,n,o,i,s){var a=e+(t&n|r&~n)+o+s;return(a<<i|a>>>32-i)+t}function HH(e,t,r,n,o,i,s){var a=e+(t^r^n)+o+s;return(a<<i|a>>>32-i)+t}function II(e,t,r,n,o,i,s){var a=e+(r^(t|~n))+o+s;return(a<<i|a>>>32-i)+t}t.MD5=o._createHelper(a);t.HmacMD5=o._createHmacHelper(a)}(Math);!function(e){var t=exports.CryptoJS,r=t.lib,n=r.WordArray,o=r.Hasher,i=t.algo,s=[],a=[];!function(){function isPrime(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function getFractionalBits(e){return 4294967296*(e-(0|e))|0}for(var t=2,r=0;r<64;){if(isPrime(t)){r<8&&(s[r]=getFractionalBits(e.pow(t,.5)));a[r]=getFractionalBits(e.pow(t,1/3));r++}t++}}();var c=[],f=i.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],f=r[4],u=r[5],p=r[6],h=r[7],l=0;l<64;l++){if(l<16)c[l]=0|e[t+l];else{var d=c[l-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=c[l-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=y+c[l-7]+_+c[l-16]}var m=n&o^n&i^o&i,S=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),v=h+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&p)+a[l]+c[l];h=p;p=u;u=f;f=s+v|0;s=i;i=o;o=n;n=v+(S+m)|0}r[0]=r[0]+n|0;r[1]=r[1]+o|0;r[2]=r[2]+i|0;r[3]=r[3]+s|0;r[4]=r[4]+f|0;r[5]=r[5]+u|0;r[6]=r[6]+p|0;r[7]=r[7]+h|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;r[14+(o+64>>>9<<4)]=e.floor(n/4294967296);r[15+(o+64>>>9<<4)]=n;t.sigBytes=4*r.length;this._process();return this._hash},clone:function(){var e=o.clone.call(this);e._hash=this._hash.clone();return e}});t.SHA256=o._createHelper(f);t.HmacSHA256=o._createHmacHelper(f)}(Math);!function(){var e=exports.CryptoJS,t=e.lib.Base,r=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init;"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,o=4*n;t.sigBytes>o&&(t=e.finalize(t));t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),a=i.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}i.sigBytes=s.sigBytes=o;this.reset()},reset:function(){var e=this._hasher;e.reset();e.update(this._iKey)},update:function(e){this._hasher.update(e);return this},finalize:function(e){var t=this._hasher,r=t.finalize(e);t.reset();return t.finalize(this._oKey.clone().concat(r))}})}();exports.CryptoJS.lib.Cipher||function(e){var t=exports.CryptoJS,r=t.lib,n=r.Base,o=r.WordArray,i=r.BufferedBlockAlgorithm,s=t.enc,a=(s.Utf8,s.Base64),c=t.algo.EvpKDF,f=r.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r);this._xformMode=e;this._key=t;this.reset()},reset:function(){i.reset.call(this);this._doReset()},process:function(e){this._append(e);return this._process()},finalize:function(e){e&&this._append(e);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(e){return"string"==typeof e?m:g}return function(e){return{encrypt:function(t,r,n){return selectCipherStrategy(r).encrypt(e,t,r,n)},decrypt:function(t,r,n){return selectCipherStrategy(r).decrypt(e,t,r,n)}}}}()}),u=(r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),p=r.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e;this._iv=t}}),h=u.CBC=function(){var e=p.extend();e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize;xorBlock.call(this,e,t,n);r.encryptBlock(e,t);this._prevBlock=e.slice(t,t+n)}});e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=e.slice(t,t+n);r.decryptBlock(e,t);xorBlock.call(this,e,t,n);this._prevBlock=o}});function xorBlock(e,t,r){var n,o=this._iv;if(o){n=o;this._iv=void 0}else n=this._prevBlock;for(var i=0;i<r;i++)e[t+i]^=n[i]}return e}(),l=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var c=o.create(s,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},d=(r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:h,padding:l}),reset:function(){var e;f.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)e=n.createEncryptor;else{e=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==e)this._mode.init(this,r&&r.words);else{this._mode=e.call(n,this,r&&r.words);this._mode.__creator=e}},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);e=this._process(!0)}else{e=this._process(!0);t.unpad(e)}return e},blockSize:4}),r.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(a)},parse:function(e){var t,r=a.parse(e),n=r.words;if(1398893684==n[0]&&1701076831==n[1]){t=o.create(n.slice(2,4));n.splice(0,4);r.sigBytes-=16}return d.create({ciphertext:r,salt:t})}},g=r.SerializableCipher=n.extend({cfg:n.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var o=e.createEncryptor(r,n),i=o.finalize(t),s=o.cfg;return d.create({ciphertext:i,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n);t=this._parse(t,n.format);return e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=(t.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=c.create({keySize:t+r}).compute(e,n),s=o.create(i.words.slice(t),4*r);i.sigBytes=4*t;return d.create({key:i,iv:s,salt:n})}},m=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:_}),encrypt:function(e,t,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,e,t,o.key,n);i.mixIn(o);return i},decrypt:function(e,t,r,n){n=this.cfg.extend(n);t=this._parse(t,n.format);var o=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=o.iv;return g.decrypt.call(this,e,t,o.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var e=exports.CryptoJS.lib.WordArray,t=e.init;(e.init=function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength));if(e instanceof Uint8Array){for(var r=e.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=e[o]<<24-o%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}();exports.CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var e=exports.CryptoJS,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var r=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(r=a)}return function parseLoop(e,r,n){for(var o=[],i=0,s=0;s<r;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2,c=n[e.charCodeAt(s)]>>>6-s%4*2,f=a|c;o[i>>>2]|=f<<24-i%4*8;i++}return t.create(o,i)}(e,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var e=exports.CryptoJS,t=e.lib,r=t.Base,n=t.WordArray,o=e.algo,i=o.MD5,s=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:i,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,o=this.cfg,i=o.hasher.create(),s=n.create(),a=s.words,c=o.keySize,f=o.iterations;a.length<c;){r&&i.update(r);r=i.update(e).finalize(t);i.reset();for(var u=1;u<f;u++){r=i.finalize(r);i.reset()}s.concat(r)}s.sigBytes=4*c;return s}});e.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)}}();!function(){var e=exports.CryptoJS,t=e.lib.BlockCipher,r=e.algo,n=[],o=[],i=[],s=[],a=[],c=[],f=[],u=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,l=0;for(t=0;t<256;t++){var d=l^l<<1^l<<2^l<<3^l<<4;d=d>>>8^255&d^99;n[r]=d;o[d]=r;var y=e[r],g=e[y],_=e[g],m=257*e[d]^16843008*d;i[r]=m<<24|m>>>8;s[r]=m<<16|m>>>16;a[r]=m<<8|m>>>24;c[r]=m;m=16843009*_^65537*g^257*y^16843008*r;f[d]=m<<24|m>>>8;u[d]=m<<16|m>>>16;p[d]=m<<8|m>>>24;h[d]=m;if(r){r=y^e[e[e[_^y]]];l^=e[e[l]]}else r=l=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],d=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,o=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],s=0;s<o;s++)if(s<r)i[s]=t[s];else{d=i[s-1];if(s%r)r>6&&s%r==4&&(d=n[d>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d]);else{d=n[(d=d<<8|d>>>24)>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d];d^=l[s/r|0]<<24}i[s]=i[s-r]^d}for(var a=this._invKeySchedule=[],c=0;c<o;c++){s=o-c;if(c%4)var d=i[s];else d=i[s-4];a[c]=c<4||s<=4?d:f[n[d>>>24]]^u[n[d>>>16&255]]^p[n[d>>>8&255]]^h[n[255&d]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,i,s,a,c,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3];e[t+3]=r;this._doCryptBlock(e,t,this._invKeySchedule,f,u,p,h,o);r=e[t+1];e[t+1]=e[t+3];e[t+3]=r},_doCryptBlock:function(e,t,r,n,o,i,s,a){for(var c=this._nRounds,f=e[t]^r[0],u=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d<c;d++){var y=n[f>>>24]^o[u>>>16&255]^i[p>>>8&255]^s[255&h]^r[l++],g=n[u>>>24]^o[p>>>16&255]^i[h>>>8&255]^s[255&f]^r[l++],_=n[p>>>24]^o[h>>>16&255]^i[f>>>8&255]^s[255&u]^r[l++],m=n[h>>>24]^o[f>>>16&255]^i[u>>>8&255]^s[255&p]^r[l++];f=y;u=g;p=_;h=m}y=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&h])^r[l++],g=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[l++],_=(a[p>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[l++],m=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^r[l++];e[t]=y;e[t+1]=g;e[t+2]=_;e[t+3]=m},keySize:8});e.AES=t._createHelper(d)}();!function(){var e=exports.CryptoJS,t=e.lib.StreamCipher,r=e.algo,n=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var s=o%r,a=t[s>>>2]>>>24-s%4*8&255;i=(i+n[o]+a)%256;var c=n[o];n[o]=n[i];n[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var e=this._S,t=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[r];e[r]=i;n|=e[(e[t]+e[r])%256]<<24-8*o}this._i=t;this._j=r;return n}e.RC4=t._createHelper(n);var o=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)generateKeystreamWord.call(this)}});e.RC4Drop=t._createHelper(o)}();exports.CryptoJS.mode.ECB=function(){var e=exports.CryptoJS.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}});e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}});return e}();class _PDFSecurity{static generateFileID(e={}){let t=e.CreationDate.getTime()+"\n";for(const r in e)e.hasOwnProperty(r)&&(t+=`${r}: ${e[r]}\n`);return wordArrayToBuffer(exports.CryptoJS.MD5(t))}static generateRandomWordArray(e){return exports.CryptoJS.lib.WordArray.random(e)}static create(e,t={}){return t.ownerPassword||t.userPassword?new _PDFSecurity(e,t):null}constructor(e,t={}){if(!t.ownerPassword&&!t.userPassword)throw new Error("None of owner password and user password is defined.");this.document=e;this._setupEncryption(t)}_setupEncryption(e){switch(e.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}const t={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,t,e);break;case 5:this._setupEncryptionV5(t,e)}this.dictionary=this.document.ref(t)}_setupEncryptionV1V2V4(e,t,r){let n,o;switch(e){case 1:n=2;this.keyBits=40;o=getPermissionsR2(r.permissions);break;case 2:n=3;this.keyBits=128;o=getPermissionsR3(r.permissions);break;case 4:n=4;this.keyBits=128;o=getPermissionsR3(r.permissions)}const i=processPasswordR2R3R4(r.userPassword),s=r.ownerPassword?processPasswordR2R3R4(r.ownerPassword):i,a=getOwnerPasswordR2R3R4(n,this.keyBits,i,s);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,i,a,o);let c;c=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);t.V=e;e>=2&&(t.Length=this.keyBits);if(4===e){t.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};t.StmF="StdCF";t.StrF="StdCF"}t.R=n;t.O=wordArrayToBuffer(a);t.U=wordArrayToBuffer(c);t.P=o}_setupEncryptionV5(e,t){this.keyBits=256;const r=getPermissionsR3(t.permissions),n=processPasswordR5(t.userPassword),o=t.ownerPassword?processPasswordR5(t.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);const i=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,exports.CryptoJS.lib.WordArray.create(i.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(o,i,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(o,exports.CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),i,this.encryptionKey),f=getEncryptedPermissionsR5(r,this.encryptionKey,_PDFSecurity.generateRandomWordArray);e.V=5;e.Length=this.keyBits;e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF";e.R=5;e.O=wordArrayToBuffer(a);e.OE=wordArrayToBuffer(c);e.U=wordArrayToBuffer(i);e.UE=wordArrayToBuffer(s);e.P=r;e.Perms=wordArrayToBuffer(f)}getEncryptFn(e,t){let r,n;this.version<5&&(r=this.encryptionKey.clone().concat(exports.CryptoJS.lib.WordArray.create([(255&e)<<24|(65280&e)<<8|e>>8&65280|255&t,(65280&t)<<16],5)));if(1===this.version||2===this.version){const e=exports.CryptoJS.MD5(r);e.sigBytes=Math.min(16,this.keyBits/8+5);return t=>wordArrayToBuffer(exports.CryptoJS.RC4.encrypt(exports.CryptoJS.lib.WordArray.create(t),e).ciphertext)}n=4===this.version?exports.CryptoJS.MD5(r.concat(exports.CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;const o=_PDFSecurity.generateRandomWordArray(16),i={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.Pkcs7,iv:o};return e=>wordArrayToBuffer(o.clone().concat(exports.CryptoJS.AES.encrypt(exports.CryptoJS.lib.WordArray.create(e),n,i).ciphertext))}end(){this.dictionary.end()}}exports._PDFSecurity=_PDFSecurity;function getPermissionsR2(e={}){let t=-64;e.printing&&(t|=4);e.modifying&&(t|=8);e.copying&&(t|=16);e.annotating&&(t|=32);return t}function getPermissionsR3(e={}){let t=-3904;"lowResolution"===e.printing&&(t|=4);"highResolution"===e.printing&&(t|=2052);e.modifying&&(t|=8);e.copying&&(t|=16);e.annotating&&(t|=32);e.fillingForms&&(t|=256);e.contentAccessibility&&(t|=512);e.documentAssembly&&(t|=1024);return t}function getUserPasswordR2(e){return exports.CryptoJS.RC4.encrypt(processPasswordR2R3R4(),e).ciphertext}function getUserPasswordR3R4(e,t){const r=t.clone();let n=exports.CryptoJS.MD5(processPasswordR2R3R4().concat(exports.CryptoJS.lib.WordArray.create(e)));for(let e=0;e<20;e++){const o=Math.ceil(r.sigBytes/4);for(let n=0;n<o;n++)r.words[n]=t.words[n]^(e|e<<8|e<<16|e<<24);n=exports.CryptoJS.RC4.encrypt(n,r).ciphertext}return n.concat(exports.CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(e,t,r,n){let o=n,i=e>=3?51:1;for(let e=0;e<i;e++)o=exports.CryptoJS.MD5(o);const s=o.clone();s.sigBytes=t/8;let a=r;i=e>=3?20:1;for(let e=0;e<i;e++){const t=Math.ceil(s.sigBytes/4);for(let r=0;r<t;r++)s.words[r]=o.words[r]^(e|e<<8|e<<16|e<<24);a=exports.CryptoJS.RC4.encrypt(a,s).ciphertext}return a}function getEncryptionKeyR2R3R4(e,t,r,n,o,i){let s=n.clone().concat(o).concat(exports.CryptoJS.lib.WordArray.create([lsbFirstWord(i)],4)).concat(exports.CryptoJS.lib.WordArray.create(r));const a=e>=3?51:1;for(let e=0;e<a;e++){s=exports.CryptoJS.MD5(s);s.sigBytes=t/8}return s}function getUserPasswordR5(e,t){const r=t(8),n=t(8);return exports.CryptoJS.SHA256(e.clone().concat(r)).concat(r).concat(n)}function getUserEncryptionKeyR5(e,t,r){const n=exports.CryptoJS.SHA256(e.clone().concat(t)),o={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(r,n,o).ciphertext}function getOwnerPasswordR5(e,t,r){const n=r(8),o=r(8);return exports.CryptoJS.SHA256(e.clone().concat(n).concat(t)).concat(n).concat(o)}function getOwnerEncryptionKeyR5(e,t,r,n){const o=exports.CryptoJS.SHA256(e.clone().concat(t).concat(r)),i={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(n,o,i).ciphertext}function getEncryptionKeyR5(e){return e(32)}function getEncryptedPermissionsR5(e,t,r){const n=exports.CryptoJS.lib.WordArray.create([lsbFirstWord(e),4294967295,1415668834],12).concat(r(4)),o={mode:exports.CryptoJS.mode.ECB,padding:exports.CryptoJS.pad.NoPadding};return exports.CryptoJS.AES.encrypt(n,t,o).ciphertext}function processPasswordR2R3R4(e=""){const t=new Buffer(32),r=e.length;let n=0;for(;n<r&&n<32;){const r=e.charCodeAt(n);if(r>255)throw new Error("Password contains one or more invalid characters.");t[n]=r;n++}for(;n<32;){t[n]=PASSWORD_PADDING[n-r];n++}return exports.CryptoJS.lib.WordArray.create(t)}function processPasswordR5(e=""){e=unescape(encodeURIComponent(saslprep(e)));const t=Math.min(127,e.length),r=new Buffer(t);for(let n=0;n<t;n++)r[n]=e.charCodeAt(n);return exports.CryptoJS.lib.WordArray.create(r)}function lsbFirstWord(e){return(255&e)<<24|(65280&e)<<8|e>>8&65280|e>>24&255}function wordArrayToBuffer(e){const t=[];for(let r=0;r<e.sigBytes;r++)t.push(e.words[Math.floor(r/4)]>>8*(3-r%4)&255);return Buffer.from(t)}const PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];wijmo_1._registerModule("wijmo.pdf.security",selfModule);
14
+ "use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.pdf.security"));var K_MAX_LENGTH=2147483647;function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError(`The value "${e}" is invalid for option "size"`);var t=new Uint8Array(e);Object.setPrototypeOf(t,Buffer.prototype);return t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}exports.Buffer=Buffer;function from(e,t,r){if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var o=fromObject(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}Buffer.from=(e,t,r)=>from(e,t,r);Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError(`The value "${e}" is invalid for option "size"`)}function allocUnsafe(e){assertSize(e);return createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){var t=e.length<0?0:0|checked(e.length),r=createBuffer(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(e){if(Buffer.isBuffer(e)){const t=0|checked(e.length),r=createBuffer(t);if(0===r.length)return r;e.copy(r,0,0,t);return r}return void 0!==e.length?"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e):"Buffer"===e.type&&Array.isArray(e.data)?fromArrayLike(e.data):void 0}function checked(e){if(e>=K_MAX_LENGTH)throw new RangeError(`Attempt to allocate Buffer larger than maximum size: 0x${K_MAX_LENGTH.toString(16)} bytes`);return 0|e}Buffer.isBuffer=function isBuffer(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype};function slowToString(e,t,r){var n=!1;(void 0===t||t<0)&&(t=0);if(t>this.length)return"";(void 0===r||r>this.length)&&(r=this.length);if(r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";e||(e="utf8");for(;;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var e=this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)};function utf8Slice(e,t,r){r=Math.min(e.length,r);var n=[];let o,i,s,a;for(var c=t;c<r;){const t=e[c];let f=null,u=t>239?4:t>223?3:t>191?2:1;if(c+u<=r)switch(u){case 1:t<128&&(f=t);break;case 2:o=e[c+1];if(128==(192&o)){a=(31&t)<<6|63&o;a>127&&(f=a)}break;case 3:o=e[c+1];i=e[c+2];if(128==(192&o)&&128==(192&i)){a=(15&t)<<12|(63&o)<<6|63&i;a>2047&&(a<55296||a>57343)&&(f=a)}break;case 4:o=e[c+1];i=e[c+2];s=e[c+3];if(128==(192&o)&&128==(192&i)&&128==(192&s)){a=(15&t)<<18|(63&o)<<12|(63&i)<<6|63&s;a>65535&&a<1114112&&(f=a)}}if(null===f){f=65533;u=1}else if(f>65535){f-=65536;n.push(f>>>10&1023|55296);f=56320|1023&f}n.push(f);c+=u}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){const t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;){const o=Math.min(n+MAX_ARGUMENTS_LENGTH,t);r+=String.fromCharCode.apply(String,e.slice(n,o));n=o}return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0);(!r||r<0||r>n)&&(r=n);var o="";for(let n=t;n<r;++n)o+=hexSliceLookupTable[e[n]];return o}function utf16leSlice(e,t,r){var n=e.slice(t,r),o="";for(let e=0;e<n.length;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}Buffer.prototype.slice=function slice(e,t){var r,n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n);t<e&&(t=e);return r=this.subarray(e,t)(Object).setPrototypeOf(r,Buffer.prototype)};Buffer.prototype.copy=function copy(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");r||(r=0);n||0===n||(n=this.length);t>=e.length&&(t=e.length);t||(t=0);n>0&&n<r&&(n=r);if(n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);e.length-t<n-r&&(n=e.length-t+r);var o=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(let n=o-1;n>=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return o};function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}var hexSliceLookupTable=(()=>{var e=new Array(256);for(let t=0;t<16;++t){const r=16*t;for(let n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n]}return e})();function inRange(e,t){if(e<t[0])return!1;let r=0,n=t.length/2;for(;r<=n;){const o=Math.floor((r+n)/2),i=2*o;if(e>=t[i]&&e<=t[i+1])return!0;e>t[i+1]?r=o+1:n=o-1}return!1}exports.inRange=inRange;const unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];exports.isUnassignedCodePoint=e=>inRange(e,unassigned_code_points);const commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];exports.isCommonlyMappedToNothing=e=>inRange(e,commonly_mapped_to_nothing);const non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];exports.isNonASCIISpaceCharacter=e=>inRange(e,non_ASCII_space_characters);const non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];exports.isProhibitedCharacter=e=>inRange(e,non_ASCII_space_characters)||inRange(e,prohibited_characters)||inRange(e,non_ASCII_controls_characters)||inRange(e,non_character_codepoints);const bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];exports.isBidirectionalRAL=e=>inRange(e,bidirectional_r_al);const bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];exports.isBidirectionalL=e=>inRange(e,bidirectional_l);const mapping2space=exports.isNonASCIISpaceCharacter,mapping2nothing=exports.isCommonlyMappedToNothing,getCodePoint=e=>e.codePointAt(0),first=e=>e[0],last=e=>e[e.length-1];function toCodePoints(e){const t=[],r=e.length;for(let n=0;n<r;n+=1){const o=e.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){const r=e.charCodeAt(n+1);if(r>=56320&&r<=57343){t.push(1024*(o-55296)+r-56320+65536);n+=1;continue}}t.push(o)}return t}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);{let e=[],t=0,r="";for(let n=0,o=arguments.length;n!==o;++n){let o=+arguments[n];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);if(o<=65535)t=e.push(o);else{o-=65536;t=e.push(55296+(o>>10),o%1024+56320)}if(t>=16383){r+=String.fromCharCode.apply(null,e);e.length=0}}return r+String.fromCharCode.apply(null,e)}}function saslprep(e,t={}){if("string"!=typeof e)throw new TypeError("Expected string.");if(0===e.length)return"";const r=toCodePoints(e).map(e=>mapping2space(e)?32:e).filter(e=>!mapping2nothing(e)),n=fromCodePoint.apply(null,r).normalize("NFKC"),o=toCodePoints(n);if(o.some(exports.isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==t.allowUnassigned){if(o.some(exports.isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}const i=o.some(exports.isBidirectionalRAL),s=o.some(exports.isBidirectionalL);if(i&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");const a=exports.isBidirectionalRAL(getCodePoint(n[0]));const c=exports.isBidirectionalRAL(getCodePoint(last(n)));if(i&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}exports.saslprep=saslprep;exports.CryptoJS=function(e,t){var r;"undefined"!=typeof window&&window.crypto&&(r=window.crypto);!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto);var cryptoSecureRandomInt=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(e){var t;F.prototype=e;t=new F;F.prototype=null;return t}}(),o={},i=o.lib={},s=i.Base={extend:function(e){var t=n(this);e&&t.mixIn(e);t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)});t.init.prototype=t;t.$super=this;return t},create:function(){var e=this.extend();e.init.apply(e,arguments);return e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=s.extend({init:function(e,t){e=this.words=e||[];this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;this.clamp();if(n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)t[n+i>>>2]=r[i>>>2];this.sigBytes+=o;return this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8;t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);e.words=this.words.slice(0);return e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(cryptoSecureRandomInt());return new a.init(t,e)}}),c=o.enc={},f=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16));n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},u=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e));this._data.concat(e);this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,c=i/(4*s),f=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*s,u=e.min(4*f,i);if(f){for(var p=0;p<f;p+=s)this._doProcessBlock(o,p);r=o.splice(0,f);n.sigBytes-=u}return new a.init(r,u)},clone:function(){var e=s.clone.call(this);e._data=this._data.clone();return e},_minBufferSize:0}),l=(i.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e);this.reset()},reset:function(){h.reset.call(this);this._doReset()},update:function(e){this._append(e);this._process();return this},finalize:function(e){e&&this._append(e);return this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new l.HMAC.init(e,r).finalize(t)}}}),o.algo={});return o}(Math);!function(e){var t=exports.CryptoJS,r=t.lib,n=r.WordArray,o=r.Hasher,i=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=i.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],f=e[t+2],u=e[t+3],p=e[t+4],h=e[t+5],l=e[t+6],d=e[t+7],y=e[t+8],g=e[t+9],_=e[t+10],m=e[t+11],S=e[t+12],v=e[t+13],w=e[t+14],C=e[t+15],B=i[0],x=i[1],A=i[2],R=i[3];B=FF(B,x,A,R,a,7,s[0]);R=FF(R,B,x,A,c,12,s[1]);A=FF(A,R,B,x,f,17,s[2]);x=FF(x,A,R,B,u,22,s[3]);B=FF(B,x,A,R,p,7,s[4]);R=FF(R,B,x,A,h,12,s[5]);A=FF(A,R,B,x,l,17,s[6]);x=FF(x,A,R,B,d,22,s[7]);B=FF(B,x,A,R,y,7,s[8]);R=FF(R,B,x,A,g,12,s[9]);A=FF(A,R,B,x,_,17,s[10]);x=FF(x,A,R,B,m,22,s[11]);B=FF(B,x,A,R,S,7,s[12]);R=FF(R,B,x,A,v,12,s[13]);A=FF(A,R,B,x,w,17,s[14]);B=GG(B,x=FF(x,A,R,B,C,22,s[15]),A,R,c,5,s[16]);R=GG(R,B,x,A,l,9,s[17]);A=GG(A,R,B,x,m,14,s[18]);x=GG(x,A,R,B,a,20,s[19]);B=GG(B,x,A,R,h,5,s[20]);R=GG(R,B,x,A,_,9,s[21]);A=GG(A,R,B,x,C,14,s[22]);x=GG(x,A,R,B,p,20,s[23]);B=GG(B,x,A,R,g,5,s[24]);R=GG(R,B,x,A,w,9,s[25]);A=GG(A,R,B,x,u,14,s[26]);x=GG(x,A,R,B,y,20,s[27]);B=GG(B,x,A,R,v,5,s[28]);R=GG(R,B,x,A,f,9,s[29]);A=GG(A,R,B,x,d,14,s[30]);B=HH(B,x=GG(x,A,R,B,S,20,s[31]),A,R,h,4,s[32]);R=HH(R,B,x,A,y,11,s[33]);A=HH(A,R,B,x,m,16,s[34]);x=HH(x,A,R,B,w,23,s[35]);B=HH(B,x,A,R,c,4,s[36]);R=HH(R,B,x,A,p,11,s[37]);A=HH(A,R,B,x,d,16,s[38]);x=HH(x,A,R,B,_,23,s[39]);B=HH(B,x,A,R,v,4,s[40]);R=HH(R,B,x,A,a,11,s[41]);A=HH(A,R,B,x,u,16,s[42]);x=HH(x,A,R,B,l,23,s[43]);B=HH(B,x,A,R,g,4,s[44]);R=HH(R,B,x,A,S,11,s[45]);A=HH(A,R,B,x,C,16,s[46]);B=II(B,x=HH(x,A,R,B,f,23,s[47]),A,R,a,6,s[48]);R=II(R,B,x,A,d,10,s[49]);A=II(A,R,B,x,w,15,s[50]);x=II(x,A,R,B,h,21,s[51]);B=II(B,x,A,R,S,6,s[52]);R=II(R,B,x,A,u,10,s[53]);A=II(A,R,B,x,_,15,s[54]);x=II(x,A,R,B,c,21,s[55]);B=II(B,x,A,R,y,6,s[56]);R=II(R,B,x,A,C,10,s[57]);A=II(A,R,B,x,l,15,s[58]);x=II(x,A,R,B,v,21,s[59]);B=II(B,x,A,R,p,6,s[60]);R=II(R,B,x,A,m,10,s[61]);A=II(A,R,B,x,f,15,s[62]);x=II(x,A,R,B,g,21,s[63]);i[0]=i[0]+B|0;i[1]=i[1]+x|0;i[2]=i[2]+A|0;i[3]=i[3]+R|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;var i=e.floor(n/4294967296),s=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);r[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);t.sigBytes=4*(r.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=o.clone.call(this);e._hash=this._hash.clone();return e}});function FF(e,t,r,n,o,i,s){var a=e+(t&r|~t&n)+o+s;return(a<<i|a>>>32-i)+t}function GG(e,t,r,n,o,i,s){var a=e+(t&n|r&~n)+o+s;return(a<<i|a>>>32-i)+t}function HH(e,t,r,n,o,i,s){var a=e+(t^r^n)+o+s;return(a<<i|a>>>32-i)+t}function II(e,t,r,n,o,i,s){var a=e+(r^(t|~n))+o+s;return(a<<i|a>>>32-i)+t}t.MD5=o._createHelper(a);t.HmacMD5=o._createHmacHelper(a)}(Math);!function(e){var t=exports.CryptoJS,r=t.lib,n=r.WordArray,o=r.Hasher,i=t.algo,s=[],a=[];!function(){function isPrime(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function getFractionalBits(e){return 4294967296*(e-(0|e))|0}for(var t=2,r=0;r<64;){if(isPrime(t)){r<8&&(s[r]=getFractionalBits(e.pow(t,.5)));a[r]=getFractionalBits(e.pow(t,1/3));r++}t++}}();var c=[],f=i.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],f=r[4],u=r[5],p=r[6],h=r[7],l=0;l<64;l++){if(l<16)c[l]=0|e[t+l];else{var d=c[l-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=c[l-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=y+c[l-7]+_+c[l-16]}var m=n&o^n&i^o&i,S=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),v=h+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&p)+a[l]+c[l];h=p;p=u;u=f;f=s+v|0;s=i;i=o;o=n;n=v+(S+m)|0}r[0]=r[0]+n|0;r[1]=r[1]+o|0;r[2]=r[2]+i|0;r[3]=r[3]+s|0;r[4]=r[4]+f|0;r[5]=r[5]+u|0;r[6]=r[6]+p|0;r[7]=r[7]+h|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;r[14+(o+64>>>9<<4)]=e.floor(n/4294967296);r[15+(o+64>>>9<<4)]=n;t.sigBytes=4*r.length;this._process();return this._hash},clone:function(){var e=o.clone.call(this);e._hash=this._hash.clone();return e}});t.SHA256=o._createHelper(f);t.HmacSHA256=o._createHmacHelper(f)}(Math);!function(){var e=exports.CryptoJS,t=e.lib.Base,r=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init;"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,o=4*n;t.sigBytes>o&&(t=e.finalize(t));t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),a=i.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}i.sigBytes=s.sigBytes=o;this.reset()},reset:function(){var e=this._hasher;e.reset();e.update(this._iKey)},update:function(e){this._hasher.update(e);return this},finalize:function(e){var t=this._hasher,r=t.finalize(e);t.reset();return t.finalize(this._oKey.clone().concat(r))}})}();exports.CryptoJS.lib.Cipher||function(e){var t=exports.CryptoJS,r=t.lib,n=r.Base,o=r.WordArray,i=r.BufferedBlockAlgorithm,s=t.enc,a=(s.Utf8,s.Base64),c=t.algo.EvpKDF,f=r.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r);this._xformMode=e;this._key=t;this.reset()},reset:function(){i.reset.call(this);this._doReset()},process:function(e){this._append(e);return this._process()},finalize:function(e){e&&this._append(e);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(e){return"string"==typeof e?m:g}return function(e){return{encrypt:function(t,r,n){return selectCipherStrategy(r).encrypt(e,t,r,n)},decrypt:function(t,r,n){return selectCipherStrategy(r).decrypt(e,t,r,n)}}}}()}),u=(r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),p=r.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e;this._iv=t}}),h=u.CBC=function(){var e=p.extend();e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize;xorBlock.call(this,e,t,n);r.encryptBlock(e,t);this._prevBlock=e.slice(t,t+n)}});e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=e.slice(t,t+n);r.decryptBlock(e,t);xorBlock.call(this,e,t,n);this._prevBlock=o}});function xorBlock(e,t,r){var n,o=this._iv;if(o){n=o;this._iv=void 0}else n=this._prevBlock;for(var i=0;i<r;i++)e[t+i]^=n[i]}return e}(),l=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var c=o.create(s,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},d=(r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:h,padding:l}),reset:function(){var e;f.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)e=n.createEncryptor;else{e=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==e)this._mode.init(this,r&&r.words);else{this._mode=e.call(n,this,r&&r.words);this._mode.__creator=e}},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);e=this._process(!0)}else{e=this._process(!0);t.unpad(e)}return e},blockSize:4}),r.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(a)},parse:function(e){var t,r=a.parse(e),n=r.words;if(1398893684==n[0]&&1701076831==n[1]){t=o.create(n.slice(2,4));n.splice(0,4);r.sigBytes-=16}return d.create({ciphertext:r,salt:t})}},g=r.SerializableCipher=n.extend({cfg:n.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var o=e.createEncryptor(r,n),i=o.finalize(t),s=o.cfg;return d.create({ciphertext:i,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n);t=this._parse(t,n.format);return e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=(t.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=c.create({keySize:t+r}).compute(e,n),s=o.create(i.words.slice(t),4*r);i.sigBytes=4*t;return d.create({key:i,iv:s,salt:n})}},m=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:_}),encrypt:function(e,t,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,e,t,o.key,n);i.mixIn(o);return i},decrypt:function(e,t,r,n){n=this.cfg.extend(n);t=this._parse(t,n.format);var o=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=o.iv;return g.decrypt.call(this,e,t,o.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var e=exports.CryptoJS.lib.WordArray,t=e.init;(e.init=function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength));if(e instanceof Uint8Array){for(var r=e.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=e[o]<<24-o%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}();exports.CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var e=exports.CryptoJS,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var r=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(r=a)}return function parseLoop(e,r,n){for(var o=[],i=0,s=0;s<r;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2,c=n[e.charCodeAt(s)]>>>6-s%4*2,f=a|c;o[i>>>2]|=f<<24-i%4*8;i++}return t.create(o,i)}(e,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var e=exports.CryptoJS,t=e.lib,r=t.Base,n=t.WordArray,o=e.algo,i=o.MD5,s=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:i,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,o=this.cfg,i=o.hasher.create(),s=n.create(),a=s.words,c=o.keySize,f=o.iterations;a.length<c;){r&&i.update(r);r=i.update(e).finalize(t);i.reset();for(var u=1;u<f;u++){r=i.finalize(r);i.reset()}s.concat(r)}s.sigBytes=4*c;return s}});e.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)}}();!function(){var e=exports.CryptoJS,t=e.lib.BlockCipher,r=e.algo,n=[],o=[],i=[],s=[],a=[],c=[],f=[],u=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,l=0;for(t=0;t<256;t++){var d=l^l<<1^l<<2^l<<3^l<<4;d=d>>>8^255&d^99;n[r]=d;o[d]=r;var y=e[r],g=e[y],_=e[g],m=257*e[d]^16843008*d;i[r]=m<<24|m>>>8;s[r]=m<<16|m>>>16;a[r]=m<<8|m>>>24;c[r]=m;m=16843009*_^65537*g^257*y^16843008*r;f[d]=m<<24|m>>>8;u[d]=m<<16|m>>>16;p[d]=m<<8|m>>>24;h[d]=m;if(r){r=y^e[e[e[_^y]]];l^=e[e[l]]}else r=l=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],d=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,o=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],s=0;s<o;s++)if(s<r)i[s]=t[s];else{d=i[s-1];if(s%r)r>6&&s%r==4&&(d=n[d>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d]);else{d=n[(d=d<<8|d>>>24)>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d];d^=l[s/r|0]<<24}i[s]=i[s-r]^d}for(var a=this._invKeySchedule=[],c=0;c<o;c++){s=o-c;if(c%4)var d=i[s];else d=i[s-4];a[c]=c<4||s<=4?d:f[n[d>>>24]]^u[n[d>>>16&255]]^p[n[d>>>8&255]]^h[n[255&d]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,i,s,a,c,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3];e[t+3]=r;this._doCryptBlock(e,t,this._invKeySchedule,f,u,p,h,o);r=e[t+1];e[t+1]=e[t+3];e[t+3]=r},_doCryptBlock:function(e,t,r,n,o,i,s,a){for(var c=this._nRounds,f=e[t]^r[0],u=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d<c;d++){var y=n[f>>>24]^o[u>>>16&255]^i[p>>>8&255]^s[255&h]^r[l++],g=n[u>>>24]^o[p>>>16&255]^i[h>>>8&255]^s[255&f]^r[l++],_=n[p>>>24]^o[h>>>16&255]^i[f>>>8&255]^s[255&u]^r[l++],m=n[h>>>24]^o[f>>>16&255]^i[u>>>8&255]^s[255&p]^r[l++];f=y;u=g;p=_;h=m}y=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&h])^r[l++],g=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[l++],_=(a[p>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[l++],m=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^r[l++];e[t]=y;e[t+1]=g;e[t+2]=_;e[t+3]=m},keySize:8});e.AES=t._createHelper(d)}();!function(){var e=exports.CryptoJS,t=e.lib.StreamCipher,r=e.algo,n=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var s=o%r,a=t[s>>>2]>>>24-s%4*8&255;i=(i+n[o]+a)%256;var c=n[o];n[o]=n[i];n[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var e=this._S,t=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[r];e[r]=i;n|=e[(e[t]+e[r])%256]<<24-8*o}this._i=t;this._j=r;return n}e.RC4=t._createHelper(n);var o=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)generateKeystreamWord.call(this)}});e.RC4Drop=t._createHelper(o)}();exports.CryptoJS.mode.ECB=function(){var e=exports.CryptoJS.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}});e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}});return e}();class _PDFSecurity{static generateFileID(e={}){let t=e.CreationDate.getTime()+"\n";for(const r in e)e.hasOwnProperty(r)&&(t+=`${r}: ${e[r]}\n`);return wordArrayToBuffer(exports.CryptoJS.MD5(t))}static generateRandomWordArray(e){return exports.CryptoJS.lib.WordArray.random(e)}static create(e,t={}){return t.ownerPassword||t.userPassword?new _PDFSecurity(e,t):null}constructor(e,t={}){if(!t.ownerPassword&&!t.userPassword)throw new Error("None of owner password and user password is defined.");this.document=e;this._setupEncryption(t)}_setupEncryption(e){switch(e.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}const t={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,t,e);break;case 5:this._setupEncryptionV5(t,e)}this.dictionary=this.document.ref(t)}_setupEncryptionV1V2V4(e,t,r){let n,o;switch(e){case 1:n=2;this.keyBits=40;o=getPermissionsR2(r.permissions);break;case 2:n=3;this.keyBits=128;o=getPermissionsR3(r.permissions);break;case 4:n=4;this.keyBits=128;o=getPermissionsR3(r.permissions)}const i=processPasswordR2R3R4(r.userPassword),s=r.ownerPassword?processPasswordR2R3R4(r.ownerPassword):i,a=getOwnerPasswordR2R3R4(n,this.keyBits,i,s);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,i,a,o);let c;c=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);t.V=e;e>=2&&(t.Length=this.keyBits);if(4===e){t.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};t.StmF="StdCF";t.StrF="StdCF"}t.R=n;t.O=wordArrayToBuffer(a);t.U=wordArrayToBuffer(c);t.P=o}_setupEncryptionV5(e,t){this.keyBits=256;const r=getPermissionsR3(t.permissions),n=processPasswordR5(t.userPassword),o=t.ownerPassword?processPasswordR5(t.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);const i=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,exports.CryptoJS.lib.WordArray.create(i.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(o,i,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(o,exports.CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),i,this.encryptionKey),f=getEncryptedPermissionsR5(r,this.encryptionKey,_PDFSecurity.generateRandomWordArray);e.V=5;e.Length=this.keyBits;e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF";e.R=5;e.O=wordArrayToBuffer(a);e.OE=wordArrayToBuffer(c);e.U=wordArrayToBuffer(i);e.UE=wordArrayToBuffer(s);e.P=r;e.Perms=wordArrayToBuffer(f)}getEncryptFn(e,t){let r,n;this.version<5&&(r=this.encryptionKey.clone().concat(exports.CryptoJS.lib.WordArray.create([(255&e)<<24|(65280&e)<<8|e>>8&65280|255&t,(65280&t)<<16],5)));if(1===this.version||2===this.version){const e=exports.CryptoJS.MD5(r);e.sigBytes=Math.min(16,this.keyBits/8+5);return t=>wordArrayToBuffer(exports.CryptoJS.RC4.encrypt(exports.CryptoJS.lib.WordArray.create(t),e).ciphertext)}n=4===this.version?exports.CryptoJS.MD5(r.concat(exports.CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;const o=_PDFSecurity.generateRandomWordArray(16),i={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.Pkcs7,iv:o};return e=>wordArrayToBuffer(o.clone().concat(exports.CryptoJS.AES.encrypt(exports.CryptoJS.lib.WordArray.create(e),n,i).ciphertext))}end(){this.dictionary.end()}}exports._PDFSecurity=_PDFSecurity;function getPermissionsR2(e={}){let t=-64;e.printing&&(t|=4);e.modifying&&(t|=8);e.copying&&(t|=16);e.annotating&&(t|=32);return t}function getPermissionsR3(e={}){let t=-3904;"lowResolution"===e.printing&&(t|=4);"highResolution"===e.printing&&(t|=2052);e.modifying&&(t|=8);e.copying&&(t|=16);e.annotating&&(t|=32);e.fillingForms&&(t|=256);e.contentAccessibility&&(t|=512);e.documentAssembly&&(t|=1024);return t}function getUserPasswordR2(e){return exports.CryptoJS.RC4.encrypt(processPasswordR2R3R4(),e).ciphertext}function getUserPasswordR3R4(e,t){const r=t.clone();let n=exports.CryptoJS.MD5(processPasswordR2R3R4().concat(exports.CryptoJS.lib.WordArray.create(e)));for(let e=0;e<20;e++){const o=Math.ceil(r.sigBytes/4);for(let n=0;n<o;n++)r.words[n]=t.words[n]^(e|e<<8|e<<16|e<<24);n=exports.CryptoJS.RC4.encrypt(n,r).ciphertext}return n.concat(exports.CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(e,t,r,n){let o=n,i=e>=3?51:1;for(let e=0;e<i;e++)o=exports.CryptoJS.MD5(o);const s=o.clone();s.sigBytes=t/8;let a=r;i=e>=3?20:1;for(let e=0;e<i;e++){const t=Math.ceil(s.sigBytes/4);for(let r=0;r<t;r++)s.words[r]=o.words[r]^(e|e<<8|e<<16|e<<24);a=exports.CryptoJS.RC4.encrypt(a,s).ciphertext}return a}function getEncryptionKeyR2R3R4(e,t,r,n,o,i){let s=n.clone().concat(o).concat(exports.CryptoJS.lib.WordArray.create([lsbFirstWord(i)],4)).concat(exports.CryptoJS.lib.WordArray.create(r));const a=e>=3?51:1;for(let e=0;e<a;e++){s=exports.CryptoJS.MD5(s);s.sigBytes=t/8}return s}function getUserPasswordR5(e,t){const r=t(8),n=t(8);return exports.CryptoJS.SHA256(e.clone().concat(r)).concat(r).concat(n)}function getUserEncryptionKeyR5(e,t,r){const n=exports.CryptoJS.SHA256(e.clone().concat(t)),o={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(r,n,o).ciphertext}function getOwnerPasswordR5(e,t,r){const n=r(8),o=r(8);return exports.CryptoJS.SHA256(e.clone().concat(n).concat(t)).concat(n).concat(o)}function getOwnerEncryptionKeyR5(e,t,r,n){const o=exports.CryptoJS.SHA256(e.clone().concat(t).concat(r)),i={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(n,o,i).ciphertext}function getEncryptionKeyR5(e){return e(32)}function getEncryptedPermissionsR5(e,t,r){const n=exports.CryptoJS.lib.WordArray.create([lsbFirstWord(e),4294967295,1415668834],12).concat(r(4)),o={mode:exports.CryptoJS.mode.ECB,padding:exports.CryptoJS.pad.NoPadding};return exports.CryptoJS.AES.encrypt(n,t,o).ciphertext}function processPasswordR2R3R4(e=""){const t=new Buffer(32),r=e.length;let n=0;for(;n<r&&n<32;){const r=e.charCodeAt(n);if(r>255)throw new Error("Password contains one or more invalid characters.");t[n]=r;n++}for(;n<32;){t[n]=PASSWORD_PADDING[n-r];n++}return exports.CryptoJS.lib.WordArray.create(t)}function processPasswordR5(e=""){e=unescape(encodeURIComponent(saslprep(e)));const t=Math.min(127,e.length),r=new Buffer(t);for(let n=0;n<t;n++)r[n]=e.charCodeAt(n);return exports.CryptoJS.lib.WordArray.create(r)}function lsbFirstWord(e){return(255&e)<<24|(65280&e)<<8|e>>8&65280|e>>24&255}function wordArrayToBuffer(e){const t=[];for(let r=0;r<e.sigBytes;r++)t.push(e.words[Math.floor(r/4)]>>8*(3-r%4)&255);return Buffer.from(t)}const PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];wijmo_1._registerModule("wijmo.pdf.security",selfModule);
package/es2015-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.45-nightly.d20260106.t072437
3
+ * Wijmo Library 5.20261.45-nightly.d20260108.t163148
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- import{_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.pdf.security";var K_MAX_LENGTH=2147483647;function createBuffer(t){if(t>K_MAX_LENGTH)throw new RangeError(`The value "${t}" is invalid for option "size"`);var e=new Uint8Array(t);Object.setPrototypeOf(e,Buffer.prototype);return e}export function Buffer(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(t)}return from(t,e,r)}function from(t,e,r){if(ArrayBuffer.isView(t))return fromArrayLike(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(isInstance(t,ArrayBuffer)||t&&isInstance(t.buffer,ArrayBuffer))return fromArrayBuffer(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(t,SharedArrayBuffer)||t&&isInstance(t.buffer,SharedArrayBuffer)))return fromArrayBuffer(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return Buffer.from(n,e,r);var o=fromObject(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return Buffer.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Buffer.from=(t,e,r)=>from(t,e,r);Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError(`The value "${t}" is invalid for option "size"`)}function allocUnsafe(t){assertSize(t);return createBuffer(t<0?0:0|checked(t))}function fromArrayLike(t){var e=t.length<0?0:0|checked(t.length),r=createBuffer(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function fromArrayBuffer(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(t){if(Buffer.isBuffer(t)){const e=0|checked(t.length),r=createBuffer(e);if(0===r.length)return r;t.copy(r,0,0,e);return r}return void 0!==t.length?"number"!=typeof t.length||numberIsNaN(t.length)?createBuffer(0):fromArrayLike(t):"Buffer"===t.type&&Array.isArray(t.data)?fromArrayLike(t.data):void 0}function checked(t){if(t>=K_MAX_LENGTH)throw new RangeError(`Attempt to allocate Buffer larger than maximum size: 0x${K_MAX_LENGTH.toString(16)} bytes`);return 0|t}Buffer.isBuffer=function isBuffer(t){return null!=t&&!0===t._isBuffer&&t!==Buffer.prototype};function slowToString(t,e,r){var n=!1;(void 0===e||e<0)&&(e=0);if(e>this.length)return"";(void 0===r||r>this.length)&&(r=this.length);if(r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";t||(t="utf8");for(;;)switch(t){case"hex":return hexSlice(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return asciiSlice(this,e,r);case"latin1":case"binary":return latin1Slice(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var t=this.length;return 0===t?"":0===arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)};function utf8Slice(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){const e=t[o];let i=null,s=e>239?4:e>223?3:e>191?2:1;if(o+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(i=e);break;case 2:r=t[o+1];if(128==(192&r)){c=(31&e)<<6|63&r;c>127&&(i=c)}break;case 3:r=t[o+1];n=t[o+2];if(128==(192&r)&&128==(192&n)){c=(15&e)<<12|(63&r)<<6|63&n;c>2047&&(c<55296||c>57343)&&(i=c)}break;case 4:r=t[o+1];n=t[o+2];a=t[o+3];if(128==(192&r)&&128==(192&n)&&128==(192&a)){c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a;c>65535&&c<1114112&&(i=c)}}}if(null===i){i=65533;s=1}else if(i>65535){i-=65536;n.push(i>>>10&1023|55296);i=56320|1023&i}n.push(i);o+=s}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){const e=t.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;){const o=Math.min(n+MAX_ARGUMENTS_LENGTH,e);r+=String.fromCharCode.apply(String,t.slice(n,o));n=o}return r}function asciiSlice(t,e,r){var n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function latin1Slice(t,e,r){var n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function hexSlice(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);var o="";for(let n=e;n<r;++n)o+=hexSliceLookupTable[t[n]];return o}function utf16leSlice(t,e,r){var n=t.slice(e,r),o="";for(let t=0;t<n.length;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}Buffer.prototype.slice=function slice(t,e){var r,n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n);(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);e<t&&(e=t);return r=this.subarray(t,e)(Object).setPrototypeOf(r,Buffer.prototype)};Buffer.prototype.copy=function copy(t,e,r,n){if(!Buffer.isBuffer(t))throw new TypeError("argument should be a Buffer");r||(r=0);n||0===n||(n=this.length);e>=t.length&&(e=t.length);e||(e=0);n>0&&n<r&&(n=r);if(n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(let n=o-1;n>=0;--n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o};function isInstance(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function numberIsNaN(t){return t!=t}var hexSliceLookupTable=(()=>{var t=new Array(256);for(let e=0;e<16;++e){const r=16*e;for(let n=0;n<16;++n)t[r+n]="0123456789abcdef"[e]+"0123456789abcdef"[n]}return t})();export function inRange(t,e){if(t<e[0])return!1;let r=0,n=e.length/2;for(;r<=n;){const o=Math.floor((r+n)/2),i=2*o;if(t>=e[i]&&t<=e[i+1])return!0;t>e[i+1]?r=o+1:n=o-1}return!1}const unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];export const isUnassignedCodePoint=t=>inRange(t,unassigned_code_points);const commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];export const isCommonlyMappedToNothing=t=>inRange(t,commonly_mapped_to_nothing);const non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];export const isNonASCIISpaceCharacter=t=>inRange(t,non_ASCII_space_characters);const non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];export const isProhibitedCharacter=t=>inRange(t,non_ASCII_space_characters)||inRange(t,prohibited_characters)||inRange(t,non_ASCII_controls_characters)||inRange(t,non_character_codepoints);const bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];export const isBidirectionalRAL=t=>inRange(t,bidirectional_r_al);const bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];export const isBidirectionalL=t=>inRange(t,bidirectional_l);const mapping2space=isNonASCIISpaceCharacter,mapping2nothing=isCommonlyMappedToNothing,getCodePoint=t=>t.codePointAt(0),first=t=>t[0],last=t=>t[t.length-1];function toCodePoints(t){const e=[],r=t.length;for(let n=0;n<r;n+=1){const o=t.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){const r=t.charCodeAt(n+1);if(r>=56320&&r<=57343){e.push(1024*(o-55296)+r-56320+65536);n+=1;continue}}e.push(o)}return e}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);{let t=[],e=0,r="";for(let n=0,o=arguments.length;n!==o;++n){let o=+arguments[n];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);if(o<=65535)e=t.push(o);else{o-=65536;e=t.push(55296+(o>>10),o%1024+56320)}if(e>=16383){r+=String.fromCharCode.apply(null,t);t.length=0}}return r+String.fromCharCode.apply(null,t)}}export function saslprep(t,e={}){if("string"!=typeof t)throw new TypeError("Expected string.");if(0===t.length)return"";const r=toCodePoints(t).map(t=>mapping2space(t)?32:t).filter(t=>!mapping2nothing(t)),n=fromCodePoint.apply(null,r).normalize("NFKC"),o=toCodePoints(n);if(o.some(isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned){if(o.some(isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}const i=o.some(isBidirectionalRAL),s=o.some(isBidirectionalL);if(i&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");const a=isBidirectionalRAL(getCodePoint(n[0]));const c=isBidirectionalRAL(getCodePoint(last(n)));if(i&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}export var CryptoJS=function(t,e){var r;"undefined"!=typeof window&&window.crypto&&(r=window.crypto);!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto);var cryptoSecureRandomInt=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(t){var e;F.prototype=t;e=new F;F.prototype=null;return e}}(),o={},i=o.lib={},s=i.Base={extend:function(t){var e=n(this);t&&e.mixIn(t);e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)});e.init.prototype=e;e.$super=this;return e},create:function(){var t=this.extend();t.init.apply(t,arguments);return t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[];this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;this.clamp();if(n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)e[n+i>>>2]=r[i>>>2];this.sigBytes+=o;return this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8;e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);t.words=this.words.slice(0);return t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(cryptoSecureRandomInt());return new a.init(e,t)}}),c=o.enc={},f=c.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16));n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},u=c.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},h=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},p=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t));this._data.concat(t);this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,c=i/(4*s),f=(c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0))*s,u=t.min(4*f,i);if(f){for(var h=0;h<f;h+=s)this._doProcessBlock(o,h);r=o.splice(0,f);n.sigBytes-=u}return new a.init(r,u)},clone:function(){var t=s.clone.call(this);t._data=this._data.clone();return t},_minBufferSize:0}),l=(i.Hasher=p.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t);this.reset()},reset:function(){p.reset.call(this);this._doReset()},update:function(t){this._append(t);this._process();return this},finalize:function(t){t&&this._append(t);return this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new l.HMAC.init(t,r).finalize(e)}}}),o.algo={});return o}(Math);!function(t){var e=CryptoJS,r=e.lib,n=r.WordArray,o=r.Hasher,i=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var a=i.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,o=t[n];t[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=t[e+0],c=t[e+1],f=t[e+2],u=t[e+3],h=t[e+4],p=t[e+5],l=t[e+6],d=t[e+7],y=t[e+8],g=t[e+9],m=t[e+10],_=t[e+11],S=t[e+12],v=t[e+13],w=t[e+14],C=t[e+15],B=i[0],A=i[1],R=i[2],b=i[3];B=FF(B,A,R,b,a,7,s[0]);b=FF(b,B,A,R,c,12,s[1]);R=FF(R,b,B,A,f,17,s[2]);A=FF(A,R,b,B,u,22,s[3]);B=FF(B,A,R,b,h,7,s[4]);b=FF(b,B,A,R,p,12,s[5]);R=FF(R,b,B,A,l,17,s[6]);A=FF(A,R,b,B,d,22,s[7]);B=FF(B,A,R,b,y,7,s[8]);b=FF(b,B,A,R,g,12,s[9]);R=FF(R,b,B,A,m,17,s[10]);A=FF(A,R,b,B,_,22,s[11]);B=FF(B,A,R,b,S,7,s[12]);b=FF(b,B,A,R,v,12,s[13]);R=FF(R,b,B,A,w,17,s[14]);B=GG(B,A=FF(A,R,b,B,C,22,s[15]),R,b,c,5,s[16]);b=GG(b,B,A,R,l,9,s[17]);R=GG(R,b,B,A,_,14,s[18]);A=GG(A,R,b,B,a,20,s[19]);B=GG(B,A,R,b,p,5,s[20]);b=GG(b,B,A,R,m,9,s[21]);R=GG(R,b,B,A,C,14,s[22]);A=GG(A,R,b,B,h,20,s[23]);B=GG(B,A,R,b,g,5,s[24]);b=GG(b,B,A,R,w,9,s[25]);R=GG(R,b,B,A,u,14,s[26]);A=GG(A,R,b,B,y,20,s[27]);B=GG(B,A,R,b,v,5,s[28]);b=GG(b,B,A,R,f,9,s[29]);R=GG(R,b,B,A,d,14,s[30]);B=HH(B,A=GG(A,R,b,B,S,20,s[31]),R,b,p,4,s[32]);b=HH(b,B,A,R,y,11,s[33]);R=HH(R,b,B,A,_,16,s[34]);A=HH(A,R,b,B,w,23,s[35]);B=HH(B,A,R,b,c,4,s[36]);b=HH(b,B,A,R,h,11,s[37]);R=HH(R,b,B,A,d,16,s[38]);A=HH(A,R,b,B,m,23,s[39]);B=HH(B,A,R,b,v,4,s[40]);b=HH(b,B,A,R,a,11,s[41]);R=HH(R,b,B,A,u,16,s[42]);A=HH(A,R,b,B,l,23,s[43]);B=HH(B,A,R,b,g,4,s[44]);b=HH(b,B,A,R,S,11,s[45]);R=HH(R,b,B,A,C,16,s[46]);B=II(B,A=HH(A,R,b,B,f,23,s[47]),R,b,a,6,s[48]);b=II(b,B,A,R,d,10,s[49]);R=II(R,b,B,A,w,15,s[50]);A=II(A,R,b,B,p,21,s[51]);B=II(B,A,R,b,S,6,s[52]);b=II(b,B,A,R,u,10,s[53]);R=II(R,b,B,A,m,15,s[54]);A=II(A,R,b,B,c,21,s[55]);B=II(B,A,R,b,y,6,s[56]);b=II(b,B,A,R,C,10,s[57]);R=II(R,b,B,A,l,15,s[58]);A=II(A,R,b,B,v,21,s[59]);B=II(B,A,R,b,h,6,s[60]);b=II(b,B,A,R,_,10,s[61]);R=II(R,b,B,A,f,15,s[62]);A=II(A,R,b,B,g,21,s[63]);i[0]=i[0]+B|0;i[1]=i[1]+A|0;i[2]=i[2]+R|0;i[3]=i[3]+b|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;r[o>>>5]|=128<<24-o%32;var i=t.floor(n/4294967296),s=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);r[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);e.sigBytes=4*(r.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var t=o.clone.call(this);t._hash=this._hash.clone();return t}});function FF(t,e,r,n,o,i,s){var a=t+(e&r|~e&n)+o+s;return(a<<i|a>>>32-i)+e}function GG(t,e,r,n,o,i,s){var a=t+(e&n|r&~n)+o+s;return(a<<i|a>>>32-i)+e}function HH(t,e,r,n,o,i,s){var a=t+(e^r^n)+o+s;return(a<<i|a>>>32-i)+e}function II(t,e,r,n,o,i,s){var a=t+(r^(e|~n))+o+s;return(a<<i|a>>>32-i)+e}e.MD5=o._createHelper(a);e.HmacMD5=o._createHmacHelper(a)}(Math);!function(t){var e=CryptoJS,r=e.lib,n=r.WordArray,o=r.Hasher,i=e.algo,s=[],a=[];!function(){function isPrime(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function getFractionalBits(t){return 4294967296*(t-(0|t))|0}for(var e=2,r=0;r<64;){if(isPrime(e)){r<8&&(s[r]=getFractionalBits(t.pow(e,.5)));a[r]=getFractionalBits(t.pow(e,1/3));r++}e++}}();var c=[],f=i.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],f=r[4],u=r[5],h=r[6],p=r[7],l=0;l<64;l++){if(l<16)c[l]=0|t[e+l];else{var d=c[l-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=c[l-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=y+c[l-7]+m+c[l-16]}var _=n&o^n&i^o&i,S=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),v=p+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&h)+a[l]+c[l];p=h;h=u;u=f;f=s+v|0;s=i;i=o;o=n;n=v+(S+_)|0}r[0]=r[0]+n|0;r[1]=r[1]+o|0;r[2]=r[2]+i|0;r[3]=r[3]+s|0;r[4]=r[4]+f|0;r[5]=r[5]+u|0;r[6]=r[6]+h|0;r[7]=r[7]+p|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;r[o>>>5]|=128<<24-o%32;r[14+(o+64>>>9<<4)]=t.floor(n/4294967296);r[15+(o+64>>>9<<4)]=n;e.sigBytes=4*r.length;this._process();return this._hash},clone:function(){var t=o.clone.call(this);t._hash=this._hash.clone();return t}});e.SHA256=o._createHelper(f);e.HmacSHA256=o._createHmacHelper(f)}(Math);!function(){var t=CryptoJS,e=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=e.extend({init:function(t,e){t=this._hasher=new t.init;"string"==typeof e&&(e=r.parse(e));var n=t.blockSize,o=4*n;e.sigBytes>o&&(e=t.finalize(e));e.clamp();for(var i=this._oKey=e.clone(),s=this._iKey=e.clone(),a=i.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}i.sigBytes=s.sigBytes=o;this.reset()},reset:function(){var t=this._hasher;t.reset();t.update(this._iKey)},update:function(t){this._hasher.update(t);return this},finalize:function(t){var e=this._hasher,r=e.finalize(t);e.reset();return e.finalize(this._oKey.clone().concat(r))}})}();CryptoJS.lib.Cipher||function(t){var e=CryptoJS,r=e.lib,n=r.Base,o=r.WordArray,i=r.BufferedBlockAlgorithm,s=e.enc,a=(s.Utf8,s.Base64),c=e.algo.EvpKDF,f=r.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r);this._xformMode=t;this._key=e;this.reset()},reset:function(){i.reset.call(this);this._doReset()},process:function(t){this._append(t);return this._process()},finalize:function(t){t&&this._append(t);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(t){return"string"==typeof t?_:g}return function(t){return{encrypt:function(e,r,n){return selectCipherStrategy(r).encrypt(t,e,r,n)},decrypt:function(e,r,n){return selectCipherStrategy(r).decrypt(t,e,r,n)}}}}()}),u=(r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),h=r.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t;this._iv=e}}),p=u.CBC=function(){var t=h.extend();t.Encryptor=t.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize;xorBlock.call(this,t,e,n);r.encryptBlock(t,e);this._prevBlock=t.slice(e,e+n)}});t.Decryptor=t.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,o=t.slice(e,e+n);r.decryptBlock(t,e);xorBlock.call(this,t,e,n);this._prevBlock=o}});function xorBlock(t,e,r){var n,o=this._iv;if(o){n=o;this._iv=void 0}else n=this._prevBlock;for(var i=0;i<r;i++)t[e+i]^=n[i]}return t}(),l=(e.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,n=r-t.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var c=o.create(s,n);t.concat(c)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},d=(r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:l}),reset:function(){var t;f.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)t=n.createEncryptor;else{t=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==t)this._mode.init(this,r&&r.words);else{this._mode=t.call(n,this,r&&r.words);this._mode.__creator=t}},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),r.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(e):e).toString(a)},parse:function(t){var e,r=a.parse(t),n=r.words;if(1398893684==n[0]&&1701076831==n[1]){e=o.create(n.slice(2,4));n.splice(0,4);r.sigBytes-=16}return d.create({ciphertext:r,salt:e})}},g=r.SerializableCipher=n.extend({cfg:n.extend({format:y}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var o=t.createEncryptor(r,n),i=o.finalize(e),s=o.cfg;return d.create({ciphertext:i,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n);e=this._parse(e,n.format);return t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),m=(e.kdf={}).OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=c.create({keySize:e+r}).compute(t,n),s=o.create(i.words.slice(e),4*r);i.sigBytes=4*e;return d.create({key:i,iv:s,salt:n})}},_=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:m}),encrypt:function(t,e,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,t,e,o.key,n);i.mixIn(o);return i},decrypt:function(t,e,r,n){n=this.cfg.extend(n);e=this._parse(e,n.format);var o=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=o.iv;return g.decrypt.call(this,t,e,o.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var t=CryptoJS.lib.WordArray,e=t.init;(t.init=function(t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength));if(t instanceof Uint8Array){for(var r=t.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=t[o]<<24-o%4*8;e.call(this,n,r)}else e.apply(this,arguments)}).prototype=t}}();CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var t=CryptoJS,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var r=t.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(r=a)}return function parseLoop(t,r,n){for(var o=[],i=0,s=0;s<r;s++)if(s%4){var a=n[t.charCodeAt(s-1)]<<s%4*2,c=n[t.charCodeAt(s)]>>>6-s%4*2,f=a|c;o[i>>>2]|=f<<24-i%4*8;i++}return e.create(o,i)}(t,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var t=CryptoJS,e=t.lib,r=e.Base,n=e.WordArray,o=t.algo,i=o.MD5,s=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:i,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,o=this.cfg,i=o.hasher.create(),s=n.create(),a=s.words,c=o.keySize,f=o.iterations;a.length<c;){r&&i.update(r);r=i.update(t).finalize(e);i.reset();for(var u=1;u<f;u++){r=i.finalize(r);i.reset()}s.concat(r)}s.sigBytes=4*c;return s}});t.EvpKDF=function(t,e,r){return s.create(r).compute(t,e)}}();!function(){var t=CryptoJS,e=t.lib.BlockCipher,r=t.algo,n=[],o=[],i=[],s=[],a=[],c=[],f=[],u=[],h=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,l=0;for(e=0;e<256;e++){var d=l^l<<1^l<<2^l<<3^l<<4;d=d>>>8^255&d^99;n[r]=d;o[d]=r;var y=t[r],g=t[y],m=t[g],_=257*t[d]^16843008*d;i[r]=_<<24|_>>>8;s[r]=_<<16|_>>>16;a[r]=_<<8|_>>>24;c[r]=_;_=16843009*m^65537*g^257*y^16843008*r;f[d]=_<<24|_>>>8;u[d]=_<<16|_>>>16;h[d]=_<<8|_>>>24;p[d]=_;if(r){r=y^t[t[t[m^y]]];l^=t[t[l]]}else r=l=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],d=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,o=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],s=0;s<o;s++)if(s<r)i[s]=e[s];else{d=i[s-1];if(s%r)r>6&&s%r==4&&(d=n[d>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d]);else{d=n[(d=d<<8|d>>>24)>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d];d^=l[s/r|0]<<24}i[s]=i[s-r]^d}for(var a=this._invKeySchedule=[],c=0;c<o;c++){s=o-c;if(c%4)var d=i[s];else d=i[s-4];a[c]=c<4||s<=4?d:f[n[d>>>24]]^u[n[d>>>16&255]]^h[n[d>>>8&255]]^p[n[255&d]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,i,s,a,c,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3];t[e+3]=r;this._doCryptBlock(t,e,this._invKeySchedule,f,u,h,p,o);r=t[e+1];t[e+1]=t[e+3];t[e+3]=r},_doCryptBlock:function(t,e,r,n,o,i,s,a){for(var c=this._nRounds,f=t[e]^r[0],u=t[e+1]^r[1],h=t[e+2]^r[2],p=t[e+3]^r[3],l=4,d=1;d<c;d++){var y=n[f>>>24]^o[u>>>16&255]^i[h>>>8&255]^s[255&p]^r[l++],g=n[u>>>24]^o[h>>>16&255]^i[p>>>8&255]^s[255&f]^r[l++],m=n[h>>>24]^o[p>>>16&255]^i[f>>>8&255]^s[255&u]^r[l++],_=n[p>>>24]^o[f>>>16&255]^i[u>>>8&255]^s[255&h]^r[l++];f=y;u=g;h=m;p=_}y=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[h>>>8&255]<<8|a[255&p])^r[l++],g=(a[u>>>24]<<24|a[h>>>16&255]<<16|a[p>>>8&255]<<8|a[255&f])^r[l++],m=(a[h>>>24]<<24|a[p>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[l++],_=(a[p>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&h])^r[l++];t[e]=y;t[e+1]=g;t[e+2]=m;t[e+3]=_},keySize:8});t.AES=e._createHelper(d)}();!function(){var t=CryptoJS,e=t.lib.StreamCipher,r=t.algo,n=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var s=o%r,a=e[s>>>2]>>>24-s%4*8&255;i=(i+n[o]+a)%256;var c=n[o];n[o]=n[i];n[i]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var t=this._S,e=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+t[e=(e+1)%256])%256;var i=t[e];t[e]=t[r];t[r]=i;n|=t[(t[e]+t[r])%256]<<24-8*o}this._i=e;this._j=r;return n}t.RC4=e._createHelper(n);var o=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)generateKeystreamWord.call(this)}});t.RC4Drop=e._createHelper(o)}();CryptoJS.mode.ECB=function(){var t=CryptoJS.lib.BlockCipherMode.extend();t.Encryptor=t.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}});t.Decryptor=t.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}});return t}();export class _PDFSecurity{static generateFileID(t={}){let e=t.CreationDate.getTime()+"\n";for(const r in t)t.hasOwnProperty(r)&&(e+=`${r}: ${t[r]}\n`);return wordArrayToBuffer(CryptoJS.MD5(e))}static generateRandomWordArray(t){return CryptoJS.lib.WordArray.random(t)}static create(t,e={}){return e.ownerPassword||e.userPassword?new _PDFSecurity(t,e):null}constructor(t,e={}){if(!e.ownerPassword&&!e.userPassword)throw new Error("None of owner password and user password is defined.");this.document=t;this._setupEncryption(e)}_setupEncryption(t){switch(t.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}const e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,t);break;case 5:this._setupEncryptionV5(e,t)}this.dictionary=this.document.ref(e)}_setupEncryptionV1V2V4(t,e,r){let n,o;switch(t){case 1:n=2;this.keyBits=40;o=getPermissionsR2(r.permissions);break;case 2:n=3;this.keyBits=128;o=getPermissionsR3(r.permissions);break;case 4:n=4;this.keyBits=128;o=getPermissionsR3(r.permissions)}const i=processPasswordR2R3R4(r.userPassword),s=r.ownerPassword?processPasswordR2R3R4(r.ownerPassword):i,a=getOwnerPasswordR2R3R4(n,this.keyBits,i,s);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,i,a,o);let c;c=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);e.V=t;t>=2&&(e.Length=this.keyBits);if(4===t){e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF"}e.R=n;e.O=wordArrayToBuffer(a);e.U=wordArrayToBuffer(c);e.P=o}_setupEncryptionV5(t,e){this.keyBits=256;const r=getPermissionsR3(e.permissions),n=processPasswordR5(e.userPassword),o=e.ownerPassword?processPasswordR5(e.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);const i=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,CryptoJS.lib.WordArray.create(i.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(o,i,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(o,CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),i,this.encryptionKey),f=getEncryptedPermissionsR5(r,this.encryptionKey,_PDFSecurity.generateRandomWordArray);t.V=5;t.Length=this.keyBits;t.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};t.StmF="StdCF";t.StrF="StdCF";t.R=5;t.O=wordArrayToBuffer(a);t.OE=wordArrayToBuffer(c);t.U=wordArrayToBuffer(i);t.UE=wordArrayToBuffer(s);t.P=r;t.Perms=wordArrayToBuffer(f)}getEncryptFn(t,e){let r,n;this.version<5&&(r=this.encryptionKey.clone().concat(CryptoJS.lib.WordArray.create([(255&t)<<24|(65280&t)<<8|t>>8&65280|255&e,(65280&e)<<16],5)));if(1===this.version||2===this.version){const t=CryptoJS.MD5(r);t.sigBytes=Math.min(16,this.keyBits/8+5);return e=>wordArrayToBuffer(CryptoJS.RC4.encrypt(CryptoJS.lib.WordArray.create(e),t).ciphertext)}n=4===this.version?CryptoJS.MD5(r.concat(CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;const o=_PDFSecurity.generateRandomWordArray(16),i={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:o};return t=>wordArrayToBuffer(o.clone().concat(CryptoJS.AES.encrypt(CryptoJS.lib.WordArray.create(t),n,i).ciphertext))}end(){this.dictionary.end()}}function getPermissionsR2(t={}){let e=-64;t.printing&&(e|=4);t.modifying&&(e|=8);t.copying&&(e|=16);t.annotating&&(e|=32);return e}function getPermissionsR3(t={}){let e=-3904;"lowResolution"===t.printing&&(e|=4);"highResolution"===t.printing&&(e|=2052);t.modifying&&(e|=8);t.copying&&(e|=16);t.annotating&&(e|=32);t.fillingForms&&(e|=256);t.contentAccessibility&&(e|=512);t.documentAssembly&&(e|=1024);return e}function getUserPasswordR2(t){return CryptoJS.RC4.encrypt(processPasswordR2R3R4(),t).ciphertext}function getUserPasswordR3R4(t,e){const r=e.clone();let n=CryptoJS.MD5(processPasswordR2R3R4().concat(CryptoJS.lib.WordArray.create(t)));for(let t=0;t<20;t++){const o=Math.ceil(r.sigBytes/4);for(let n=0;n<o;n++)r.words[n]=e.words[n]^(t|t<<8|t<<16|t<<24);n=CryptoJS.RC4.encrypt(n,r).ciphertext}return n.concat(CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(t,e,r,n){let o=n,i=t>=3?51:1;for(let t=0;t<i;t++)o=CryptoJS.MD5(o);const s=o.clone();s.sigBytes=e/8;let a=r;i=t>=3?20:1;for(let t=0;t<i;t++){const e=Math.ceil(s.sigBytes/4);for(let r=0;r<e;r++)s.words[r]=o.words[r]^(t|t<<8|t<<16|t<<24);a=CryptoJS.RC4.encrypt(a,s).ciphertext}return a}function getEncryptionKeyR2R3R4(t,e,r,n,o,i){let s=n.clone().concat(o).concat(CryptoJS.lib.WordArray.create([lsbFirstWord(i)],4)).concat(CryptoJS.lib.WordArray.create(r));const a=t>=3?51:1;for(let t=0;t<a;t++){s=CryptoJS.MD5(s);s.sigBytes=e/8}return s}function getUserPasswordR5(t,e){const r=e(8),n=e(8);return CryptoJS.SHA256(t.clone().concat(r)).concat(r).concat(n)}function getUserEncryptionKeyR5(t,e,r){const n=CryptoJS.SHA256(t.clone().concat(e)),o={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(r,n,o).ciphertext}function getOwnerPasswordR5(t,e,r){const n=r(8),o=r(8);return CryptoJS.SHA256(t.clone().concat(n).concat(e)).concat(n).concat(o)}function getOwnerEncryptionKeyR5(t,e,r,n){const o=CryptoJS.SHA256(t.clone().concat(e).concat(r)),i={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(n,o,i).ciphertext}function getEncryptionKeyR5(t){return t(32)}function getEncryptedPermissionsR5(t,e,r){const n=CryptoJS.lib.WordArray.create([lsbFirstWord(t),4294967295,1415668834],12).concat(r(4)),o={mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.NoPadding};return CryptoJS.AES.encrypt(n,e,o).ciphertext}function processPasswordR2R3R4(t=""){const e=new Buffer(32),r=t.length;let n=0;for(;n<r&&n<32;){const r=t.charCodeAt(n);if(r>255)throw new Error("Password contains one or more invalid characters.");e[n]=r;n++}for(;n<32;){e[n]=PASSWORD_PADDING[n-r];n++}return CryptoJS.lib.WordArray.create(e)}function processPasswordR5(t=""){t=unescape(encodeURIComponent(saslprep(t)));const e=Math.min(127,t.length),r=new Buffer(e);for(let n=0;n<e;n++)r[n]=t.charCodeAt(n);return CryptoJS.lib.WordArray.create(r)}function lsbFirstWord(t){return(255&t)<<24|(65280&t)<<8|t>>8&65280|t>>24&255}function wordArrayToBuffer(t){const e=[];for(let r=0;r<t.sigBytes;r++)e.push(t.words[Math.floor(r/4)]>>8*(3-r%4)&255);return Buffer.from(e)}const PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];_registerModule("wijmo.pdf.security",selfModule);
14
+ import{_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.pdf.security";var K_MAX_LENGTH=2147483647;function createBuffer(t){if(t>K_MAX_LENGTH)throw new RangeError(`The value "${t}" is invalid for option "size"`);var e=new Uint8Array(t);Object.setPrototypeOf(e,Buffer.prototype);return e}export function Buffer(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(t)}return from(t,e,r)}function from(t,e,r){if(ArrayBuffer.isView(t))return fromArrayLike(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(isInstance(t,ArrayBuffer)||t&&isInstance(t.buffer,ArrayBuffer))return fromArrayBuffer(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(t,SharedArrayBuffer)||t&&isInstance(t.buffer,SharedArrayBuffer)))return fromArrayBuffer(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return Buffer.from(n,e,r);var o=fromObject(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return Buffer.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Buffer.from=(t,e,r)=>from(t,e,r);Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError(`The value "${t}" is invalid for option "size"`)}function allocUnsafe(t){assertSize(t);return createBuffer(t<0?0:0|checked(t))}function fromArrayLike(t){var e=t.length<0?0:0|checked(t.length),r=createBuffer(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function fromArrayBuffer(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(t){if(Buffer.isBuffer(t)){const e=0|checked(t.length),r=createBuffer(e);if(0===r.length)return r;t.copy(r,0,0,e);return r}return void 0!==t.length?"number"!=typeof t.length||numberIsNaN(t.length)?createBuffer(0):fromArrayLike(t):"Buffer"===t.type&&Array.isArray(t.data)?fromArrayLike(t.data):void 0}function checked(t){if(t>=K_MAX_LENGTH)throw new RangeError(`Attempt to allocate Buffer larger than maximum size: 0x${K_MAX_LENGTH.toString(16)} bytes`);return 0|t}Buffer.isBuffer=function isBuffer(t){return null!=t&&!0===t._isBuffer&&t!==Buffer.prototype};function slowToString(t,e,r){var n=!1;(void 0===e||e<0)&&(e=0);if(e>this.length)return"";(void 0===r||r>this.length)&&(r=this.length);if(r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";t||(t="utf8");for(;;)switch(t){case"hex":return hexSlice(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return asciiSlice(this,e,r);case"latin1":case"binary":return latin1Slice(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var t=this.length;return 0===t?"":0===arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)};function utf8Slice(t,e,r){r=Math.min(t.length,r);var n=[];let o,i,s,a;for(var c=e;c<r;){const e=t[c];let f=null,u=e>239?4:e>223?3:e>191?2:1;if(c+u<=r)switch(u){case 1:e<128&&(f=e);break;case 2:o=t[c+1];if(128==(192&o)){a=(31&e)<<6|63&o;a>127&&(f=a)}break;case 3:o=t[c+1];i=t[c+2];if(128==(192&o)&&128==(192&i)){a=(15&e)<<12|(63&o)<<6|63&i;a>2047&&(a<55296||a>57343)&&(f=a)}break;case 4:o=t[c+1];i=t[c+2];s=t[c+3];if(128==(192&o)&&128==(192&i)&&128==(192&s)){a=(15&e)<<18|(63&o)<<12|(63&i)<<6|63&s;a>65535&&a<1114112&&(f=a)}}if(null===f){f=65533;u=1}else if(f>65535){f-=65536;n.push(f>>>10&1023|55296);f=56320|1023&f}n.push(f);c+=u}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){const e=t.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;){const o=Math.min(n+MAX_ARGUMENTS_LENGTH,e);r+=String.fromCharCode.apply(String,t.slice(n,o));n=o}return r}function asciiSlice(t,e,r){var n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function latin1Slice(t,e,r){var n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function hexSlice(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);var o="";for(let n=e;n<r;++n)o+=hexSliceLookupTable[t[n]];return o}function utf16leSlice(t,e,r){var n=t.slice(e,r),o="";for(let t=0;t<n.length;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}Buffer.prototype.slice=function slice(t,e){var r,n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n);(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);e<t&&(e=t);return r=this.subarray(t,e)(Object).setPrototypeOf(r,Buffer.prototype)};Buffer.prototype.copy=function copy(t,e,r,n){if(!Buffer.isBuffer(t))throw new TypeError("argument should be a Buffer");r||(r=0);n||0===n||(n=this.length);e>=t.length&&(e=t.length);e||(e=0);n>0&&n<r&&(n=r);if(n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(let n=o-1;n>=0;--n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o};function isInstance(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function numberIsNaN(t){return t!=t}var hexSliceLookupTable=(()=>{var t=new Array(256);for(let e=0;e<16;++e){const r=16*e;for(let n=0;n<16;++n)t[r+n]="0123456789abcdef"[e]+"0123456789abcdef"[n]}return t})();export function inRange(t,e){if(t<e[0])return!1;let r=0,n=e.length/2;for(;r<=n;){const o=Math.floor((r+n)/2),i=2*o;if(t>=e[i]&&t<=e[i+1])return!0;t>e[i+1]?r=o+1:n=o-1}return!1}const unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];export const isUnassignedCodePoint=t=>inRange(t,unassigned_code_points);const commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];export const isCommonlyMappedToNothing=t=>inRange(t,commonly_mapped_to_nothing);const non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];export const isNonASCIISpaceCharacter=t=>inRange(t,non_ASCII_space_characters);const non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];export const isProhibitedCharacter=t=>inRange(t,non_ASCII_space_characters)||inRange(t,prohibited_characters)||inRange(t,non_ASCII_controls_characters)||inRange(t,non_character_codepoints);const bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];export const isBidirectionalRAL=t=>inRange(t,bidirectional_r_al);const bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];export const isBidirectionalL=t=>inRange(t,bidirectional_l);const mapping2space=isNonASCIISpaceCharacter,mapping2nothing=isCommonlyMappedToNothing,getCodePoint=t=>t.codePointAt(0),first=t=>t[0],last=t=>t[t.length-1];function toCodePoints(t){const e=[],r=t.length;for(let n=0;n<r;n+=1){const o=t.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){const r=t.charCodeAt(n+1);if(r>=56320&&r<=57343){e.push(1024*(o-55296)+r-56320+65536);n+=1;continue}}e.push(o)}return e}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);{let t=[],e=0,r="";for(let n=0,o=arguments.length;n!==o;++n){let o=+arguments[n];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);if(o<=65535)e=t.push(o);else{o-=65536;e=t.push(55296+(o>>10),o%1024+56320)}if(e>=16383){r+=String.fromCharCode.apply(null,t);t.length=0}}return r+String.fromCharCode.apply(null,t)}}export function saslprep(t,e={}){if("string"!=typeof t)throw new TypeError("Expected string.");if(0===t.length)return"";const r=toCodePoints(t).map(t=>mapping2space(t)?32:t).filter(t=>!mapping2nothing(t)),n=fromCodePoint.apply(null,r).normalize("NFKC"),o=toCodePoints(n);if(o.some(isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned){if(o.some(isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}const i=o.some(isBidirectionalRAL),s=o.some(isBidirectionalL);if(i&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");const a=isBidirectionalRAL(getCodePoint(n[0]));const c=isBidirectionalRAL(getCodePoint(last(n)));if(i&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}export var CryptoJS=function(t,e){var r;"undefined"!=typeof window&&window.crypto&&(r=window.crypto);!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto);var cryptoSecureRandomInt=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(t){var e;F.prototype=t;e=new F;F.prototype=null;return e}}(),o={},i=o.lib={},s=i.Base={extend:function(t){var e=n(this);t&&e.mixIn(t);e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)});e.init.prototype=e;e.$super=this;return e},create:function(){var t=this.extend();t.init.apply(t,arguments);return t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[];this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;this.clamp();if(n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)e[n+i>>>2]=r[i>>>2];this.sigBytes+=o;return this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8;e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);t.words=this.words.slice(0);return t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(cryptoSecureRandomInt());return new a.init(e,t)}}),c=o.enc={},f=c.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16));n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},u=c.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},h=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},p=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t));this._data.concat(t);this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,c=i/(4*s),f=(c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0))*s,u=t.min(4*f,i);if(f){for(var h=0;h<f;h+=s)this._doProcessBlock(o,h);r=o.splice(0,f);n.sigBytes-=u}return new a.init(r,u)},clone:function(){var t=s.clone.call(this);t._data=this._data.clone();return t},_minBufferSize:0}),l=(i.Hasher=p.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t);this.reset()},reset:function(){p.reset.call(this);this._doReset()},update:function(t){this._append(t);this._process();return this},finalize:function(t){t&&this._append(t);return this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new l.HMAC.init(t,r).finalize(e)}}}),o.algo={});return o}(Math);!function(t){var e=CryptoJS,r=e.lib,n=r.WordArray,o=r.Hasher,i=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var a=i.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,o=t[n];t[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=t[e+0],c=t[e+1],f=t[e+2],u=t[e+3],h=t[e+4],p=t[e+5],l=t[e+6],d=t[e+7],y=t[e+8],g=t[e+9],m=t[e+10],_=t[e+11],S=t[e+12],v=t[e+13],w=t[e+14],C=t[e+15],B=i[0],A=i[1],R=i[2],b=i[3];B=FF(B,A,R,b,a,7,s[0]);b=FF(b,B,A,R,c,12,s[1]);R=FF(R,b,B,A,f,17,s[2]);A=FF(A,R,b,B,u,22,s[3]);B=FF(B,A,R,b,h,7,s[4]);b=FF(b,B,A,R,p,12,s[5]);R=FF(R,b,B,A,l,17,s[6]);A=FF(A,R,b,B,d,22,s[7]);B=FF(B,A,R,b,y,7,s[8]);b=FF(b,B,A,R,g,12,s[9]);R=FF(R,b,B,A,m,17,s[10]);A=FF(A,R,b,B,_,22,s[11]);B=FF(B,A,R,b,S,7,s[12]);b=FF(b,B,A,R,v,12,s[13]);R=FF(R,b,B,A,w,17,s[14]);B=GG(B,A=FF(A,R,b,B,C,22,s[15]),R,b,c,5,s[16]);b=GG(b,B,A,R,l,9,s[17]);R=GG(R,b,B,A,_,14,s[18]);A=GG(A,R,b,B,a,20,s[19]);B=GG(B,A,R,b,p,5,s[20]);b=GG(b,B,A,R,m,9,s[21]);R=GG(R,b,B,A,C,14,s[22]);A=GG(A,R,b,B,h,20,s[23]);B=GG(B,A,R,b,g,5,s[24]);b=GG(b,B,A,R,w,9,s[25]);R=GG(R,b,B,A,u,14,s[26]);A=GG(A,R,b,B,y,20,s[27]);B=GG(B,A,R,b,v,5,s[28]);b=GG(b,B,A,R,f,9,s[29]);R=GG(R,b,B,A,d,14,s[30]);B=HH(B,A=GG(A,R,b,B,S,20,s[31]),R,b,p,4,s[32]);b=HH(b,B,A,R,y,11,s[33]);R=HH(R,b,B,A,_,16,s[34]);A=HH(A,R,b,B,w,23,s[35]);B=HH(B,A,R,b,c,4,s[36]);b=HH(b,B,A,R,h,11,s[37]);R=HH(R,b,B,A,d,16,s[38]);A=HH(A,R,b,B,m,23,s[39]);B=HH(B,A,R,b,v,4,s[40]);b=HH(b,B,A,R,a,11,s[41]);R=HH(R,b,B,A,u,16,s[42]);A=HH(A,R,b,B,l,23,s[43]);B=HH(B,A,R,b,g,4,s[44]);b=HH(b,B,A,R,S,11,s[45]);R=HH(R,b,B,A,C,16,s[46]);B=II(B,A=HH(A,R,b,B,f,23,s[47]),R,b,a,6,s[48]);b=II(b,B,A,R,d,10,s[49]);R=II(R,b,B,A,w,15,s[50]);A=II(A,R,b,B,p,21,s[51]);B=II(B,A,R,b,S,6,s[52]);b=II(b,B,A,R,u,10,s[53]);R=II(R,b,B,A,m,15,s[54]);A=II(A,R,b,B,c,21,s[55]);B=II(B,A,R,b,y,6,s[56]);b=II(b,B,A,R,C,10,s[57]);R=II(R,b,B,A,l,15,s[58]);A=II(A,R,b,B,v,21,s[59]);B=II(B,A,R,b,h,6,s[60]);b=II(b,B,A,R,_,10,s[61]);R=II(R,b,B,A,f,15,s[62]);A=II(A,R,b,B,g,21,s[63]);i[0]=i[0]+B|0;i[1]=i[1]+A|0;i[2]=i[2]+R|0;i[3]=i[3]+b|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;r[o>>>5]|=128<<24-o%32;var i=t.floor(n/4294967296),s=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);r[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);e.sigBytes=4*(r.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var t=o.clone.call(this);t._hash=this._hash.clone();return t}});function FF(t,e,r,n,o,i,s){var a=t+(e&r|~e&n)+o+s;return(a<<i|a>>>32-i)+e}function GG(t,e,r,n,o,i,s){var a=t+(e&n|r&~n)+o+s;return(a<<i|a>>>32-i)+e}function HH(t,e,r,n,o,i,s){var a=t+(e^r^n)+o+s;return(a<<i|a>>>32-i)+e}function II(t,e,r,n,o,i,s){var a=t+(r^(e|~n))+o+s;return(a<<i|a>>>32-i)+e}e.MD5=o._createHelper(a);e.HmacMD5=o._createHmacHelper(a)}(Math);!function(t){var e=CryptoJS,r=e.lib,n=r.WordArray,o=r.Hasher,i=e.algo,s=[],a=[];!function(){function isPrime(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function getFractionalBits(t){return 4294967296*(t-(0|t))|0}for(var e=2,r=0;r<64;){if(isPrime(e)){r<8&&(s[r]=getFractionalBits(t.pow(e,.5)));a[r]=getFractionalBits(t.pow(e,1/3));r++}e++}}();var c=[],f=i.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],f=r[4],u=r[5],h=r[6],p=r[7],l=0;l<64;l++){if(l<16)c[l]=0|t[e+l];else{var d=c[l-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,g=c[l-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=y+c[l-7]+m+c[l-16]}var _=n&o^n&i^o&i,S=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),v=p+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&h)+a[l]+c[l];p=h;h=u;u=f;f=s+v|0;s=i;i=o;o=n;n=v+(S+_)|0}r[0]=r[0]+n|0;r[1]=r[1]+o|0;r[2]=r[2]+i|0;r[3]=r[3]+s|0;r[4]=r[4]+f|0;r[5]=r[5]+u|0;r[6]=r[6]+h|0;r[7]=r[7]+p|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;r[o>>>5]|=128<<24-o%32;r[14+(o+64>>>9<<4)]=t.floor(n/4294967296);r[15+(o+64>>>9<<4)]=n;e.sigBytes=4*r.length;this._process();return this._hash},clone:function(){var t=o.clone.call(this);t._hash=this._hash.clone();return t}});e.SHA256=o._createHelper(f);e.HmacSHA256=o._createHmacHelper(f)}(Math);!function(){var t=CryptoJS,e=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=e.extend({init:function(t,e){t=this._hasher=new t.init;"string"==typeof e&&(e=r.parse(e));var n=t.blockSize,o=4*n;e.sigBytes>o&&(e=t.finalize(e));e.clamp();for(var i=this._oKey=e.clone(),s=this._iKey=e.clone(),a=i.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}i.sigBytes=s.sigBytes=o;this.reset()},reset:function(){var t=this._hasher;t.reset();t.update(this._iKey)},update:function(t){this._hasher.update(t);return this},finalize:function(t){var e=this._hasher,r=e.finalize(t);e.reset();return e.finalize(this._oKey.clone().concat(r))}})}();CryptoJS.lib.Cipher||function(t){var e=CryptoJS,r=e.lib,n=r.Base,o=r.WordArray,i=r.BufferedBlockAlgorithm,s=e.enc,a=(s.Utf8,s.Base64),c=e.algo.EvpKDF,f=r.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r);this._xformMode=t;this._key=e;this.reset()},reset:function(){i.reset.call(this);this._doReset()},process:function(t){this._append(t);return this._process()},finalize:function(t){t&&this._append(t);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(t){return"string"==typeof t?_:g}return function(t){return{encrypt:function(e,r,n){return selectCipherStrategy(r).encrypt(t,e,r,n)},decrypt:function(e,r,n){return selectCipherStrategy(r).decrypt(t,e,r,n)}}}}()}),u=(r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),h=r.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t;this._iv=e}}),p=u.CBC=function(){var t=h.extend();t.Encryptor=t.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize;xorBlock.call(this,t,e,n);r.encryptBlock(t,e);this._prevBlock=t.slice(e,e+n)}});t.Decryptor=t.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,o=t.slice(e,e+n);r.decryptBlock(t,e);xorBlock.call(this,t,e,n);this._prevBlock=o}});function xorBlock(t,e,r){var n,o=this._iv;if(o){n=o;this._iv=void 0}else n=this._prevBlock;for(var i=0;i<r;i++)t[e+i]^=n[i]}return t}(),l=(e.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,n=r-t.sigBytes%r,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var c=o.create(s,n);t.concat(c)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},d=(r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:l}),reset:function(){var t;f.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)t=n.createEncryptor;else{t=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==t)this._mode.init(this,r&&r.words);else{this._mode=t.call(n,this,r&&r.words);this._mode.__creator=t}},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),r.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(e):e).toString(a)},parse:function(t){var e,r=a.parse(t),n=r.words;if(1398893684==n[0]&&1701076831==n[1]){e=o.create(n.slice(2,4));n.splice(0,4);r.sigBytes-=16}return d.create({ciphertext:r,salt:e})}},g=r.SerializableCipher=n.extend({cfg:n.extend({format:y}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var o=t.createEncryptor(r,n),i=o.finalize(e),s=o.cfg;return d.create({ciphertext:i,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n);e=this._parse(e,n.format);return t.createDecryptor(r,n).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),m=(e.kdf={}).OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=c.create({keySize:e+r}).compute(t,n),s=o.create(i.words.slice(e),4*r);i.sigBytes=4*e;return d.create({key:i,iv:s,salt:n})}},_=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:m}),encrypt:function(t,e,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,t,e,o.key,n);i.mixIn(o);return i},decrypt:function(t,e,r,n){n=this.cfg.extend(n);e=this._parse(e,n.format);var o=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=o.iv;return g.decrypt.call(this,t,e,o.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var t=CryptoJS.lib.WordArray,e=t.init;(t.init=function(t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength));if(t instanceof Uint8Array){for(var r=t.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=t[o]<<24-o%4*8;e.call(this,n,r)}else e.apply(this,arguments)}).prototype=t}}();CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var t=CryptoJS,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var r=t.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(r=a)}return function parseLoop(t,r,n){for(var o=[],i=0,s=0;s<r;s++)if(s%4){var a=n[t.charCodeAt(s-1)]<<s%4*2,c=n[t.charCodeAt(s)]>>>6-s%4*2,f=a|c;o[i>>>2]|=f<<24-i%4*8;i++}return e.create(o,i)}(t,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var t=CryptoJS,e=t.lib,r=e.Base,n=e.WordArray,o=t.algo,i=o.MD5,s=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:i,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,o=this.cfg,i=o.hasher.create(),s=n.create(),a=s.words,c=o.keySize,f=o.iterations;a.length<c;){r&&i.update(r);r=i.update(t).finalize(e);i.reset();for(var u=1;u<f;u++){r=i.finalize(r);i.reset()}s.concat(r)}s.sigBytes=4*c;return s}});t.EvpKDF=function(t,e,r){return s.create(r).compute(t,e)}}();!function(){var t=CryptoJS,e=t.lib.BlockCipher,r=t.algo,n=[],o=[],i=[],s=[],a=[],c=[],f=[],u=[],h=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,l=0;for(e=0;e<256;e++){var d=l^l<<1^l<<2^l<<3^l<<4;d=d>>>8^255&d^99;n[r]=d;o[d]=r;var y=t[r],g=t[y],m=t[g],_=257*t[d]^16843008*d;i[r]=_<<24|_>>>8;s[r]=_<<16|_>>>16;a[r]=_<<8|_>>>24;c[r]=_;_=16843009*m^65537*g^257*y^16843008*r;f[d]=_<<24|_>>>8;u[d]=_<<16|_>>>16;h[d]=_<<8|_>>>24;p[d]=_;if(r){r=y^t[t[t[m^y]]];l^=t[t[l]]}else r=l=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],d=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,o=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],s=0;s<o;s++)if(s<r)i[s]=e[s];else{d=i[s-1];if(s%r)r>6&&s%r==4&&(d=n[d>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d]);else{d=n[(d=d<<8|d>>>24)>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d];d^=l[s/r|0]<<24}i[s]=i[s-r]^d}for(var a=this._invKeySchedule=[],c=0;c<o;c++){s=o-c;if(c%4)var d=i[s];else d=i[s-4];a[c]=c<4||s<=4?d:f[n[d>>>24]]^u[n[d>>>16&255]]^h[n[d>>>8&255]]^p[n[255&d]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,i,s,a,c,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3];t[e+3]=r;this._doCryptBlock(t,e,this._invKeySchedule,f,u,h,p,o);r=t[e+1];t[e+1]=t[e+3];t[e+3]=r},_doCryptBlock:function(t,e,r,n,o,i,s,a){for(var c=this._nRounds,f=t[e]^r[0],u=t[e+1]^r[1],h=t[e+2]^r[2],p=t[e+3]^r[3],l=4,d=1;d<c;d++){var y=n[f>>>24]^o[u>>>16&255]^i[h>>>8&255]^s[255&p]^r[l++],g=n[u>>>24]^o[h>>>16&255]^i[p>>>8&255]^s[255&f]^r[l++],m=n[h>>>24]^o[p>>>16&255]^i[f>>>8&255]^s[255&u]^r[l++],_=n[p>>>24]^o[f>>>16&255]^i[u>>>8&255]^s[255&h]^r[l++];f=y;u=g;h=m;p=_}y=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[h>>>8&255]<<8|a[255&p])^r[l++],g=(a[u>>>24]<<24|a[h>>>16&255]<<16|a[p>>>8&255]<<8|a[255&f])^r[l++],m=(a[h>>>24]<<24|a[p>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[l++],_=(a[p>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&h])^r[l++];t[e]=y;t[e+1]=g;t[e+2]=m;t[e+3]=_},keySize:8});t.AES=e._createHelper(d)}();!function(){var t=CryptoJS,e=t.lib.StreamCipher,r=t.algo,n=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var s=o%r,a=e[s>>>2]>>>24-s%4*8&255;i=(i+n[o]+a)%256;var c=n[o];n[o]=n[i];n[i]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var t=this._S,e=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+t[e=(e+1)%256])%256;var i=t[e];t[e]=t[r];t[r]=i;n|=t[(t[e]+t[r])%256]<<24-8*o}this._i=e;this._j=r;return n}t.RC4=e._createHelper(n);var o=r.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)generateKeystreamWord.call(this)}});t.RC4Drop=e._createHelper(o)}();CryptoJS.mode.ECB=function(){var t=CryptoJS.lib.BlockCipherMode.extend();t.Encryptor=t.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}});t.Decryptor=t.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}});return t}();export class _PDFSecurity{static generateFileID(t={}){let e=t.CreationDate.getTime()+"\n";for(const r in t)t.hasOwnProperty(r)&&(e+=`${r}: ${t[r]}\n`);return wordArrayToBuffer(CryptoJS.MD5(e))}static generateRandomWordArray(t){return CryptoJS.lib.WordArray.random(t)}static create(t,e={}){return e.ownerPassword||e.userPassword?new _PDFSecurity(t,e):null}constructor(t,e={}){if(!e.ownerPassword&&!e.userPassword)throw new Error("None of owner password and user password is defined.");this.document=t;this._setupEncryption(e)}_setupEncryption(t){switch(t.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}const e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,t);break;case 5:this._setupEncryptionV5(e,t)}this.dictionary=this.document.ref(e)}_setupEncryptionV1V2V4(t,e,r){let n,o;switch(t){case 1:n=2;this.keyBits=40;o=getPermissionsR2(r.permissions);break;case 2:n=3;this.keyBits=128;o=getPermissionsR3(r.permissions);break;case 4:n=4;this.keyBits=128;o=getPermissionsR3(r.permissions)}const i=processPasswordR2R3R4(r.userPassword),s=r.ownerPassword?processPasswordR2R3R4(r.ownerPassword):i,a=getOwnerPasswordR2R3R4(n,this.keyBits,i,s);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,i,a,o);let c;c=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);e.V=t;t>=2&&(e.Length=this.keyBits);if(4===t){e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF"}e.R=n;e.O=wordArrayToBuffer(a);e.U=wordArrayToBuffer(c);e.P=o}_setupEncryptionV5(t,e){this.keyBits=256;const r=getPermissionsR3(e.permissions),n=processPasswordR5(e.userPassword),o=e.ownerPassword?processPasswordR5(e.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);const i=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,CryptoJS.lib.WordArray.create(i.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(o,i,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(o,CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),i,this.encryptionKey),f=getEncryptedPermissionsR5(r,this.encryptionKey,_PDFSecurity.generateRandomWordArray);t.V=5;t.Length=this.keyBits;t.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};t.StmF="StdCF";t.StrF="StdCF";t.R=5;t.O=wordArrayToBuffer(a);t.OE=wordArrayToBuffer(c);t.U=wordArrayToBuffer(i);t.UE=wordArrayToBuffer(s);t.P=r;t.Perms=wordArrayToBuffer(f)}getEncryptFn(t,e){let r,n;this.version<5&&(r=this.encryptionKey.clone().concat(CryptoJS.lib.WordArray.create([(255&t)<<24|(65280&t)<<8|t>>8&65280|255&e,(65280&e)<<16],5)));if(1===this.version||2===this.version){const t=CryptoJS.MD5(r);t.sigBytes=Math.min(16,this.keyBits/8+5);return e=>wordArrayToBuffer(CryptoJS.RC4.encrypt(CryptoJS.lib.WordArray.create(e),t).ciphertext)}n=4===this.version?CryptoJS.MD5(r.concat(CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;const o=_PDFSecurity.generateRandomWordArray(16),i={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:o};return t=>wordArrayToBuffer(o.clone().concat(CryptoJS.AES.encrypt(CryptoJS.lib.WordArray.create(t),n,i).ciphertext))}end(){this.dictionary.end()}}function getPermissionsR2(t={}){let e=-64;t.printing&&(e|=4);t.modifying&&(e|=8);t.copying&&(e|=16);t.annotating&&(e|=32);return e}function getPermissionsR3(t={}){let e=-3904;"lowResolution"===t.printing&&(e|=4);"highResolution"===t.printing&&(e|=2052);t.modifying&&(e|=8);t.copying&&(e|=16);t.annotating&&(e|=32);t.fillingForms&&(e|=256);t.contentAccessibility&&(e|=512);t.documentAssembly&&(e|=1024);return e}function getUserPasswordR2(t){return CryptoJS.RC4.encrypt(processPasswordR2R3R4(),t).ciphertext}function getUserPasswordR3R4(t,e){const r=e.clone();let n=CryptoJS.MD5(processPasswordR2R3R4().concat(CryptoJS.lib.WordArray.create(t)));for(let t=0;t<20;t++){const o=Math.ceil(r.sigBytes/4);for(let n=0;n<o;n++)r.words[n]=e.words[n]^(t|t<<8|t<<16|t<<24);n=CryptoJS.RC4.encrypt(n,r).ciphertext}return n.concat(CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(t,e,r,n){let o=n,i=t>=3?51:1;for(let t=0;t<i;t++)o=CryptoJS.MD5(o);const s=o.clone();s.sigBytes=e/8;let a=r;i=t>=3?20:1;for(let t=0;t<i;t++){const e=Math.ceil(s.sigBytes/4);for(let r=0;r<e;r++)s.words[r]=o.words[r]^(t|t<<8|t<<16|t<<24);a=CryptoJS.RC4.encrypt(a,s).ciphertext}return a}function getEncryptionKeyR2R3R4(t,e,r,n,o,i){let s=n.clone().concat(o).concat(CryptoJS.lib.WordArray.create([lsbFirstWord(i)],4)).concat(CryptoJS.lib.WordArray.create(r));const a=t>=3?51:1;for(let t=0;t<a;t++){s=CryptoJS.MD5(s);s.sigBytes=e/8}return s}function getUserPasswordR5(t,e){const r=e(8),n=e(8);return CryptoJS.SHA256(t.clone().concat(r)).concat(r).concat(n)}function getUserEncryptionKeyR5(t,e,r){const n=CryptoJS.SHA256(t.clone().concat(e)),o={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(r,n,o).ciphertext}function getOwnerPasswordR5(t,e,r){const n=r(8),o=r(8);return CryptoJS.SHA256(t.clone().concat(n).concat(e)).concat(n).concat(o)}function getOwnerEncryptionKeyR5(t,e,r,n){const o=CryptoJS.SHA256(t.clone().concat(e).concat(r)),i={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(n,o,i).ciphertext}function getEncryptionKeyR5(t){return t(32)}function getEncryptedPermissionsR5(t,e,r){const n=CryptoJS.lib.WordArray.create([lsbFirstWord(t),4294967295,1415668834],12).concat(r(4)),o={mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.NoPadding};return CryptoJS.AES.encrypt(n,e,o).ciphertext}function processPasswordR2R3R4(t=""){const e=new Buffer(32),r=t.length;let n=0;for(;n<r&&n<32;){const r=t.charCodeAt(n);if(r>255)throw new Error("Password contains one or more invalid characters.");e[n]=r;n++}for(;n<32;){e[n]=PASSWORD_PADDING[n-r];n++}return CryptoJS.lib.WordArray.create(e)}function processPasswordR5(t=""){t=unescape(encodeURIComponent(saslprep(t)));const e=Math.min(127,t.length),r=new Buffer(e);for(let n=0;n<e;n++)r[n]=t.charCodeAt(n);return CryptoJS.lib.WordArray.create(r)}function lsbFirstWord(t){return(255&t)<<24|(65280&t)<<8|t>>8&65280|t>>24&255}function wordArrayToBuffer(t){const e=[];for(let r=0;r<t.sigBytes;r++)e.push(t.words[Math.floor(r/4)]>>8*(3-r%4)&255);return Buffer.from(e)}const PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];_registerModule("wijmo.pdf.security",selfModule);
package/es5-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.45-nightly.d20260106.t072437
3
+ * Wijmo Library 5.20261.45-nightly.d20260108.t163148
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- import{_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.pdf.security";var K_MAX_LENGTH=2147483647;function createBuffer(r){if(r>K_MAX_LENGTH)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);Object.setPrototypeOf(e,Buffer.prototype);return e}export function Buffer(r,e,t){if("number"==typeof r){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(r)}return from(r,e,t)}function from(r,e,t){if(ArrayBuffer.isView(r))return fromArrayLike(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(isInstance(r,ArrayBuffer)||r&&isInstance(r.buffer,ArrayBuffer))return fromArrayBuffer(r,e,t);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(r,SharedArrayBuffer)||r&&isInstance(r.buffer,SharedArrayBuffer)))return fromArrayBuffer(r,e,t);if("number"==typeof r)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(null!=n&&n!==r)return Buffer.from(n,e,t);var i=fromObject(r);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof r[Symbol.toPrimitive])return Buffer.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}Buffer.from=function(r,e,t){return from(r,e,t)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(r){if("number"!=typeof r)throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function allocUnsafe(r){assertSize(r);return createBuffer(r<0?0:0|checked(r))}function fromArrayLike(r){for(var e=r.length<0?0:0|checked(r.length),t=createBuffer(e),n=0;n<e;n+=1)t[n]=255&r[n];return t}function fromArrayBuffer(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===t?new Uint8Array(r):void 0===t?new Uint8Array(r,e):new Uint8Array(r,e,t);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(r){if(Buffer.isBuffer(r)){var e=0|checked(r.length),t=createBuffer(e);if(0===t.length)return t;r.copy(t,0,0,e);return t}return void 0!==r.length?"number"!=typeof r.length||numberIsNaN(r.length)?createBuffer(0):fromArrayLike(r):"Buffer"===r.type&&Array.isArray(r.data)?fromArrayLike(r.data):void 0}function checked(r){if(r>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|r}Buffer.isBuffer=function isBuffer(r){return null!=r&&!0===r._isBuffer&&r!==Buffer.prototype};function slowToString(r,e,t){var n=!1;(void 0===e||e<0)&&(e=0);if(e>this.length)return"";(void 0===t||t>this.length)&&(t=this.length);if(t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";r||(r="utf8");for(;;)switch(r){case"hex":return hexSlice(this,e,t);case"utf8":case"utf-8":return utf8Slice(this,e,t);case"ascii":return asciiSlice(this,e,t);case"latin1":case"binary":return latin1Slice(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var r=this.length;return 0===r?"":0===arguments.length?utf8Slice(this,0,r):slowToString.apply(this,arguments)};function utf8Slice(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var o=r[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=t){var c=void 0,f=void 0,u=void 0,h=void 0;switch(a){case 1:o<128&&(s=o);break;case 2:128==(192&(c=r[i+1]))&&(h=(31&o)<<6|63&c)>127&&(s=h);break;case 3:c=r[i+1];f=r[i+2];128==(192&c)&&128==(192&f)&&(h=(15&o)<<12|(63&c)<<6|63&f)>2047&&(h<55296||h>57343)&&(s=h);break;case 4:c=r[i+1];f=r[i+2];u=r[i+3];128==(192&c)&&128==(192&f)&&128==(192&u)&&(h=(15&o)<<18|(63&c)<<12|(63&f)<<6|63&u)>65535&&h<1114112&&(s=h)}}if(null===s){s=65533;a=1}else if(s>65535){s-=65536;n.push(s>>>10&1023|55296);s=56320|1023&s}n.push(s);i+=a}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(r){var e=r.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;){var i=Math.min(n+MAX_ARGUMENTS_LENGTH,e);t+=String.fromCharCode.apply(String,r.slice(n,i));n=i}return t}function asciiSlice(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(127&r[i]);return n}function latin1Slice(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function hexSlice(r,e,t){var n=r.length;(!e||e<0)&&(e=0);(!t||t<0||t>n)&&(t=n);for(var i="",o=e;o<t;++o)i+=hexSliceLookupTable[r[o]];return i}function utf16leSlice(r,e,t){for(var n=r.slice(e,t),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}Buffer.prototype.slice=function slice(r,e){var t,n=this.length;(r=~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n);(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);e<r&&(e=r);return t=this.subarray(r,e)(Object).setPrototypeOf(t,Buffer.prototype)};Buffer.prototype.copy=function copy(r,e,t,n){if(!Buffer.isBuffer(r))throw new TypeError("argument should be a Buffer");t||(t=0);n||0===n||(n=this.length);e>=r.length&&(e=r.length);e||(e=0);n>0&&n<t&&(n=t);if(n===t)return 0;if(0===r.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);r.length-e<n-t&&(n=r.length-e+t);var i=n-t;if(this===r&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,t,n);else if(this===r&&t<e&&e<n)for(var o=i-1;o>=0;--o)r[o+e]=this[o+t];else Uint8Array.prototype.set.call(r,this.subarray(t,n),e);return i};function isInstance(r,e){return r instanceof e||null!=r&&null!=r.constructor&&null!=r.constructor.name&&r.constructor.name===e.name}function numberIsNaN(r){return r!=r}var hexSliceLookupTable=function(){for(var r=new Array(256),e=0;e<16;++e)for(var t=16*e,n=0;n<16;++n)r[t+n]="0123456789abcdef"[e]+"0123456789abcdef"[n];return r}();export function inRange(r,e){if(r<e[0])return!1;for(var t=0,n=e.length/2;t<=n;){var i=Math.floor((t+n)/2),o=2*i;if(r>=e[o]&&r<=e[o+1])return!0;r>e[o+1]?t=i+1:n=i-1}return!1}var unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];export var isUnassignedCodePoint=function(r){return inRange(r,unassigned_code_points)};var commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];export var isCommonlyMappedToNothing=function(r){return inRange(r,commonly_mapped_to_nothing)};var non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];export var isNonASCIISpaceCharacter=function(r){return inRange(r,non_ASCII_space_characters)};var non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];export var isProhibitedCharacter=function(r){return inRange(r,non_ASCII_space_characters)||inRange(r,prohibited_characters)||inRange(r,non_ASCII_controls_characters)||inRange(r,non_character_codepoints)};var bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];export var isBidirectionalRAL=function(r){return inRange(r,bidirectional_r_al)};var bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];export var isBidirectionalL=function(r){return inRange(r,bidirectional_l)};var mapping2space=isNonASCIISpaceCharacter,mapping2nothing=isCommonlyMappedToNothing,getCodePoint=function(r){return r.codePointAt(0)},first=function(r){return r[0]},last=function(r){return r[r.length-1]};function toCodePoints(r){for(var e=[],t=r.length,n=0;n<t;n+=1){var i=r.charCodeAt(n);if(i>=55296&&i<=56319&&t>n+1){var o=r.charCodeAt(n+1);if(o>=56320&&o<=57343){e.push(1024*(i-55296)+o-56320+65536);n+=1;continue}}e.push(i)}return e}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);for(var r=[],e=0,t="",n=0,i=arguments.length;n!==i;++n){var o=+arguments[n];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);if(o<=65535)e=r.push(o);else{o-=65536;e=r.push(55296+(o>>10),o%1024+56320)}if(e>=16383){t+=String.fromCharCode.apply(null,r);r.length=0}}return t+String.fromCharCode.apply(null,r)}export function saslprep(r,e){void 0===e&&(e={});if("string"!=typeof r)throw new TypeError("Expected string.");if(0===r.length)return"";var t=toCodePoints(r).map((function(r){return mapping2space(r)?32:r})).filter((function(r){return!mapping2nothing(r)})),n=fromCodePoint.apply(null,t).normalize("NFKC"),i=toCodePoints(n);if(i.some(isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned){if(i.some(isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}var o=i.some(isBidirectionalRAL),s=i.some(isBidirectionalL);if(o&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");var a=isBidirectionalRAL(getCodePoint(first(n))),c=isBidirectionalRAL(getCodePoint(last(n)));if(o&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}export var CryptoJS=function(r,e){var t;"undefined"!=typeof window&&window.crypto&&(t=window.crypto);!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto);var cryptoSecureRandomInt=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(r){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(r){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(r){var e;F.prototype=r;e=new F;F.prototype=null;return e}}(),i={},o=i.lib={},s=o.Base={extend:function(r){var e=n(this);r&&e.mixIn(r);e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)});e.init.prototype=e;e.$super=this;return e},create:function(){var r=this.extend();r.init.apply(r,arguments);return r},init:function(){},mixIn:function(r){for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=s.extend({init:function(r,e){r=this.words=r||[];this.sigBytes=null!=e?e:4*r.length},toString:function(r){return(r||f).stringify(this)},concat:function(r){var e=this.words,t=r.words,n=this.sigBytes,i=r.sigBytes;this.clamp();if(n%4)for(var o=0;o<i;o++){var s=t[o>>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o<i;o+=4)e[n+o>>>2]=t[o>>>2];this.sigBytes+=i;return this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8;e.length=r.ceil(t/4)},clone:function(){var r=s.clone.call(this);r.words=this.words.slice(0);return r},random:function(r){for(var e=[],t=0;t<r;t+=4)e.push(cryptoSecureRandomInt());return new a.init(e,r)}}),c=i.enc={},f=c.Hex={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],i=0;i<t;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16));n.push((15&o).toString(16))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n+=2)t[n>>>3]|=parseInt(r.substr(n,2),16)<<24-n%8*4;return new a.init(t,e/2)}},u=c.Latin1={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],i=0;i<t;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n++)t[n>>>2]|=(255&r.charCodeAt(n))<<24-n%4*8;return new a.init(t,e)}},h=c.Utf8={stringify:function(r){try{return decodeURIComponent(escape(u.stringify(r)))}catch(r){throw new Error("Malformed UTF-8 data")}},parse:function(r){return u.parse(unescape(encodeURIComponent(r)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(r){"string"==typeof r&&(r=h.parse(r));this._data.concat(r);this._nDataBytes+=r.sigBytes},_process:function(e){var t,n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,c=o/(4*s),f=(c=e?r.ceil(c):r.max((0|c)-this._minBufferSize,0))*s,u=r.min(4*f,o);if(f){for(var h=0;h<f;h+=s)this._doProcessBlock(i,h);t=i.splice(0,f);n.sigBytes-=u}return new a.init(t,u)},clone:function(){var r=s.clone.call(this);r._data=this._data.clone();return r},_minBufferSize:0}),d=(o.Hasher=p.extend({cfg:s.extend(),init:function(r){this.cfg=this.cfg.extend(r);this.reset()},reset:function(){p.reset.call(this);this._doReset()},update:function(r){this._append(r);this._process();return this},finalize:function(r){r&&this._append(r);return this._doFinalize()},blockSize:16,_createHelper:function(r){return function(e,t){return new r.init(t).finalize(e)}},_createHmacHelper:function(r){return function(e,t){return new d.HMAC.init(r,t).finalize(e)}}}),i.algo={});return i}(Math);!function(r){var e=CryptoJS,t=e.lib,n=t.WordArray,i=t.Hasher,o=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*r.abs(r.sin(e+1))|0}();var a=o.MD5=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var n=e+t,i=r[n];r[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=r[e+0],c=r[e+1],f=r[e+2],u=r[e+3],h=r[e+4],p=r[e+5],d=r[e+6],y=r[e+7],l=r[e+8],g=r[e+9],v=r[e+10],_=r[e+11],m=r[e+12],S=r[e+13],w=r[e+14],C=r[e+15],B=o[0],A=o[1],R=o[2],b=o[3];B=FF(B,A,R,b,a,7,s[0]);b=FF(b,B,A,R,c,12,s[1]);R=FF(R,b,B,A,f,17,s[2]);A=FF(A,R,b,B,u,22,s[3]);B=FF(B,A,R,b,h,7,s[4]);b=FF(b,B,A,R,p,12,s[5]);R=FF(R,b,B,A,d,17,s[6]);A=FF(A,R,b,B,y,22,s[7]);B=FF(B,A,R,b,l,7,s[8]);b=FF(b,B,A,R,g,12,s[9]);R=FF(R,b,B,A,v,17,s[10]);A=FF(A,R,b,B,_,22,s[11]);B=FF(B,A,R,b,m,7,s[12]);b=FF(b,B,A,R,S,12,s[13]);R=FF(R,b,B,A,w,17,s[14]);B=GG(B,A=FF(A,R,b,B,C,22,s[15]),R,b,c,5,s[16]);b=GG(b,B,A,R,d,9,s[17]);R=GG(R,b,B,A,_,14,s[18]);A=GG(A,R,b,B,a,20,s[19]);B=GG(B,A,R,b,p,5,s[20]);b=GG(b,B,A,R,v,9,s[21]);R=GG(R,b,B,A,C,14,s[22]);A=GG(A,R,b,B,h,20,s[23]);B=GG(B,A,R,b,g,5,s[24]);b=GG(b,B,A,R,w,9,s[25]);R=GG(R,b,B,A,u,14,s[26]);A=GG(A,R,b,B,l,20,s[27]);B=GG(B,A,R,b,S,5,s[28]);b=GG(b,B,A,R,f,9,s[29]);R=GG(R,b,B,A,y,14,s[30]);B=HH(B,A=GG(A,R,b,B,m,20,s[31]),R,b,p,4,s[32]);b=HH(b,B,A,R,l,11,s[33]);R=HH(R,b,B,A,_,16,s[34]);A=HH(A,R,b,B,w,23,s[35]);B=HH(B,A,R,b,c,4,s[36]);b=HH(b,B,A,R,h,11,s[37]);R=HH(R,b,B,A,y,16,s[38]);A=HH(A,R,b,B,v,23,s[39]);B=HH(B,A,R,b,S,4,s[40]);b=HH(b,B,A,R,a,11,s[41]);R=HH(R,b,B,A,u,16,s[42]);A=HH(A,R,b,B,d,23,s[43]);B=HH(B,A,R,b,g,4,s[44]);b=HH(b,B,A,R,m,11,s[45]);R=HH(R,b,B,A,C,16,s[46]);B=II(B,A=HH(A,R,b,B,f,23,s[47]),R,b,a,6,s[48]);b=II(b,B,A,R,y,10,s[49]);R=II(R,b,B,A,w,15,s[50]);A=II(A,R,b,B,p,21,s[51]);B=II(B,A,R,b,m,6,s[52]);b=II(b,B,A,R,u,10,s[53]);R=II(R,b,B,A,v,15,s[54]);A=II(A,R,b,B,c,21,s[55]);B=II(B,A,R,b,l,6,s[56]);b=II(b,B,A,R,C,10,s[57]);R=II(R,b,B,A,d,15,s[58]);A=II(A,R,b,B,S,21,s[59]);B=II(B,A,R,b,h,6,s[60]);b=II(b,B,A,R,_,10,s[61]);R=II(R,b,B,A,f,15,s[62]);A=II(A,R,b,B,g,21,s[63]);o[0]=o[0]+B|0;o[1]=o[1]+A|0;o[2]=o[2]+R|0;o[3]=o[3]+b|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var o=r.floor(n/4294967296),s=n;t[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);t[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);e.sigBytes=4*(t.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var r=i.clone.call(this);r._hash=this._hash.clone();return r}});function FF(r,e,t,n,i,o,s){var a=r+(e&t|~e&n)+i+s;return(a<<o|a>>>32-o)+e}function GG(r,e,t,n,i,o,s){var a=r+(e&n|t&~n)+i+s;return(a<<o|a>>>32-o)+e}function HH(r,e,t,n,i,o,s){var a=r+(e^t^n)+i+s;return(a<<o|a>>>32-o)+e}function II(r,e,t,n,i,o,s){var a=r+(t^(e|~n))+i+s;return(a<<o|a>>>32-o)+e}e.MD5=i._createHelper(a);e.HmacMD5=i._createHmacHelper(a)}(Math);!function(r){var e=CryptoJS,t=e.lib,n=t.WordArray,i=t.Hasher,o=e.algo,s=[],a=[];!function(){function isPrime(e){for(var t=r.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function getFractionalBits(r){return 4294967296*(r-(0|r))|0}for(var e=2,t=0;t<64;){if(isPrime(e)){t<8&&(s[t]=getFractionalBits(r.pow(e,.5)));a[t]=getFractionalBits(r.pow(e,1/3));t++}e++}}();var c=[],f=o.SHA256=i.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(r,e){for(var t=this._hash.words,n=t[0],i=t[1],o=t[2],s=t[3],f=t[4],u=t[5],h=t[6],p=t[7],d=0;d<64;d++){if(d<16)c[d]=0|r[e+d];else{var y=c[d-15],l=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,g=c[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[d]=l+c[d-7]+v+c[d-16]}var _=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),S=p+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&h)+a[d]+c[d];p=h;h=u;u=f;f=s+S|0;s=o;o=i;i=n;n=S+(m+_)|0}t[0]=t[0]+n|0;t[1]=t[1]+i|0;t[2]=t[2]+o|0;t[3]=t[3]+s|0;t[4]=t[4]+f|0;t[5]=t[5]+u|0;t[6]=t[6]+h|0;t[7]=t[7]+p|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;t[14+(i+64>>>9<<4)]=r.floor(n/4294967296);t[15+(i+64>>>9<<4)]=n;e.sigBytes=4*t.length;this._process();return this._hash},clone:function(){var r=i.clone.call(this);r._hash=this._hash.clone();return r}});e.SHA256=i._createHelper(f);e.HmacSHA256=i._createHmacHelper(f)}(Math);!function(){var r=CryptoJS,e=r.lib.Base,t=r.enc.Utf8;r.algo.HMAC=e.extend({init:function(r,e){r=this._hasher=new r.init;"string"==typeof e&&(e=t.parse(e));var n=r.blockSize,i=4*n;e.sigBytes>i&&(e=r.finalize(e));e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),a=o.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}o.sigBytes=s.sigBytes=i;this.reset()},reset:function(){var r=this._hasher;r.reset();r.update(this._iKey)},update:function(r){this._hasher.update(r);return this},finalize:function(r){var e=this._hasher,t=e.finalize(r);e.reset();return e.finalize(this._oKey.clone().concat(t))}})}();CryptoJS.lib.Cipher||function(r){var e=CryptoJS,t=e.lib,n=t.Base,i=t.WordArray,o=t.BufferedBlockAlgorithm,s=e.enc,a=(s.Utf8,s.Base64),c=e.algo.EvpKDF,f=t.Cipher=o.extend({cfg:n.extend(),createEncryptor:function(r,e){return this.create(this._ENC_XFORM_MODE,r,e)},createDecryptor:function(r,e){return this.create(this._DEC_XFORM_MODE,r,e)},init:function(r,e,t){this.cfg=this.cfg.extend(t);this._xformMode=r;this._key=e;this.reset()},reset:function(){o.reset.call(this);this._doReset()},process:function(r){this._append(r);return this._process()},finalize:function(r){r&&this._append(r);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(r){return"string"==typeof r?_:g}return function(r){return{encrypt:function(e,t,n){return selectCipherStrategy(t).encrypt(r,e,t,n)},decrypt:function(e,t,n){return selectCipherStrategy(t).decrypt(r,e,t,n)}}}}()}),u=(t.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),h=t.BlockCipherMode=n.extend({createEncryptor:function(r,e){return this.Encryptor.create(r,e)},createDecryptor:function(r,e){return this.Decryptor.create(r,e)},init:function(r,e){this._cipher=r;this._iv=e}}),p=u.CBC=function(){var r=h.extend();r.Encryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize;xorBlock.call(this,r,e,n);t.encryptBlock(r,e);this._prevBlock=r.slice(e,e+n)}});r.Decryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize,i=r.slice(e,e+n);t.decryptBlock(r,e);xorBlock.call(this,r,e,n);this._prevBlock=i}});function xorBlock(r,e,t){var n,i=this._iv;if(i){n=i;this._iv=void 0}else n=this._prevBlock;for(var o=0;o<t;o++)r[e+o]^=n[o]}return r}(),d=(e.pad={}).Pkcs7={pad:function(r,e){for(var t=4*e,n=t-r.sigBytes%t,o=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(o);var c=i.create(s,n);r.concat(c)},unpad:function(r){var e=255&r.words[r.sigBytes-1>>>2];r.sigBytes-=e}},y=(t.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:d}),reset:function(){var r;f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)r=n.createEncryptor;else{r=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==r)this._mode.init(this,t&&t.words);else{this._mode=r.call(n,this,t&&t.words);this._mode.__creator=r}},_doProcessBlock:function(r,e){this._mode.processBlock(r,e)},_doFinalize:function(){var r,e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);r=this._process(!0)}else{r=this._process(!0);e.unpad(r)}return r},blockSize:4}),t.CipherParams=n.extend({init:function(r){this.mixIn(r)},toString:function(r){return(r||this.formatter).stringify(this)}})),l=(e.format={}).OpenSSL={stringify:function(r){var e=r.ciphertext,t=r.salt;return(t?i.create([1398893684,1701076831]).concat(t).concat(e):e).toString(a)},parse:function(r){var e,t=a.parse(r),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){e=i.create(n.slice(2,4));n.splice(0,4);t.sigBytes-=16}return y.create({ciphertext:t,salt:e})}},g=t.SerializableCipher=n.extend({cfg:n.extend({format:l}),encrypt:function(r,e,t,n){n=this.cfg.extend(n);var i=r.createEncryptor(t,n),o=i.finalize(e),s=i.cfg;return y.create({ciphertext:o,key:t,iv:s.iv,algorithm:r,mode:s.mode,padding:s.padding,blockSize:r.blockSize,formatter:n.format})},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);return r.createDecryptor(t,n).finalize(e.ciphertext)},_parse:function(r,e){return"string"==typeof r?e.parse(r,this):r}}),v=(e.kdf={}).OpenSSL={execute:function(r,e,t,n){n||(n=i.random(8));var o=c.create({keySize:e+t}).compute(r,n),s=i.create(o.words.slice(e),4*t);o.sigBytes=4*e;return y.create({key:o,iv:s,salt:n})}},_=t.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(r,e,t,n){var i=(n=this.cfg.extend(n)).kdf.execute(t,r.keySize,r.ivSize);n.iv=i.iv;var o=g.encrypt.call(this,r,e,i.key,n);o.mixIn(i);return o},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);var i=n.kdf.execute(t,r.keySize,r.ivSize,e.salt);n.iv=i.iv;return g.decrypt.call(this,r,e,i.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var r=CryptoJS.lib.WordArray,e=r.init;(r.init=function(r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));(r instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));if(r instanceof Uint8Array){for(var t=r.byteLength,n=[],i=0;i<t;i++)n[i>>>2]|=r[i]<<24-i%4*8;e.call(this,n,t)}else e.apply(this,arguments)}).prototype=r}}();CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var r=CryptoJS,e=r.lib.WordArray;r.enc.Base64={stringify:function(r){var e=r.words,t=r.sigBytes,n=this._map;r.clamp();for(var i=[],o=0;o<t;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<t;a++)i.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(r){var t=r.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=r.indexOf(s);-1!==a&&(t=a)}return function parseLoop(r,t,n){for(var i=[],o=0,s=0;s<t;s++)if(s%4){var a=n[r.charCodeAt(s-1)]<<s%4*2,c=n[r.charCodeAt(s)]>>>6-s%4*2,f=a|c;i[o>>>2]|=f<<24-o%4*8;o++}return e.create(i,o)}(r,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var r=CryptoJS,e=r.lib,t=e.Base,n=e.WordArray,i=r.algo,o=i.MD5,s=i.EvpKDF=t.extend({cfg:t.extend({keySize:4,hasher:o,iterations:1}),init:function(r){this.cfg=this.cfg.extend(r)},compute:function(r,e){for(var t,i=this.cfg,o=i.hasher.create(),s=n.create(),a=s.words,c=i.keySize,f=i.iterations;a.length<c;){t&&o.update(t);t=o.update(r).finalize(e);o.reset();for(var u=1;u<f;u++){t=o.finalize(t);o.reset()}s.concat(t)}s.sigBytes=4*c;return s}});r.EvpKDF=function(r,e,t){return s.create(t).compute(r,e)}}();!function(){var r=CryptoJS,e=r.lib.BlockCipher,t=r.algo,n=[],i=[],o=[],s=[],a=[],c=[],f=[],u=[],h=[],p=[];!function(){for(var r=[],e=0;e<256;e++)r[e]=e<128?e<<1:e<<1^283;var t=0,d=0;for(e=0;e<256;e++){var y=d^d<<1^d<<2^d<<3^d<<4;y=y>>>8^255&y^99;n[t]=y;i[y]=t;var l=r[t],g=r[l],v=r[g],_=257*r[y]^16843008*y;o[t]=_<<24|_>>>8;s[t]=_<<16|_>>>16;a[t]=_<<8|_>>>24;c[t]=_;_=16843009*v^65537*g^257*l^16843008*t;f[y]=_<<24|_>>>8;u[y]=_<<16|_>>>16;h[y]=_<<8|_>>>24;p[y]=_;if(t){t=l^r[r[r[v^l]]];d^=r[r[d]]}else t=d=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],y=t.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var r=this._keyPriorReset=this._key,e=r.words,t=r.sigBytes/4,i=4*((this._nRounds=t+6)+1),o=this._keySchedule=[],s=0;s<i;s++)if(s<t)o[s]=e[s];else{y=o[s-1];if(s%t)t>6&&s%t==4&&(y=n[y>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y]);else{y=n[(y=y<<8|y>>>24)>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y];y^=d[s/t|0]<<24}o[s]=o[s-t]^y}for(var a=this._invKeySchedule=[],c=0;c<i;c++){s=i-c;if(c%4)var y=o[s];else y=o[s-4];a[c]=c<4||s<=4?y:f[n[y>>>24]]^u[n[y>>>16&255]]^h[n[y>>>8&255]]^p[n[255&y]]}}},encryptBlock:function(r,e){this._doCryptBlock(r,e,this._keySchedule,o,s,a,c,n)},decryptBlock:function(r,e){var t=r[e+1];r[e+1]=r[e+3];r[e+3]=t;this._doCryptBlock(r,e,this._invKeySchedule,f,u,h,p,i);t=r[e+1];r[e+1]=r[e+3];r[e+3]=t},_doCryptBlock:function(r,e,t,n,i,o,s,a){for(var c=this._nRounds,f=r[e]^t[0],u=r[e+1]^t[1],h=r[e+2]^t[2],p=r[e+3]^t[3],d=4,y=1;y<c;y++){var l=n[f>>>24]^i[u>>>16&255]^o[h>>>8&255]^s[255&p]^t[d++],g=n[u>>>24]^i[h>>>16&255]^o[p>>>8&255]^s[255&f]^t[d++],v=n[h>>>24]^i[p>>>16&255]^o[f>>>8&255]^s[255&u]^t[d++],_=n[p>>>24]^i[f>>>16&255]^o[u>>>8&255]^s[255&h]^t[d++];f=l;u=g;h=v;p=_}l=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[h>>>8&255]<<8|a[255&p])^t[d++],g=(a[u>>>24]<<24|a[h>>>16&255]<<16|a[p>>>8&255]<<8|a[255&f])^t[d++],v=(a[h>>>24]<<24|a[p>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^t[d++],_=(a[p>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&h])^t[d++];r[e]=l;r[e+1]=g;r[e+2]=v;r[e+3]=_},keySize:8});r.AES=e._createHelper(y)}();!function(){var r=CryptoJS,e=r.lib.StreamCipher,t=r.algo,n=t.RC4=e.extend({_doReset:function(){for(var r=this._key,e=r.words,t=r.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%t,a=e[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var c=n[i];n[i]=n[o];n[o]=c}this._i=this._j=0},_doProcessBlock:function(r,e){r[e]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var r=this._S,e=this._i,t=this._j,n=0,i=0;i<4;i++){t=(t+r[e=(e+1)%256])%256;var o=r[e];r[e]=r[t];r[t]=o;n|=r[(r[e]+r[t])%256]<<24-8*i}this._i=e;this._j=t;return n}r.RC4=e._createHelper(n);var i=t.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var r=this.cfg.drop;r>0;r--)generateKeystreamWord.call(this)}});r.RC4Drop=e._createHelper(i)}();CryptoJS.mode.ECB=function(){var r=CryptoJS.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(r,e){this._cipher.encryptBlock(r,e)}});r.Decryptor=r.extend({processBlock:function(r,e){this._cipher.decryptBlock(r,e)}});return r}();var _PDFSecurity=function(){function _PDFSecurity(r,e){void 0===e&&(e={});if(!e.ownerPassword&&!e.userPassword)throw new Error("None of owner password and user password is defined.");this.document=r;this._setupEncryption(e)}_PDFSecurity.generateFileID=function(r){void 0===r&&(r={});var e=r.CreationDate.getTime()+"\n";for(var t in r)r.hasOwnProperty(t)&&(e+=t+": "+r[t]+"\n");return wordArrayToBuffer(CryptoJS.MD5(e))};_PDFSecurity.generateRandomWordArray=function(r){return CryptoJS.lib.WordArray.random(r)};_PDFSecurity.create=function(r,e){void 0===e&&(e={});return e.ownerPassword||e.userPassword?new _PDFSecurity(r,e):null};_PDFSecurity.prototype._setupEncryption=function(r){switch(r.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}var e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,r);break;case 5:this._setupEncryptionV5(e,r)}this.dictionary=this.document.ref(e)};_PDFSecurity.prototype._setupEncryptionV1V2V4=function(r,e,t){var n,i;switch(r){case 1:n=2;this.keyBits=40;i=getPermissionsR2(t.permissions);break;case 2:n=3;this.keyBits=128;i=getPermissionsR3(t.permissions);break;case 4:n=4;this.keyBits=128;i=getPermissionsR3(t.permissions)}var o,s=processPasswordR2R3R4(t.userPassword),a=t.ownerPassword?processPasswordR2R3R4(t.ownerPassword):s,c=getOwnerPasswordR2R3R4(n,this.keyBits,s,a);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,s,c,i);o=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);e.V=r;r>=2&&(e.Length=this.keyBits);if(4===r){e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF"}e.R=n;e.O=wordArrayToBuffer(c);e.U=wordArrayToBuffer(o);e.P=i};_PDFSecurity.prototype._setupEncryptionV5=function(r,e){this.keyBits=256;var t=getPermissionsR3(e.permissions),n=processPasswordR5(e.userPassword),i=e.ownerPassword?processPasswordR5(e.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);var o=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,CryptoJS.lib.WordArray.create(o.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(i,o,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(i,CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),o,this.encryptionKey),f=getEncryptedPermissionsR5(t,this.encryptionKey,_PDFSecurity.generateRandomWordArray);r.V=5;r.Length=this.keyBits;r.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};r.StmF="StdCF";r.StrF="StdCF";r.R=5;r.O=wordArrayToBuffer(a);r.OE=wordArrayToBuffer(c);r.U=wordArrayToBuffer(o);r.UE=wordArrayToBuffer(s);r.P=t;r.Perms=wordArrayToBuffer(f)};_PDFSecurity.prototype.getEncryptFn=function(r,e){var t,n;this.version<5&&(t=this.encryptionKey.clone().concat(CryptoJS.lib.WordArray.create([(255&r)<<24|(65280&r)<<8|r>>8&65280|255&e,(65280&e)<<16],5)));if(1===this.version||2===this.version){var i=CryptoJS.MD5(t);i.sigBytes=Math.min(16,this.keyBits/8+5);return function(r){return wordArrayToBuffer(CryptoJS.RC4.encrypt(CryptoJS.lib.WordArray.create(r),i).ciphertext)}}n=4===this.version?CryptoJS.MD5(t.concat(CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;var o=_PDFSecurity.generateRandomWordArray(16),s={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:o};return function(r){return wordArrayToBuffer(o.clone().concat(CryptoJS.AES.encrypt(CryptoJS.lib.WordArray.create(r),n,s).ciphertext))}};_PDFSecurity.prototype.end=function(){this.dictionary.end()};return _PDFSecurity}();export{_PDFSecurity};function getPermissionsR2(r){void 0===r&&(r={});var e=-64;r.printing&&(e|=4);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);return e}function getPermissionsR3(r){void 0===r&&(r={});var e=-3904;"lowResolution"===r.printing&&(e|=4);"highResolution"===r.printing&&(e|=2052);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);r.fillingForms&&(e|=256);r.contentAccessibility&&(e|=512);r.documentAssembly&&(e|=1024);return e}function getUserPasswordR2(r){return CryptoJS.RC4.encrypt(processPasswordR2R3R4(),r).ciphertext}function getUserPasswordR3R4(r,e){for(var t=e.clone(),n=CryptoJS.MD5(processPasswordR2R3R4().concat(CryptoJS.lib.WordArray.create(r))),i=0;i<20;i++){for(var o=Math.ceil(t.sigBytes/4),s=0;s<o;s++)t.words[s]=e.words[s]^(i|i<<8|i<<16|i<<24);n=CryptoJS.RC4.encrypt(n,t).ciphertext}return n.concat(CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(r,e,t,n){for(var i=n,o=r>=3?51:1,s=0;s<o;s++)i=CryptoJS.MD5(i);var a=i.clone();a.sigBytes=e/8;var c=t;o=r>=3?20:1;for(s=0;s<o;s++){for(var f=Math.ceil(a.sigBytes/4),u=0;u<f;u++)a.words[u]=i.words[u]^(s|s<<8|s<<16|s<<24);c=CryptoJS.RC4.encrypt(c,a).ciphertext}return c}function getEncryptionKeyR2R3R4(r,e,t,n,i,o){for(var s=n.clone().concat(i).concat(CryptoJS.lib.WordArray.create([lsbFirstWord(o)],4)).concat(CryptoJS.lib.WordArray.create(t)),a=r>=3?51:1,c=0;c<a;c++)(s=CryptoJS.MD5(s)).sigBytes=e/8;return s}function getUserPasswordR5(r,e){var t=e(8),n=e(8);return CryptoJS.SHA256(r.clone().concat(t)).concat(t).concat(n)}function getUserEncryptionKeyR5(r,e,t){var n=CryptoJS.SHA256(r.clone().concat(e)),i={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(t,n,i).ciphertext}function getOwnerPasswordR5(r,e,t){var n=t(8),i=t(8);return CryptoJS.SHA256(r.clone().concat(n).concat(e)).concat(n).concat(i)}function getOwnerEncryptionKeyR5(r,e,t,n){var i=CryptoJS.SHA256(r.clone().concat(e).concat(t)),o={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(n,i,o).ciphertext}function getEncryptionKeyR5(r){return r(32)}function getEncryptedPermissionsR5(r,e,t){var n=CryptoJS.lib.WordArray.create([lsbFirstWord(r),4294967295,1415668834],12).concat(t(4)),i={mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.NoPadding};return CryptoJS.AES.encrypt(n,e,i).ciphertext}function processPasswordR2R3R4(r){void 0===r&&(r="");for(var e=new Buffer(32),t=r.length,n=0;n<t&&n<32;){var i=r.charCodeAt(n);if(i>255)throw new Error("Password contains one or more invalid characters.");e[n]=i;n++}for(;n<32;){e[n]=PASSWORD_PADDING[n-t];n++}return CryptoJS.lib.WordArray.create(e)}function processPasswordR5(r){void 0===r&&(r="");r=unescape(encodeURIComponent(saslprep(r)));for(var e=Math.min(127,r.length),t=new Buffer(e),n=0;n<e;n++)t[n]=r.charCodeAt(n);return CryptoJS.lib.WordArray.create(t)}function lsbFirstWord(r){return(255&r)<<24|(65280&r)<<8|r>>8&65280|r>>24&255}function wordArrayToBuffer(r){for(var e=[],t=0;t<r.sigBytes;t++)e.push(r.words[Math.floor(t/4)]>>8*(3-t%4)&255);return Buffer.from(e)}var PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];_registerModule("wijmo.pdf.security",selfModule);
14
+ import{_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.pdf.security";var K_MAX_LENGTH=2147483647;function createBuffer(r){if(r>K_MAX_LENGTH)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);Object.setPrototypeOf(e,Buffer.prototype);return e}export function Buffer(r,e,t){if("number"==typeof r){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(r)}return from(r,e,t)}function from(r,e,t){if(ArrayBuffer.isView(r))return fromArrayLike(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(isInstance(r,ArrayBuffer)||r&&isInstance(r.buffer,ArrayBuffer))return fromArrayBuffer(r,e,t);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(r,SharedArrayBuffer)||r&&isInstance(r.buffer,SharedArrayBuffer)))return fromArrayBuffer(r,e,t);if("number"==typeof r)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(null!=n&&n!==r)return Buffer.from(n,e,t);var i=fromObject(r);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof r[Symbol.toPrimitive])return Buffer.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}Buffer.from=function(r,e,t){return from(r,e,t)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(r){if("number"!=typeof r)throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function allocUnsafe(r){assertSize(r);return createBuffer(r<0?0:0|checked(r))}function fromArrayLike(r){for(var e=r.length<0?0:0|checked(r.length),t=createBuffer(e),n=0;n<e;n+=1)t[n]=255&r[n];return t}function fromArrayBuffer(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===t?new Uint8Array(r):void 0===t?new Uint8Array(r,e):new Uint8Array(r,e,t);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(r){if(Buffer.isBuffer(r)){var e=0|checked(r.length),t=createBuffer(e);if(0===t.length)return t;r.copy(t,0,0,e);return t}return void 0!==r.length?"number"!=typeof r.length||numberIsNaN(r.length)?createBuffer(0):fromArrayLike(r):"Buffer"===r.type&&Array.isArray(r.data)?fromArrayLike(r.data):void 0}function checked(r){if(r>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|r}Buffer.isBuffer=function isBuffer(r){return null!=r&&!0===r._isBuffer&&r!==Buffer.prototype};function slowToString(r,e,t){var n=!1;(void 0===e||e<0)&&(e=0);if(e>this.length)return"";(void 0===t||t>this.length)&&(t=this.length);if(t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";r||(r="utf8");for(;;)switch(r){case"hex":return hexSlice(this,e,t);case"utf8":case"utf-8":return utf8Slice(this,e,t);case"ascii":return asciiSlice(this,e,t);case"latin1":case"binary":return latin1Slice(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var r=this.length;return 0===r?"":0===arguments.length?utf8Slice(this,0,r):slowToString.apply(this,arguments)};function utf8Slice(r,e,t){t=Math.min(r.length,t);for(var n,i,o,s,a=[],c=e;c<t;){var f=r[c],u=null,h=f>239?4:f>223?3:f>191?2:1;if(c+h<=t)switch(h){case 1:f<128&&(u=f);break;case 2:128==(192&(n=r[c+1]))&&(s=(31&f)<<6|63&n)>127&&(u=s);break;case 3:n=r[c+1];i=r[c+2];128==(192&n)&&128==(192&i)&&(s=(15&f)<<12|(63&n)<<6|63&i)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:n=r[c+1];i=r[c+2];o=r[c+3];128==(192&n)&&128==(192&i)&&128==(192&o)&&(s=(15&f)<<18|(63&n)<<12|(63&i)<<6|63&o)>65535&&s<1114112&&(u=s)}if(null===u){u=65533;h=1}else if(u>65535){u-=65536;a.push(u>>>10&1023|55296);u=56320|1023&u}a.push(u);c+=h}return decodeCodePointsArray(a)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(r){var e=r.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;){var i=Math.min(n+MAX_ARGUMENTS_LENGTH,e);t+=String.fromCharCode.apply(String,r.slice(n,i));n=i}return t}function asciiSlice(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(127&r[i]);return n}function latin1Slice(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function hexSlice(r,e,t){var n=r.length;(!e||e<0)&&(e=0);(!t||t<0||t>n)&&(t=n);for(var i="",o=e;o<t;++o)i+=hexSliceLookupTable[r[o]];return i}function utf16leSlice(r,e,t){for(var n=r.slice(e,t),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}Buffer.prototype.slice=function slice(r,e){var t,n=this.length;(r=~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n);(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);e<r&&(e=r);return t=this.subarray(r,e)(Object).setPrototypeOf(t,Buffer.prototype)};Buffer.prototype.copy=function copy(r,e,t,n){if(!Buffer.isBuffer(r))throw new TypeError("argument should be a Buffer");t||(t=0);n||0===n||(n=this.length);e>=r.length&&(e=r.length);e||(e=0);n>0&&n<t&&(n=t);if(n===t)return 0;if(0===r.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);r.length-e<n-t&&(n=r.length-e+t);var i=n-t;if(this===r&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,t,n);else if(this===r&&t<e&&e<n)for(var o=i-1;o>=0;--o)r[o+e]=this[o+t];else Uint8Array.prototype.set.call(r,this.subarray(t,n),e);return i};function isInstance(r,e){return r instanceof e||null!=r&&null!=r.constructor&&null!=r.constructor.name&&r.constructor.name===e.name}function numberIsNaN(r){return r!=r}var hexSliceLookupTable=function(){for(var r=new Array(256),e=0;e<16;++e)for(var t=16*e,n=0;n<16;++n)r[t+n]="0123456789abcdef"[e]+"0123456789abcdef"[n];return r}();export function inRange(r,e){if(r<e[0])return!1;for(var t=0,n=e.length/2;t<=n;){var i=Math.floor((t+n)/2),o=2*i;if(r>=e[o]&&r<=e[o+1])return!0;r>e[o+1]?t=i+1:n=i-1}return!1}var unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];export var isUnassignedCodePoint=function(r){return inRange(r,unassigned_code_points)};var commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];export var isCommonlyMappedToNothing=function(r){return inRange(r,commonly_mapped_to_nothing)};var non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];export var isNonASCIISpaceCharacter=function(r){return inRange(r,non_ASCII_space_characters)};var non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];export var isProhibitedCharacter=function(r){return inRange(r,non_ASCII_space_characters)||inRange(r,prohibited_characters)||inRange(r,non_ASCII_controls_characters)||inRange(r,non_character_codepoints)};var bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];export var isBidirectionalRAL=function(r){return inRange(r,bidirectional_r_al)};var bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];export var isBidirectionalL=function(r){return inRange(r,bidirectional_l)};var mapping2space=isNonASCIISpaceCharacter,mapping2nothing=isCommonlyMappedToNothing,getCodePoint=function(r){return r.codePointAt(0)},first=function(r){return r[0]},last=function(r){return r[r.length-1]};function toCodePoints(r){for(var e=[],t=r.length,n=0;n<t;n+=1){var i=r.charCodeAt(n);if(i>=55296&&i<=56319&&t>n+1){var o=r.charCodeAt(n+1);if(o>=56320&&o<=57343){e.push(1024*(i-55296)+o-56320+65536);n+=1;continue}}e.push(i)}return e}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);for(var r=[],e=0,t="",n=0,i=arguments.length;n!==i;++n){var o=+arguments[n];if(!(o<1114111&&o>>>0===o))throw RangeError("Invalid code point: "+o);if(o<=65535)e=r.push(o);else{o-=65536;e=r.push(55296+(o>>10),o%1024+56320)}if(e>=16383){t+=String.fromCharCode.apply(null,r);r.length=0}}return t+String.fromCharCode.apply(null,r)}export function saslprep(r,e){void 0===e&&(e={});if("string"!=typeof r)throw new TypeError("Expected string.");if(0===r.length)return"";var t=toCodePoints(r).map((function(r){return mapping2space(r)?32:r})).filter((function(r){return!mapping2nothing(r)})),n=fromCodePoint.apply(null,t).normalize("NFKC"),i=toCodePoints(n);if(i.some(isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned){if(i.some(isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}var o=i.some(isBidirectionalRAL),s=i.some(isBidirectionalL);if(o&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");var a=isBidirectionalRAL(getCodePoint(first(n))),c=isBidirectionalRAL(getCodePoint(last(n)));if(o&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}export var CryptoJS=function(r,e){var t;"undefined"!=typeof window&&window.crypto&&(t=window.crypto);!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto);var cryptoSecureRandomInt=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(r){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(r){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(r){var e;F.prototype=r;e=new F;F.prototype=null;return e}}(),i={},o=i.lib={},s=o.Base={extend:function(r){var e=n(this);r&&e.mixIn(r);e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)});e.init.prototype=e;e.$super=this;return e},create:function(){var r=this.extend();r.init.apply(r,arguments);return r},init:function(){},mixIn:function(r){for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=s.extend({init:function(r,e){r=this.words=r||[];this.sigBytes=null!=e?e:4*r.length},toString:function(r){return(r||f).stringify(this)},concat:function(r){var e=this.words,t=r.words,n=this.sigBytes,i=r.sigBytes;this.clamp();if(n%4)for(var o=0;o<i;o++){var s=t[o>>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s<<24-(n+o)%4*8}else for(o=0;o<i;o+=4)e[n+o>>>2]=t[o>>>2];this.sigBytes+=i;return this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8;e.length=r.ceil(t/4)},clone:function(){var r=s.clone.call(this);r.words=this.words.slice(0);return r},random:function(r){for(var e=[],t=0;t<r;t+=4)e.push(cryptoSecureRandomInt());return new a.init(e,r)}}),c=i.enc={},f=c.Hex={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],i=0;i<t;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16));n.push((15&o).toString(16))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n+=2)t[n>>>3]|=parseInt(r.substr(n,2),16)<<24-n%8*4;return new a.init(t,e/2)}},u=c.Latin1={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],i=0;i<t;i++){var o=e[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n++)t[n>>>2]|=(255&r.charCodeAt(n))<<24-n%4*8;return new a.init(t,e)}},h=c.Utf8={stringify:function(r){try{return decodeURIComponent(escape(u.stringify(r)))}catch(r){throw new Error("Malformed UTF-8 data")}},parse:function(r){return u.parse(unescape(encodeURIComponent(r)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(r){"string"==typeof r&&(r=h.parse(r));this._data.concat(r);this._nDataBytes+=r.sigBytes},_process:function(e){var t,n=this._data,i=n.words,o=n.sigBytes,s=this.blockSize,c=o/(4*s),f=(c=e?r.ceil(c):r.max((0|c)-this._minBufferSize,0))*s,u=r.min(4*f,o);if(f){for(var h=0;h<f;h+=s)this._doProcessBlock(i,h);t=i.splice(0,f);n.sigBytes-=u}return new a.init(t,u)},clone:function(){var r=s.clone.call(this);r._data=this._data.clone();return r},_minBufferSize:0}),d=(o.Hasher=p.extend({cfg:s.extend(),init:function(r){this.cfg=this.cfg.extend(r);this.reset()},reset:function(){p.reset.call(this);this._doReset()},update:function(r){this._append(r);this._process();return this},finalize:function(r){r&&this._append(r);return this._doFinalize()},blockSize:16,_createHelper:function(r){return function(e,t){return new r.init(t).finalize(e)}},_createHmacHelper:function(r){return function(e,t){return new d.HMAC.init(r,t).finalize(e)}}}),i.algo={});return i}(Math);!function(r){var e=CryptoJS,t=e.lib,n=t.WordArray,i=t.Hasher,o=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*r.abs(r.sin(e+1))|0}();var a=o.MD5=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var n=e+t,i=r[n];r[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=r[e+0],c=r[e+1],f=r[e+2],u=r[e+3],h=r[e+4],p=r[e+5],d=r[e+6],y=r[e+7],l=r[e+8],g=r[e+9],v=r[e+10],_=r[e+11],m=r[e+12],S=r[e+13],w=r[e+14],C=r[e+15],B=o[0],A=o[1],R=o[2],b=o[3];B=FF(B,A,R,b,a,7,s[0]);b=FF(b,B,A,R,c,12,s[1]);R=FF(R,b,B,A,f,17,s[2]);A=FF(A,R,b,B,u,22,s[3]);B=FF(B,A,R,b,h,7,s[4]);b=FF(b,B,A,R,p,12,s[5]);R=FF(R,b,B,A,d,17,s[6]);A=FF(A,R,b,B,y,22,s[7]);B=FF(B,A,R,b,l,7,s[8]);b=FF(b,B,A,R,g,12,s[9]);R=FF(R,b,B,A,v,17,s[10]);A=FF(A,R,b,B,_,22,s[11]);B=FF(B,A,R,b,m,7,s[12]);b=FF(b,B,A,R,S,12,s[13]);R=FF(R,b,B,A,w,17,s[14]);B=GG(B,A=FF(A,R,b,B,C,22,s[15]),R,b,c,5,s[16]);b=GG(b,B,A,R,d,9,s[17]);R=GG(R,b,B,A,_,14,s[18]);A=GG(A,R,b,B,a,20,s[19]);B=GG(B,A,R,b,p,5,s[20]);b=GG(b,B,A,R,v,9,s[21]);R=GG(R,b,B,A,C,14,s[22]);A=GG(A,R,b,B,h,20,s[23]);B=GG(B,A,R,b,g,5,s[24]);b=GG(b,B,A,R,w,9,s[25]);R=GG(R,b,B,A,u,14,s[26]);A=GG(A,R,b,B,l,20,s[27]);B=GG(B,A,R,b,S,5,s[28]);b=GG(b,B,A,R,f,9,s[29]);R=GG(R,b,B,A,y,14,s[30]);B=HH(B,A=GG(A,R,b,B,m,20,s[31]),R,b,p,4,s[32]);b=HH(b,B,A,R,l,11,s[33]);R=HH(R,b,B,A,_,16,s[34]);A=HH(A,R,b,B,w,23,s[35]);B=HH(B,A,R,b,c,4,s[36]);b=HH(b,B,A,R,h,11,s[37]);R=HH(R,b,B,A,y,16,s[38]);A=HH(A,R,b,B,v,23,s[39]);B=HH(B,A,R,b,S,4,s[40]);b=HH(b,B,A,R,a,11,s[41]);R=HH(R,b,B,A,u,16,s[42]);A=HH(A,R,b,B,d,23,s[43]);B=HH(B,A,R,b,g,4,s[44]);b=HH(b,B,A,R,m,11,s[45]);R=HH(R,b,B,A,C,16,s[46]);B=II(B,A=HH(A,R,b,B,f,23,s[47]),R,b,a,6,s[48]);b=II(b,B,A,R,y,10,s[49]);R=II(R,b,B,A,w,15,s[50]);A=II(A,R,b,B,p,21,s[51]);B=II(B,A,R,b,m,6,s[52]);b=II(b,B,A,R,u,10,s[53]);R=II(R,b,B,A,v,15,s[54]);A=II(A,R,b,B,c,21,s[55]);B=II(B,A,R,b,l,6,s[56]);b=II(b,B,A,R,C,10,s[57]);R=II(R,b,B,A,d,15,s[58]);A=II(A,R,b,B,S,21,s[59]);B=II(B,A,R,b,h,6,s[60]);b=II(b,B,A,R,_,10,s[61]);R=II(R,b,B,A,f,15,s[62]);A=II(A,R,b,B,g,21,s[63]);o[0]=o[0]+B|0;o[1]=o[1]+A|0;o[2]=o[2]+R|0;o[3]=o[3]+b|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var o=r.floor(n/4294967296),s=n;t[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);t[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);e.sigBytes=4*(t.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var r=i.clone.call(this);r._hash=this._hash.clone();return r}});function FF(r,e,t,n,i,o,s){var a=r+(e&t|~e&n)+i+s;return(a<<o|a>>>32-o)+e}function GG(r,e,t,n,i,o,s){var a=r+(e&n|t&~n)+i+s;return(a<<o|a>>>32-o)+e}function HH(r,e,t,n,i,o,s){var a=r+(e^t^n)+i+s;return(a<<o|a>>>32-o)+e}function II(r,e,t,n,i,o,s){var a=r+(t^(e|~n))+i+s;return(a<<o|a>>>32-o)+e}e.MD5=i._createHelper(a);e.HmacMD5=i._createHmacHelper(a)}(Math);!function(r){var e=CryptoJS,t=e.lib,n=t.WordArray,i=t.Hasher,o=e.algo,s=[],a=[];!function(){function isPrime(e){for(var t=r.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function getFractionalBits(r){return 4294967296*(r-(0|r))|0}for(var e=2,t=0;t<64;){if(isPrime(e)){t<8&&(s[t]=getFractionalBits(r.pow(e,.5)));a[t]=getFractionalBits(r.pow(e,1/3));t++}e++}}();var c=[],f=o.SHA256=i.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(r,e){for(var t=this._hash.words,n=t[0],i=t[1],o=t[2],s=t[3],f=t[4],u=t[5],h=t[6],p=t[7],d=0;d<64;d++){if(d<16)c[d]=0|r[e+d];else{var y=c[d-15],l=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,g=c[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[d]=l+c[d-7]+v+c[d-16]}var _=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),S=p+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&h)+a[d]+c[d];p=h;h=u;u=f;f=s+S|0;s=o;o=i;i=n;n=S+(m+_)|0}t[0]=t[0]+n|0;t[1]=t[1]+i|0;t[2]=t[2]+o|0;t[3]=t[3]+s|0;t[4]=t[4]+f|0;t[5]=t[5]+u|0;t[6]=t[6]+h|0;t[7]=t[7]+p|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;t[14+(i+64>>>9<<4)]=r.floor(n/4294967296);t[15+(i+64>>>9<<4)]=n;e.sigBytes=4*t.length;this._process();return this._hash},clone:function(){var r=i.clone.call(this);r._hash=this._hash.clone();return r}});e.SHA256=i._createHelper(f);e.HmacSHA256=i._createHmacHelper(f)}(Math);!function(){var r=CryptoJS,e=r.lib.Base,t=r.enc.Utf8;r.algo.HMAC=e.extend({init:function(r,e){r=this._hasher=new r.init;"string"==typeof e&&(e=t.parse(e));var n=r.blockSize,i=4*n;e.sigBytes>i&&(e=r.finalize(e));e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),a=o.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}o.sigBytes=s.sigBytes=i;this.reset()},reset:function(){var r=this._hasher;r.reset();r.update(this._iKey)},update:function(r){this._hasher.update(r);return this},finalize:function(r){var e=this._hasher,t=e.finalize(r);e.reset();return e.finalize(this._oKey.clone().concat(t))}})}();CryptoJS.lib.Cipher||function(r){var e=CryptoJS,t=e.lib,n=t.Base,i=t.WordArray,o=t.BufferedBlockAlgorithm,s=e.enc,a=(s.Utf8,s.Base64),c=e.algo.EvpKDF,f=t.Cipher=o.extend({cfg:n.extend(),createEncryptor:function(r,e){return this.create(this._ENC_XFORM_MODE,r,e)},createDecryptor:function(r,e){return this.create(this._DEC_XFORM_MODE,r,e)},init:function(r,e,t){this.cfg=this.cfg.extend(t);this._xformMode=r;this._key=e;this.reset()},reset:function(){o.reset.call(this);this._doReset()},process:function(r){this._append(r);return this._process()},finalize:function(r){r&&this._append(r);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(r){return"string"==typeof r?_:g}return function(r){return{encrypt:function(e,t,n){return selectCipherStrategy(t).encrypt(r,e,t,n)},decrypt:function(e,t,n){return selectCipherStrategy(t).decrypt(r,e,t,n)}}}}()}),u=(t.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),h=t.BlockCipherMode=n.extend({createEncryptor:function(r,e){return this.Encryptor.create(r,e)},createDecryptor:function(r,e){return this.Decryptor.create(r,e)},init:function(r,e){this._cipher=r;this._iv=e}}),p=u.CBC=function(){var r=h.extend();r.Encryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize;xorBlock.call(this,r,e,n);t.encryptBlock(r,e);this._prevBlock=r.slice(e,e+n)}});r.Decryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize,i=r.slice(e,e+n);t.decryptBlock(r,e);xorBlock.call(this,r,e,n);this._prevBlock=i}});function xorBlock(r,e,t){var n,i=this._iv;if(i){n=i;this._iv=void 0}else n=this._prevBlock;for(var o=0;o<t;o++)r[e+o]^=n[o]}return r}(),d=(e.pad={}).Pkcs7={pad:function(r,e){for(var t=4*e,n=t-r.sigBytes%t,o=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(o);var c=i.create(s,n);r.concat(c)},unpad:function(r){var e=255&r.words[r.sigBytes-1>>>2];r.sigBytes-=e}},y=(t.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:d}),reset:function(){var r;f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)r=n.createEncryptor;else{r=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==r)this._mode.init(this,t&&t.words);else{this._mode=r.call(n,this,t&&t.words);this._mode.__creator=r}},_doProcessBlock:function(r,e){this._mode.processBlock(r,e)},_doFinalize:function(){var r,e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);r=this._process(!0)}else{r=this._process(!0);e.unpad(r)}return r},blockSize:4}),t.CipherParams=n.extend({init:function(r){this.mixIn(r)},toString:function(r){return(r||this.formatter).stringify(this)}})),l=(e.format={}).OpenSSL={stringify:function(r){var e=r.ciphertext,t=r.salt;return(t?i.create([1398893684,1701076831]).concat(t).concat(e):e).toString(a)},parse:function(r){var e,t=a.parse(r),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){e=i.create(n.slice(2,4));n.splice(0,4);t.sigBytes-=16}return y.create({ciphertext:t,salt:e})}},g=t.SerializableCipher=n.extend({cfg:n.extend({format:l}),encrypt:function(r,e,t,n){n=this.cfg.extend(n);var i=r.createEncryptor(t,n),o=i.finalize(e),s=i.cfg;return y.create({ciphertext:o,key:t,iv:s.iv,algorithm:r,mode:s.mode,padding:s.padding,blockSize:r.blockSize,formatter:n.format})},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);return r.createDecryptor(t,n).finalize(e.ciphertext)},_parse:function(r,e){return"string"==typeof r?e.parse(r,this):r}}),v=(e.kdf={}).OpenSSL={execute:function(r,e,t,n){n||(n=i.random(8));var o=c.create({keySize:e+t}).compute(r,n),s=i.create(o.words.slice(e),4*t);o.sigBytes=4*e;return y.create({key:o,iv:s,salt:n})}},_=t.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(r,e,t,n){var i=(n=this.cfg.extend(n)).kdf.execute(t,r.keySize,r.ivSize);n.iv=i.iv;var o=g.encrypt.call(this,r,e,i.key,n);o.mixIn(i);return o},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);var i=n.kdf.execute(t,r.keySize,r.ivSize,e.salt);n.iv=i.iv;return g.decrypt.call(this,r,e,i.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var r=CryptoJS.lib.WordArray,e=r.init;(r.init=function(r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));(r instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));if(r instanceof Uint8Array){for(var t=r.byteLength,n=[],i=0;i<t;i++)n[i>>>2]|=r[i]<<24-i%4*8;e.call(this,n,t)}else e.apply(this,arguments)}).prototype=r}}();CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var r=CryptoJS,e=r.lib.WordArray;r.enc.Base64={stringify:function(r){var e=r.words,t=r.sigBytes,n=this._map;r.clamp();for(var i=[],o=0;o<t;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<t;a++)i.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(r){var t=r.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=r.indexOf(s);-1!==a&&(t=a)}return function parseLoop(r,t,n){for(var i=[],o=0,s=0;s<t;s++)if(s%4){var a=n[r.charCodeAt(s-1)]<<s%4*2,c=n[r.charCodeAt(s)]>>>6-s%4*2,f=a|c;i[o>>>2]|=f<<24-o%4*8;o++}return e.create(i,o)}(r,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var r=CryptoJS,e=r.lib,t=e.Base,n=e.WordArray,i=r.algo,o=i.MD5,s=i.EvpKDF=t.extend({cfg:t.extend({keySize:4,hasher:o,iterations:1}),init:function(r){this.cfg=this.cfg.extend(r)},compute:function(r,e){for(var t,i=this.cfg,o=i.hasher.create(),s=n.create(),a=s.words,c=i.keySize,f=i.iterations;a.length<c;){t&&o.update(t);t=o.update(r).finalize(e);o.reset();for(var u=1;u<f;u++){t=o.finalize(t);o.reset()}s.concat(t)}s.sigBytes=4*c;return s}});r.EvpKDF=function(r,e,t){return s.create(t).compute(r,e)}}();!function(){var r=CryptoJS,e=r.lib.BlockCipher,t=r.algo,n=[],i=[],o=[],s=[],a=[],c=[],f=[],u=[],h=[],p=[];!function(){for(var r=[],e=0;e<256;e++)r[e]=e<128?e<<1:e<<1^283;var t=0,d=0;for(e=0;e<256;e++){var y=d^d<<1^d<<2^d<<3^d<<4;y=y>>>8^255&y^99;n[t]=y;i[y]=t;var l=r[t],g=r[l],v=r[g],_=257*r[y]^16843008*y;o[t]=_<<24|_>>>8;s[t]=_<<16|_>>>16;a[t]=_<<8|_>>>24;c[t]=_;_=16843009*v^65537*g^257*l^16843008*t;f[y]=_<<24|_>>>8;u[y]=_<<16|_>>>16;h[y]=_<<8|_>>>24;p[y]=_;if(t){t=l^r[r[r[v^l]]];d^=r[r[d]]}else t=d=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],y=t.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var r=this._keyPriorReset=this._key,e=r.words,t=r.sigBytes/4,i=4*((this._nRounds=t+6)+1),o=this._keySchedule=[],s=0;s<i;s++)if(s<t)o[s]=e[s];else{y=o[s-1];if(s%t)t>6&&s%t==4&&(y=n[y>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y]);else{y=n[(y=y<<8|y>>>24)>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y];y^=d[s/t|0]<<24}o[s]=o[s-t]^y}for(var a=this._invKeySchedule=[],c=0;c<i;c++){s=i-c;if(c%4)var y=o[s];else y=o[s-4];a[c]=c<4||s<=4?y:f[n[y>>>24]]^u[n[y>>>16&255]]^h[n[y>>>8&255]]^p[n[255&y]]}}},encryptBlock:function(r,e){this._doCryptBlock(r,e,this._keySchedule,o,s,a,c,n)},decryptBlock:function(r,e){var t=r[e+1];r[e+1]=r[e+3];r[e+3]=t;this._doCryptBlock(r,e,this._invKeySchedule,f,u,h,p,i);t=r[e+1];r[e+1]=r[e+3];r[e+3]=t},_doCryptBlock:function(r,e,t,n,i,o,s,a){for(var c=this._nRounds,f=r[e]^t[0],u=r[e+1]^t[1],h=r[e+2]^t[2],p=r[e+3]^t[3],d=4,y=1;y<c;y++){var l=n[f>>>24]^i[u>>>16&255]^o[h>>>8&255]^s[255&p]^t[d++],g=n[u>>>24]^i[h>>>16&255]^o[p>>>8&255]^s[255&f]^t[d++],v=n[h>>>24]^i[p>>>16&255]^o[f>>>8&255]^s[255&u]^t[d++],_=n[p>>>24]^i[f>>>16&255]^o[u>>>8&255]^s[255&h]^t[d++];f=l;u=g;h=v;p=_}l=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[h>>>8&255]<<8|a[255&p])^t[d++],g=(a[u>>>24]<<24|a[h>>>16&255]<<16|a[p>>>8&255]<<8|a[255&f])^t[d++],v=(a[h>>>24]<<24|a[p>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^t[d++],_=(a[p>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&h])^t[d++];r[e]=l;r[e+1]=g;r[e+2]=v;r[e+3]=_},keySize:8});r.AES=e._createHelper(y)}();!function(){var r=CryptoJS,e=r.lib.StreamCipher,t=r.algo,n=t.RC4=e.extend({_doReset:function(){for(var r=this._key,e=r.words,t=r.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var s=i%t,a=e[s>>>2]>>>24-s%4*8&255;o=(o+n[i]+a)%256;var c=n[i];n[i]=n[o];n[o]=c}this._i=this._j=0},_doProcessBlock:function(r,e){r[e]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var r=this._S,e=this._i,t=this._j,n=0,i=0;i<4;i++){t=(t+r[e=(e+1)%256])%256;var o=r[e];r[e]=r[t];r[t]=o;n|=r[(r[e]+r[t])%256]<<24-8*i}this._i=e;this._j=t;return n}r.RC4=e._createHelper(n);var i=t.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var r=this.cfg.drop;r>0;r--)generateKeystreamWord.call(this)}});r.RC4Drop=e._createHelper(i)}();CryptoJS.mode.ECB=function(){var r=CryptoJS.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(r,e){this._cipher.encryptBlock(r,e)}});r.Decryptor=r.extend({processBlock:function(r,e){this._cipher.decryptBlock(r,e)}});return r}();var _PDFSecurity=function(){function _PDFSecurity(r,e){void 0===e&&(e={});if(!e.ownerPassword&&!e.userPassword)throw new Error("None of owner password and user password is defined.");this.document=r;this._setupEncryption(e)}_PDFSecurity.generateFileID=function(r){void 0===r&&(r={});var e=r.CreationDate.getTime()+"\n";for(var t in r)r.hasOwnProperty(t)&&(e+=t+": "+r[t]+"\n");return wordArrayToBuffer(CryptoJS.MD5(e))};_PDFSecurity.generateRandomWordArray=function(r){return CryptoJS.lib.WordArray.random(r)};_PDFSecurity.create=function(r,e){void 0===e&&(e={});return e.ownerPassword||e.userPassword?new _PDFSecurity(r,e):null};_PDFSecurity.prototype._setupEncryption=function(r){switch(r.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}var e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,r);break;case 5:this._setupEncryptionV5(e,r)}this.dictionary=this.document.ref(e)};_PDFSecurity.prototype._setupEncryptionV1V2V4=function(r,e,t){var n,i;switch(r){case 1:n=2;this.keyBits=40;i=getPermissionsR2(t.permissions);break;case 2:n=3;this.keyBits=128;i=getPermissionsR3(t.permissions);break;case 4:n=4;this.keyBits=128;i=getPermissionsR3(t.permissions)}var o,s=processPasswordR2R3R4(t.userPassword),a=t.ownerPassword?processPasswordR2R3R4(t.ownerPassword):s,c=getOwnerPasswordR2R3R4(n,this.keyBits,s,a);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,s,c,i);o=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);e.V=r;r>=2&&(e.Length=this.keyBits);if(4===r){e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF"}e.R=n;e.O=wordArrayToBuffer(c);e.U=wordArrayToBuffer(o);e.P=i};_PDFSecurity.prototype._setupEncryptionV5=function(r,e){this.keyBits=256;var t=getPermissionsR3(e.permissions),n=processPasswordR5(e.userPassword),i=e.ownerPassword?processPasswordR5(e.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);var o=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,CryptoJS.lib.WordArray.create(o.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(i,o,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(i,CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),o,this.encryptionKey),f=getEncryptedPermissionsR5(t,this.encryptionKey,_PDFSecurity.generateRandomWordArray);r.V=5;r.Length=this.keyBits;r.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};r.StmF="StdCF";r.StrF="StdCF";r.R=5;r.O=wordArrayToBuffer(a);r.OE=wordArrayToBuffer(c);r.U=wordArrayToBuffer(o);r.UE=wordArrayToBuffer(s);r.P=t;r.Perms=wordArrayToBuffer(f)};_PDFSecurity.prototype.getEncryptFn=function(r,e){var t,n;this.version<5&&(t=this.encryptionKey.clone().concat(CryptoJS.lib.WordArray.create([(255&r)<<24|(65280&r)<<8|r>>8&65280|255&e,(65280&e)<<16],5)));if(1===this.version||2===this.version){var i=CryptoJS.MD5(t);i.sigBytes=Math.min(16,this.keyBits/8+5);return function(r){return wordArrayToBuffer(CryptoJS.RC4.encrypt(CryptoJS.lib.WordArray.create(r),i).ciphertext)}}n=4===this.version?CryptoJS.MD5(t.concat(CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;var o=_PDFSecurity.generateRandomWordArray(16),s={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:o};return function(r){return wordArrayToBuffer(o.clone().concat(CryptoJS.AES.encrypt(CryptoJS.lib.WordArray.create(r),n,s).ciphertext))}};_PDFSecurity.prototype.end=function(){this.dictionary.end()};return _PDFSecurity}();export{_PDFSecurity};function getPermissionsR2(r){void 0===r&&(r={});var e=-64;r.printing&&(e|=4);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);return e}function getPermissionsR3(r){void 0===r&&(r={});var e=-3904;"lowResolution"===r.printing&&(e|=4);"highResolution"===r.printing&&(e|=2052);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);r.fillingForms&&(e|=256);r.contentAccessibility&&(e|=512);r.documentAssembly&&(e|=1024);return e}function getUserPasswordR2(r){return CryptoJS.RC4.encrypt(processPasswordR2R3R4(),r).ciphertext}function getUserPasswordR3R4(r,e){for(var t=e.clone(),n=CryptoJS.MD5(processPasswordR2R3R4().concat(CryptoJS.lib.WordArray.create(r))),i=0;i<20;i++){for(var o=Math.ceil(t.sigBytes/4),s=0;s<o;s++)t.words[s]=e.words[s]^(i|i<<8|i<<16|i<<24);n=CryptoJS.RC4.encrypt(n,t).ciphertext}return n.concat(CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(r,e,t,n){for(var i=n,o=r>=3?51:1,s=0;s<o;s++)i=CryptoJS.MD5(i);var a=i.clone();a.sigBytes=e/8;var c=t;o=r>=3?20:1;for(s=0;s<o;s++){for(var f=Math.ceil(a.sigBytes/4),u=0;u<f;u++)a.words[u]=i.words[u]^(s|s<<8|s<<16|s<<24);c=CryptoJS.RC4.encrypt(c,a).ciphertext}return c}function getEncryptionKeyR2R3R4(r,e,t,n,i,o){for(var s=n.clone().concat(i).concat(CryptoJS.lib.WordArray.create([lsbFirstWord(o)],4)).concat(CryptoJS.lib.WordArray.create(t)),a=r>=3?51:1,c=0;c<a;c++)(s=CryptoJS.MD5(s)).sigBytes=e/8;return s}function getUserPasswordR5(r,e){var t=e(8),n=e(8);return CryptoJS.SHA256(r.clone().concat(t)).concat(t).concat(n)}function getUserEncryptionKeyR5(r,e,t){var n=CryptoJS.SHA256(r.clone().concat(e)),i={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(t,n,i).ciphertext}function getOwnerPasswordR5(r,e,t){var n=t(8),i=t(8);return CryptoJS.SHA256(r.clone().concat(n).concat(e)).concat(n).concat(i)}function getOwnerEncryptionKeyR5(r,e,t,n){var i=CryptoJS.SHA256(r.clone().concat(e).concat(t)),o={mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.NoPadding,iv:CryptoJS.lib.WordArray.create(null,16)};return CryptoJS.AES.encrypt(n,i,o).ciphertext}function getEncryptionKeyR5(r){return r(32)}function getEncryptedPermissionsR5(r,e,t){var n=CryptoJS.lib.WordArray.create([lsbFirstWord(r),4294967295,1415668834],12).concat(t(4)),i={mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.NoPadding};return CryptoJS.AES.encrypt(n,e,i).ciphertext}function processPasswordR2R3R4(r){void 0===r&&(r="");for(var e=new Buffer(32),t=r.length,n=0;n<t&&n<32;){var i=r.charCodeAt(n);if(i>255)throw new Error("Password contains one or more invalid characters.");e[n]=i;n++}for(;n<32;){e[n]=PASSWORD_PADDING[n-t];n++}return CryptoJS.lib.WordArray.create(e)}function processPasswordR5(r){void 0===r&&(r="");r=unescape(encodeURIComponent(saslprep(r)));for(var e=Math.min(127,r.length),t=new Buffer(e),n=0;n<e;n++)t[n]=r.charCodeAt(n);return CryptoJS.lib.WordArray.create(t)}function lsbFirstWord(r){return(255&r)<<24|(65280&r)<<8|r>>8&65280|r>>24&255}function wordArrayToBuffer(r){for(var e=[],t=0;t<r.sigBytes;t++)e.push(r.words[Math.floor(t/4)]>>8*(3-t%4)&255);return Buffer.from(e)}var PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];_registerModule("wijmo.pdf.security",selfModule);
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.45-nightly.d20260106.t072437
3
+ * Wijmo Library 5.20261.45-nightly.d20260108.t163148
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.45-nightly.d20260106.t072437
3
+ * Wijmo Library 5.20261.45-nightly.d20260108.t163148
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- "use strict";var __importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(null!=r)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);e.default=r;return e};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.pdf.security")),K_MAX_LENGTH=2147483647;function createBuffer(r){if(r>K_MAX_LENGTH)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);Object.setPrototypeOf(e,Buffer.prototype);return e}function Buffer(r,e,t){if("number"==typeof r){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(r)}return from(r,e,t)}exports.Buffer=Buffer;function from(r,e,t){if(ArrayBuffer.isView(r))return fromArrayLike(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(isInstance(r,ArrayBuffer)||r&&isInstance(r.buffer,ArrayBuffer))return fromArrayBuffer(r,e,t);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(r,SharedArrayBuffer)||r&&isInstance(r.buffer,SharedArrayBuffer)))return fromArrayBuffer(r,e,t);if("number"==typeof r)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(null!=n&&n!==r)return Buffer.from(n,e,t);var o=fromObject(r);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof r[Symbol.toPrimitive])return Buffer.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}Buffer.from=function(r,e,t){return from(r,e,t)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(r){if("number"!=typeof r)throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function allocUnsafe(r){assertSize(r);return createBuffer(r<0?0:0|checked(r))}function fromArrayLike(r){for(var e=r.length<0?0:0|checked(r.length),t=createBuffer(e),n=0;n<e;n+=1)t[n]=255&r[n];return t}function fromArrayBuffer(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===t?new Uint8Array(r):void 0===t?new Uint8Array(r,e):new Uint8Array(r,e,t);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(r){if(Buffer.isBuffer(r)){var e=0|checked(r.length),t=createBuffer(e);if(0===t.length)return t;r.copy(t,0,0,e);return t}return void 0!==r.length?"number"!=typeof r.length||numberIsNaN(r.length)?createBuffer(0):fromArrayLike(r):"Buffer"===r.type&&Array.isArray(r.data)?fromArrayLike(r.data):void 0}function checked(r){if(r>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|r}Buffer.isBuffer=function isBuffer(r){return null!=r&&!0===r._isBuffer&&r!==Buffer.prototype};function slowToString(r,e,t){var n=!1;(void 0===e||e<0)&&(e=0);if(e>this.length)return"";(void 0===t||t>this.length)&&(t=this.length);if(t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";r||(r="utf8");for(;;)switch(r){case"hex":return hexSlice(this,e,t);case"utf8":case"utf-8":return utf8Slice(this,e,t);case"ascii":return asciiSlice(this,e,t);case"latin1":case"binary":return latin1Slice(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var r=this.length;return 0===r?"":0===arguments.length?utf8Slice(this,0,r):slowToString.apply(this,arguments)};function utf8Slice(r,e,t){t=Math.min(r.length,t);for(var n=[],o=e;o<t;){var i=r[o],s=null,a=i>239?4:i>223?3:i>191?2:1;if(o+a<=t){var c=void 0,f=void 0,u=void 0,p=void 0;switch(a){case 1:i<128&&(s=i);break;case 2:128==(192&(c=r[o+1]))&&(p=(31&i)<<6|63&c)>127&&(s=p);break;case 3:c=r[o+1];f=r[o+2];128==(192&c)&&128==(192&f)&&(p=(15&i)<<12|(63&c)<<6|63&f)>2047&&(p<55296||p>57343)&&(s=p);break;case 4:c=r[o+1];f=r[o+2];u=r[o+3];128==(192&c)&&128==(192&f)&&128==(192&u)&&(p=(15&i)<<18|(63&c)<<12|(63&f)<<6|63&u)>65535&&p<1114112&&(s=p)}}if(null===s){s=65533;a=1}else if(s>65535){s-=65536;n.push(s>>>10&1023|55296);s=56320|1023&s}n.push(s);o+=a}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(r){var e=r.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;){var o=Math.min(n+MAX_ARGUMENTS_LENGTH,e);t+=String.fromCharCode.apply(String,r.slice(n,o));n=o}return t}function asciiSlice(r,e,t){var n="";t=Math.min(r.length,t);for(var o=e;o<t;++o)n+=String.fromCharCode(127&r[o]);return n}function latin1Slice(r,e,t){var n="";t=Math.min(r.length,t);for(var o=e;o<t;++o)n+=String.fromCharCode(r[o]);return n}function hexSlice(r,e,t){var n=r.length;(!e||e<0)&&(e=0);(!t||t<0||t>n)&&(t=n);for(var o="",i=e;i<t;++i)o+=hexSliceLookupTable[r[i]];return o}function utf16leSlice(r,e,t){for(var n=r.slice(e,t),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}Buffer.prototype.slice=function slice(r,e){var t,n=this.length;(r=~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n);(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);e<r&&(e=r);return t=this.subarray(r,e)(Object).setPrototypeOf(t,Buffer.prototype)};Buffer.prototype.copy=function copy(r,e,t,n){if(!Buffer.isBuffer(r))throw new TypeError("argument should be a Buffer");t||(t=0);n||0===n||(n=this.length);e>=r.length&&(e=r.length);e||(e=0);n>0&&n<t&&(n=t);if(n===t)return 0;if(0===r.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);r.length-e<n-t&&(n=r.length-e+t);var o=n-t;if(this===r&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,t,n);else if(this===r&&t<e&&e<n)for(var i=o-1;i>=0;--i)r[i+e]=this[i+t];else Uint8Array.prototype.set.call(r,this.subarray(t,n),e);return o};function isInstance(r,e){return r instanceof e||null!=r&&null!=r.constructor&&null!=r.constructor.name&&r.constructor.name===e.name}function numberIsNaN(r){return r!=r}var hexSliceLookupTable=function(){for(var r=new Array(256),e=0;e<16;++e)for(var t=16*e,n=0;n<16;++n)r[t+n]="0123456789abcdef"[e]+"0123456789abcdef"[n];return r}();function inRange(r,e){if(r<e[0])return!1;for(var t=0,n=e.length/2;t<=n;){var o=Math.floor((t+n)/2),i=2*o;if(r>=e[i]&&r<=e[i+1])return!0;r>e[i+1]?t=o+1:n=o-1}return!1}exports.inRange=inRange;var unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];exports.isUnassignedCodePoint=function(r){return inRange(r,unassigned_code_points)};var commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];exports.isCommonlyMappedToNothing=function(r){return inRange(r,commonly_mapped_to_nothing)};var non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];exports.isNonASCIISpaceCharacter=function(r){return inRange(r,non_ASCII_space_characters)};var non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];exports.isProhibitedCharacter=function(r){return inRange(r,non_ASCII_space_characters)||inRange(r,prohibited_characters)||inRange(r,non_ASCII_controls_characters)||inRange(r,non_character_codepoints)};var bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];exports.isBidirectionalRAL=function(r){return inRange(r,bidirectional_r_al)};var bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];exports.isBidirectionalL=function(r){return inRange(r,bidirectional_l)};var mapping2space=exports.isNonASCIISpaceCharacter,mapping2nothing=exports.isCommonlyMappedToNothing,getCodePoint=function(r){return r.codePointAt(0)},first=function(r){return r[0]},last=function(r){return r[r.length-1]};function toCodePoints(r){for(var e=[],t=r.length,n=0;n<t;n+=1){var o=r.charCodeAt(n);if(o>=55296&&o<=56319&&t>n+1){var i=r.charCodeAt(n+1);if(i>=56320&&i<=57343){e.push(1024*(o-55296)+i-56320+65536);n+=1;continue}}e.push(o)}return e}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);for(var r=[],e=0,t="",n=0,o=arguments.length;n!==o;++n){var i=+arguments[n];if(!(i<1114111&&i>>>0===i))throw RangeError("Invalid code point: "+i);if(i<=65535)e=r.push(i);else{i-=65536;e=r.push(55296+(i>>10),i%1024+56320)}if(e>=16383){t+=String.fromCharCode.apply(null,r);r.length=0}}return t+String.fromCharCode.apply(null,r)}function saslprep(r,e){void 0===e&&(e={});if("string"!=typeof r)throw new TypeError("Expected string.");if(0===r.length)return"";var t=toCodePoints(r).map((function(r){return mapping2space(r)?32:r})).filter((function(r){return!mapping2nothing(r)})),n=fromCodePoint.apply(null,t).normalize("NFKC"),o=toCodePoints(n);if(o.some(exports.isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned){if(o.some(exports.isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}var i=o.some(exports.isBidirectionalRAL),s=o.some(exports.isBidirectionalL);if(i&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");var a=exports.isBidirectionalRAL(getCodePoint(first(n))),c=exports.isBidirectionalRAL(getCodePoint(last(n)));if(i&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}exports.saslprep=saslprep;exports.CryptoJS=function(r,e){var t;"undefined"!=typeof window&&window.crypto&&(t=window.crypto);!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto);var cryptoSecureRandomInt=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(r){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(r){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(r){var e;F.prototype=r;e=new F;F.prototype=null;return e}}(),o={},i=o.lib={},s=i.Base={extend:function(r){var e=n(this);r&&e.mixIn(r);e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)});e.init.prototype=e;e.$super=this;return e},create:function(){var r=this.extend();r.init.apply(r,arguments);return r},init:function(){},mixIn:function(r){for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=s.extend({init:function(r,e){r=this.words=r||[];this.sigBytes=null!=e?e:4*r.length},toString:function(r){return(r||f).stringify(this)},concat:function(r){var e=this.words,t=r.words,n=this.sigBytes,o=r.sigBytes;this.clamp();if(n%4)for(var i=0;i<o;i++){var s=t[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)e[n+i>>>2]=t[i>>>2];this.sigBytes+=o;return this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8;e.length=r.ceil(t/4)},clone:function(){var r=s.clone.call(this);r.words=this.words.slice(0);return r},random:function(r){for(var e=[],t=0;t<r;t+=4)e.push(cryptoSecureRandomInt());return new a.init(e,r)}}),c=o.enc={},f=c.Hex={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],o=0;o<t;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16));n.push((15&i).toString(16))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n+=2)t[n>>>3]|=parseInt(r.substr(n,2),16)<<24-n%8*4;return new a.init(t,e/2)}},u=c.Latin1={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],o=0;o<t;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n++)t[n>>>2]|=(255&r.charCodeAt(n))<<24-n%4*8;return new a.init(t,e)}},p=c.Utf8={stringify:function(r){try{return decodeURIComponent(escape(u.stringify(r)))}catch(r){throw new Error("Malformed UTF-8 data")}},parse:function(r){return u.parse(unescape(encodeURIComponent(r)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(r){"string"==typeof r&&(r=p.parse(r));this._data.concat(r);this._nDataBytes+=r.sigBytes},_process:function(e){var t,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,c=i/(4*s),f=(c=e?r.ceil(c):r.max((0|c)-this._minBufferSize,0))*s,u=r.min(4*f,i);if(f){for(var p=0;p<f;p+=s)this._doProcessBlock(o,p);t=o.splice(0,f);n.sigBytes-=u}return new a.init(t,u)},clone:function(){var r=s.clone.call(this);r._data=this._data.clone();return r},_minBufferSize:0}),d=(i.Hasher=h.extend({cfg:s.extend(),init:function(r){this.cfg=this.cfg.extend(r);this.reset()},reset:function(){h.reset.call(this);this._doReset()},update:function(r){this._append(r);this._process();return this},finalize:function(r){r&&this._append(r);return this._doFinalize()},blockSize:16,_createHelper:function(r){return function(e,t){return new r.init(t).finalize(e)}},_createHmacHelper:function(r){return function(e,t){return new d.HMAC.init(r,t).finalize(e)}}}),o.algo={});return o}(Math);!function(r){var e=exports.CryptoJS,t=e.lib,n=t.WordArray,o=t.Hasher,i=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*r.abs(r.sin(e+1))|0}();var a=i.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var n=e+t,o=r[n];r[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=r[e+0],c=r[e+1],f=r[e+2],u=r[e+3],p=r[e+4],h=r[e+5],d=r[e+6],y=r[e+7],l=r[e+8],g=r[e+9],v=r[e+10],_=r[e+11],m=r[e+12],S=r[e+13],w=r[e+14],C=r[e+15],B=i[0],x=i[1],A=i[2],R=i[3];B=FF(B,x,A,R,a,7,s[0]);R=FF(R,B,x,A,c,12,s[1]);A=FF(A,R,B,x,f,17,s[2]);x=FF(x,A,R,B,u,22,s[3]);B=FF(B,x,A,R,p,7,s[4]);R=FF(R,B,x,A,h,12,s[5]);A=FF(A,R,B,x,d,17,s[6]);x=FF(x,A,R,B,y,22,s[7]);B=FF(B,x,A,R,l,7,s[8]);R=FF(R,B,x,A,g,12,s[9]);A=FF(A,R,B,x,v,17,s[10]);x=FF(x,A,R,B,_,22,s[11]);B=FF(B,x,A,R,m,7,s[12]);R=FF(R,B,x,A,S,12,s[13]);A=FF(A,R,B,x,w,17,s[14]);B=GG(B,x=FF(x,A,R,B,C,22,s[15]),A,R,c,5,s[16]);R=GG(R,B,x,A,d,9,s[17]);A=GG(A,R,B,x,_,14,s[18]);x=GG(x,A,R,B,a,20,s[19]);B=GG(B,x,A,R,h,5,s[20]);R=GG(R,B,x,A,v,9,s[21]);A=GG(A,R,B,x,C,14,s[22]);x=GG(x,A,R,B,p,20,s[23]);B=GG(B,x,A,R,g,5,s[24]);R=GG(R,B,x,A,w,9,s[25]);A=GG(A,R,B,x,u,14,s[26]);x=GG(x,A,R,B,l,20,s[27]);B=GG(B,x,A,R,S,5,s[28]);R=GG(R,B,x,A,f,9,s[29]);A=GG(A,R,B,x,y,14,s[30]);B=HH(B,x=GG(x,A,R,B,m,20,s[31]),A,R,h,4,s[32]);R=HH(R,B,x,A,l,11,s[33]);A=HH(A,R,B,x,_,16,s[34]);x=HH(x,A,R,B,w,23,s[35]);B=HH(B,x,A,R,c,4,s[36]);R=HH(R,B,x,A,p,11,s[37]);A=HH(A,R,B,x,y,16,s[38]);x=HH(x,A,R,B,v,23,s[39]);B=HH(B,x,A,R,S,4,s[40]);R=HH(R,B,x,A,a,11,s[41]);A=HH(A,R,B,x,u,16,s[42]);x=HH(x,A,R,B,d,23,s[43]);B=HH(B,x,A,R,g,4,s[44]);R=HH(R,B,x,A,m,11,s[45]);A=HH(A,R,B,x,C,16,s[46]);B=II(B,x=HH(x,A,R,B,f,23,s[47]),A,R,a,6,s[48]);R=II(R,B,x,A,y,10,s[49]);A=II(A,R,B,x,w,15,s[50]);x=II(x,A,R,B,h,21,s[51]);B=II(B,x,A,R,m,6,s[52]);R=II(R,B,x,A,u,10,s[53]);A=II(A,R,B,x,v,15,s[54]);x=II(x,A,R,B,c,21,s[55]);B=II(B,x,A,R,l,6,s[56]);R=II(R,B,x,A,C,10,s[57]);A=II(A,R,B,x,d,15,s[58]);x=II(x,A,R,B,S,21,s[59]);B=II(B,x,A,R,p,6,s[60]);R=II(R,B,x,A,_,10,s[61]);A=II(A,R,B,x,f,15,s[62]);x=II(x,A,R,B,g,21,s[63]);i[0]=i[0]+B|0;i[1]=i[1]+x|0;i[2]=i[2]+A|0;i[3]=i[3]+R|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;t[o>>>5]|=128<<24-o%32;var i=r.floor(n/4294967296),s=n;t[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);t[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);e.sigBytes=4*(t.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var r=o.clone.call(this);r._hash=this._hash.clone();return r}});function FF(r,e,t,n,o,i,s){var a=r+(e&t|~e&n)+o+s;return(a<<i|a>>>32-i)+e}function GG(r,e,t,n,o,i,s){var a=r+(e&n|t&~n)+o+s;return(a<<i|a>>>32-i)+e}function HH(r,e,t,n,o,i,s){var a=r+(e^t^n)+o+s;return(a<<i|a>>>32-i)+e}function II(r,e,t,n,o,i,s){var a=r+(t^(e|~n))+o+s;return(a<<i|a>>>32-i)+e}e.MD5=o._createHelper(a);e.HmacMD5=o._createHmacHelper(a)}(Math);!function(r){var e=exports.CryptoJS,t=e.lib,n=t.WordArray,o=t.Hasher,i=e.algo,s=[],a=[];!function(){function isPrime(e){for(var t=r.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function getFractionalBits(r){return 4294967296*(r-(0|r))|0}for(var e=2,t=0;t<64;){if(isPrime(e)){t<8&&(s[t]=getFractionalBits(r.pow(e,.5)));a[t]=getFractionalBits(r.pow(e,1/3));t++}e++}}();var c=[],f=i.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(r,e){for(var t=this._hash.words,n=t[0],o=t[1],i=t[2],s=t[3],f=t[4],u=t[5],p=t[6],h=t[7],d=0;d<64;d++){if(d<16)c[d]=0|r[e+d];else{var y=c[d-15],l=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,g=c[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[d]=l+c[d-7]+v+c[d-16]}var _=n&o^n&i^o&i,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),S=h+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&p)+a[d]+c[d];h=p;p=u;u=f;f=s+S|0;s=i;i=o;o=n;n=S+(m+_)|0}t[0]=t[0]+n|0;t[1]=t[1]+o|0;t[2]=t[2]+i|0;t[3]=t[3]+s|0;t[4]=t[4]+f|0;t[5]=t[5]+u|0;t[6]=t[6]+p|0;t[7]=t[7]+h|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;t[o>>>5]|=128<<24-o%32;t[14+(o+64>>>9<<4)]=r.floor(n/4294967296);t[15+(o+64>>>9<<4)]=n;e.sigBytes=4*t.length;this._process();return this._hash},clone:function(){var r=o.clone.call(this);r._hash=this._hash.clone();return r}});e.SHA256=o._createHelper(f);e.HmacSHA256=o._createHmacHelper(f)}(Math);!function(){var r=exports.CryptoJS,e=r.lib.Base,t=r.enc.Utf8;r.algo.HMAC=e.extend({init:function(r,e){r=this._hasher=new r.init;"string"==typeof e&&(e=t.parse(e));var n=r.blockSize,o=4*n;e.sigBytes>o&&(e=r.finalize(e));e.clamp();for(var i=this._oKey=e.clone(),s=this._iKey=e.clone(),a=i.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}i.sigBytes=s.sigBytes=o;this.reset()},reset:function(){var r=this._hasher;r.reset();r.update(this._iKey)},update:function(r){this._hasher.update(r);return this},finalize:function(r){var e=this._hasher,t=e.finalize(r);e.reset();return e.finalize(this._oKey.clone().concat(t))}})}();exports.CryptoJS.lib.Cipher||function(r){var e=exports.CryptoJS,t=e.lib,n=t.Base,o=t.WordArray,i=t.BufferedBlockAlgorithm,s=e.enc,a=(s.Utf8,s.Base64),c=e.algo.EvpKDF,f=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(r,e){return this.create(this._ENC_XFORM_MODE,r,e)},createDecryptor:function(r,e){return this.create(this._DEC_XFORM_MODE,r,e)},init:function(r,e,t){this.cfg=this.cfg.extend(t);this._xformMode=r;this._key=e;this.reset()},reset:function(){i.reset.call(this);this._doReset()},process:function(r){this._append(r);return this._process()},finalize:function(r){r&&this._append(r);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(r){return"string"==typeof r?_:g}return function(r){return{encrypt:function(e,t,n){return selectCipherStrategy(t).encrypt(r,e,t,n)},decrypt:function(e,t,n){return selectCipherStrategy(t).decrypt(r,e,t,n)}}}}()}),u=(t.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),p=t.BlockCipherMode=n.extend({createEncryptor:function(r,e){return this.Encryptor.create(r,e)},createDecryptor:function(r,e){return this.Decryptor.create(r,e)},init:function(r,e){this._cipher=r;this._iv=e}}),h=u.CBC=function(){var r=p.extend();r.Encryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize;xorBlock.call(this,r,e,n);t.encryptBlock(r,e);this._prevBlock=r.slice(e,e+n)}});r.Decryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize,o=r.slice(e,e+n);t.decryptBlock(r,e);xorBlock.call(this,r,e,n);this._prevBlock=o}});function xorBlock(r,e,t){var n,o=this._iv;if(o){n=o;this._iv=void 0}else n=this._prevBlock;for(var i=0;i<t;i++)r[e+i]^=n[i]}return r}(),d=(e.pad={}).Pkcs7={pad:function(r,e){for(var t=4*e,n=t-r.sigBytes%t,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var c=o.create(s,n);r.concat(c)},unpad:function(r){var e=255&r.words[r.sigBytes-1>>>2];r.sigBytes-=e}},y=(t.BlockCipher=f.extend({cfg:f.cfg.extend({mode:h,padding:d}),reset:function(){var r;f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)r=n.createEncryptor;else{r=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==r)this._mode.init(this,t&&t.words);else{this._mode=r.call(n,this,t&&t.words);this._mode.__creator=r}},_doProcessBlock:function(r,e){this._mode.processBlock(r,e)},_doFinalize:function(){var r,e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);r=this._process(!0)}else{r=this._process(!0);e.unpad(r)}return r},blockSize:4}),t.CipherParams=n.extend({init:function(r){this.mixIn(r)},toString:function(r){return(r||this.formatter).stringify(this)}})),l=(e.format={}).OpenSSL={stringify:function(r){var e=r.ciphertext,t=r.salt;return(t?o.create([1398893684,1701076831]).concat(t).concat(e):e).toString(a)},parse:function(r){var e,t=a.parse(r),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){e=o.create(n.slice(2,4));n.splice(0,4);t.sigBytes-=16}return y.create({ciphertext:t,salt:e})}},g=t.SerializableCipher=n.extend({cfg:n.extend({format:l}),encrypt:function(r,e,t,n){n=this.cfg.extend(n);var o=r.createEncryptor(t,n),i=o.finalize(e),s=o.cfg;return y.create({ciphertext:i,key:t,iv:s.iv,algorithm:r,mode:s.mode,padding:s.padding,blockSize:r.blockSize,formatter:n.format})},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);return r.createDecryptor(t,n).finalize(e.ciphertext)},_parse:function(r,e){return"string"==typeof r?e.parse(r,this):r}}),v=(e.kdf={}).OpenSSL={execute:function(r,e,t,n){n||(n=o.random(8));var i=c.create({keySize:e+t}).compute(r,n),s=o.create(i.words.slice(e),4*t);i.sigBytes=4*e;return y.create({key:i,iv:s,salt:n})}},_=t.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(r,e,t,n){var o=(n=this.cfg.extend(n)).kdf.execute(t,r.keySize,r.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,r,e,o.key,n);i.mixIn(o);return i},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);var o=n.kdf.execute(t,r.keySize,r.ivSize,e.salt);n.iv=o.iv;return g.decrypt.call(this,r,e,o.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var r=exports.CryptoJS.lib.WordArray,e=r.init;(r.init=function(r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));(r instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));if(r instanceof Uint8Array){for(var t=r.byteLength,n=[],o=0;o<t;o++)n[o>>>2]|=r[o]<<24-o%4*8;e.call(this,n,t)}else e.apply(this,arguments)}).prototype=r}}();exports.CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var r=exports.CryptoJS,e=r.lib.WordArray;r.enc.Base64={stringify:function(r){var e=r.words,t=r.sigBytes,n=this._map;r.clamp();for(var o=[],i=0;i<t;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<t;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(r){var t=r.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=r.indexOf(s);-1!==a&&(t=a)}return function parseLoop(r,t,n){for(var o=[],i=0,s=0;s<t;s++)if(s%4){var a=n[r.charCodeAt(s-1)]<<s%4*2,c=n[r.charCodeAt(s)]>>>6-s%4*2,f=a|c;o[i>>>2]|=f<<24-i%4*8;i++}return e.create(o,i)}(r,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var r=exports.CryptoJS,e=r.lib,t=e.Base,n=e.WordArray,o=r.algo,i=o.MD5,s=o.EvpKDF=t.extend({cfg:t.extend({keySize:4,hasher:i,iterations:1}),init:function(r){this.cfg=this.cfg.extend(r)},compute:function(r,e){for(var t,o=this.cfg,i=o.hasher.create(),s=n.create(),a=s.words,c=o.keySize,f=o.iterations;a.length<c;){t&&i.update(t);t=i.update(r).finalize(e);i.reset();for(var u=1;u<f;u++){t=i.finalize(t);i.reset()}s.concat(t)}s.sigBytes=4*c;return s}});r.EvpKDF=function(r,e,t){return s.create(t).compute(r,e)}}();!function(){var r=exports.CryptoJS,e=r.lib.BlockCipher,t=r.algo,n=[],o=[],i=[],s=[],a=[],c=[],f=[],u=[],p=[],h=[];!function(){for(var r=[],e=0;e<256;e++)r[e]=e<128?e<<1:e<<1^283;var t=0,d=0;for(e=0;e<256;e++){var y=d^d<<1^d<<2^d<<3^d<<4;y=y>>>8^255&y^99;n[t]=y;o[y]=t;var l=r[t],g=r[l],v=r[g],_=257*r[y]^16843008*y;i[t]=_<<24|_>>>8;s[t]=_<<16|_>>>16;a[t]=_<<8|_>>>24;c[t]=_;_=16843009*v^65537*g^257*l^16843008*t;f[y]=_<<24|_>>>8;u[y]=_<<16|_>>>16;p[y]=_<<8|_>>>24;h[y]=_;if(t){t=l^r[r[r[v^l]]];d^=r[r[d]]}else t=d=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],y=t.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var r=this._keyPriorReset=this._key,e=r.words,t=r.sigBytes/4,o=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],s=0;s<o;s++)if(s<t)i[s]=e[s];else{y=i[s-1];if(s%t)t>6&&s%t==4&&(y=n[y>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y]);else{y=n[(y=y<<8|y>>>24)>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y];y^=d[s/t|0]<<24}i[s]=i[s-t]^y}for(var a=this._invKeySchedule=[],c=0;c<o;c++){s=o-c;if(c%4)var y=i[s];else y=i[s-4];a[c]=c<4||s<=4?y:f[n[y>>>24]]^u[n[y>>>16&255]]^p[n[y>>>8&255]]^h[n[255&y]]}}},encryptBlock:function(r,e){this._doCryptBlock(r,e,this._keySchedule,i,s,a,c,n)},decryptBlock:function(r,e){var t=r[e+1];r[e+1]=r[e+3];r[e+3]=t;this._doCryptBlock(r,e,this._invKeySchedule,f,u,p,h,o);t=r[e+1];r[e+1]=r[e+3];r[e+3]=t},_doCryptBlock:function(r,e,t,n,o,i,s,a){for(var c=this._nRounds,f=r[e]^t[0],u=r[e+1]^t[1],p=r[e+2]^t[2],h=r[e+3]^t[3],d=4,y=1;y<c;y++){var l=n[f>>>24]^o[u>>>16&255]^i[p>>>8&255]^s[255&h]^t[d++],g=n[u>>>24]^o[p>>>16&255]^i[h>>>8&255]^s[255&f]^t[d++],v=n[p>>>24]^o[h>>>16&255]^i[f>>>8&255]^s[255&u]^t[d++],_=n[h>>>24]^o[f>>>16&255]^i[u>>>8&255]^s[255&p]^t[d++];f=l;u=g;p=v;h=_}l=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&h])^t[d++],g=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^t[d++],v=(a[p>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^t[d++],_=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^t[d++];r[e]=l;r[e+1]=g;r[e+2]=v;r[e+3]=_},keySize:8});r.AES=e._createHelper(y)}();!function(){var r=exports.CryptoJS,e=r.lib.StreamCipher,t=r.algo,n=t.RC4=e.extend({_doReset:function(){for(var r=this._key,e=r.words,t=r.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var s=o%t,a=e[s>>>2]>>>24-s%4*8&255;i=(i+n[o]+a)%256;var c=n[o];n[o]=n[i];n[i]=c}this._i=this._j=0},_doProcessBlock:function(r,e){r[e]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var r=this._S,e=this._i,t=this._j,n=0,o=0;o<4;o++){t=(t+r[e=(e+1)%256])%256;var i=r[e];r[e]=r[t];r[t]=i;n|=r[(r[e]+r[t])%256]<<24-8*o}this._i=e;this._j=t;return n}r.RC4=e._createHelper(n);var o=t.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var r=this.cfg.drop;r>0;r--)generateKeystreamWord.call(this)}});r.RC4Drop=e._createHelper(o)}();exports.CryptoJS.mode.ECB=function(){var r=exports.CryptoJS.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(r,e){this._cipher.encryptBlock(r,e)}});r.Decryptor=r.extend({processBlock:function(r,e){this._cipher.decryptBlock(r,e)}});return r}();var _PDFSecurity=function(){function _PDFSecurity(r,e){void 0===e&&(e={});if(!e.ownerPassword&&!e.userPassword)throw new Error("None of owner password and user password is defined.");this.document=r;this._setupEncryption(e)}_PDFSecurity.generateFileID=function(r){void 0===r&&(r={});var e=r.CreationDate.getTime()+"\n";for(var t in r)r.hasOwnProperty(t)&&(e+=t+": "+r[t]+"\n");return wordArrayToBuffer(exports.CryptoJS.MD5(e))};_PDFSecurity.generateRandomWordArray=function(r){return exports.CryptoJS.lib.WordArray.random(r)};_PDFSecurity.create=function(r,e){void 0===e&&(e={});return e.ownerPassword||e.userPassword?new _PDFSecurity(r,e):null};_PDFSecurity.prototype._setupEncryption=function(r){switch(r.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}var e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,r);break;case 5:this._setupEncryptionV5(e,r)}this.dictionary=this.document.ref(e)};_PDFSecurity.prototype._setupEncryptionV1V2V4=function(r,e,t){var n,o;switch(r){case 1:n=2;this.keyBits=40;o=getPermissionsR2(t.permissions);break;case 2:n=3;this.keyBits=128;o=getPermissionsR3(t.permissions);break;case 4:n=4;this.keyBits=128;o=getPermissionsR3(t.permissions)}var i,s=processPasswordR2R3R4(t.userPassword),a=t.ownerPassword?processPasswordR2R3R4(t.ownerPassword):s,c=getOwnerPasswordR2R3R4(n,this.keyBits,s,a);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,s,c,o);i=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);e.V=r;r>=2&&(e.Length=this.keyBits);if(4===r){e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF"}e.R=n;e.O=wordArrayToBuffer(c);e.U=wordArrayToBuffer(i);e.P=o};_PDFSecurity.prototype._setupEncryptionV5=function(r,e){this.keyBits=256;var t=getPermissionsR3(e.permissions),n=processPasswordR5(e.userPassword),o=e.ownerPassword?processPasswordR5(e.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);var i=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,exports.CryptoJS.lib.WordArray.create(i.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(o,i,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(o,exports.CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),i,this.encryptionKey),f=getEncryptedPermissionsR5(t,this.encryptionKey,_PDFSecurity.generateRandomWordArray);r.V=5;r.Length=this.keyBits;r.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};r.StmF="StdCF";r.StrF="StdCF";r.R=5;r.O=wordArrayToBuffer(a);r.OE=wordArrayToBuffer(c);r.U=wordArrayToBuffer(i);r.UE=wordArrayToBuffer(s);r.P=t;r.Perms=wordArrayToBuffer(f)};_PDFSecurity.prototype.getEncryptFn=function(r,e){var t,n;this.version<5&&(t=this.encryptionKey.clone().concat(exports.CryptoJS.lib.WordArray.create([(255&r)<<24|(65280&r)<<8|r>>8&65280|255&e,(65280&e)<<16],5)));if(1===this.version||2===this.version){var o=exports.CryptoJS.MD5(t);o.sigBytes=Math.min(16,this.keyBits/8+5);return function(r){return wordArrayToBuffer(exports.CryptoJS.RC4.encrypt(exports.CryptoJS.lib.WordArray.create(r),o).ciphertext)}}n=4===this.version?exports.CryptoJS.MD5(t.concat(exports.CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;var i=_PDFSecurity.generateRandomWordArray(16),s={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.Pkcs7,iv:i};return function(r){return wordArrayToBuffer(i.clone().concat(exports.CryptoJS.AES.encrypt(exports.CryptoJS.lib.WordArray.create(r),n,s).ciphertext))}};_PDFSecurity.prototype.end=function(){this.dictionary.end()};return _PDFSecurity}();exports._PDFSecurity=_PDFSecurity;function getPermissionsR2(r){void 0===r&&(r={});var e=-64;r.printing&&(e|=4);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);return e}function getPermissionsR3(r){void 0===r&&(r={});var e=-3904;"lowResolution"===r.printing&&(e|=4);"highResolution"===r.printing&&(e|=2052);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);r.fillingForms&&(e|=256);r.contentAccessibility&&(e|=512);r.documentAssembly&&(e|=1024);return e}function getUserPasswordR2(r){return exports.CryptoJS.RC4.encrypt(processPasswordR2R3R4(),r).ciphertext}function getUserPasswordR3R4(r,e){for(var t=e.clone(),n=exports.CryptoJS.MD5(processPasswordR2R3R4().concat(exports.CryptoJS.lib.WordArray.create(r))),o=0;o<20;o++){for(var i=Math.ceil(t.sigBytes/4),s=0;s<i;s++)t.words[s]=e.words[s]^(o|o<<8|o<<16|o<<24);n=exports.CryptoJS.RC4.encrypt(n,t).ciphertext}return n.concat(exports.CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(r,e,t,n){for(var o=n,i=r>=3?51:1,s=0;s<i;s++)o=exports.CryptoJS.MD5(o);var a=o.clone();a.sigBytes=e/8;var c=t;i=r>=3?20:1;for(s=0;s<i;s++){for(var f=Math.ceil(a.sigBytes/4),u=0;u<f;u++)a.words[u]=o.words[u]^(s|s<<8|s<<16|s<<24);c=exports.CryptoJS.RC4.encrypt(c,a).ciphertext}return c}function getEncryptionKeyR2R3R4(r,e,t,n,o,i){for(var s=n.clone().concat(o).concat(exports.CryptoJS.lib.WordArray.create([lsbFirstWord(i)],4)).concat(exports.CryptoJS.lib.WordArray.create(t)),a=r>=3?51:1,c=0;c<a;c++)(s=exports.CryptoJS.MD5(s)).sigBytes=e/8;return s}function getUserPasswordR5(r,e){var t=e(8),n=e(8);return exports.CryptoJS.SHA256(r.clone().concat(t)).concat(t).concat(n)}function getUserEncryptionKeyR5(r,e,t){var n=exports.CryptoJS.SHA256(r.clone().concat(e)),o={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(t,n,o).ciphertext}function getOwnerPasswordR5(r,e,t){var n=t(8),o=t(8);return exports.CryptoJS.SHA256(r.clone().concat(n).concat(e)).concat(n).concat(o)}function getOwnerEncryptionKeyR5(r,e,t,n){var o=exports.CryptoJS.SHA256(r.clone().concat(e).concat(t)),i={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(n,o,i).ciphertext}function getEncryptionKeyR5(r){return r(32)}function getEncryptedPermissionsR5(r,e,t){var n=exports.CryptoJS.lib.WordArray.create([lsbFirstWord(r),4294967295,1415668834],12).concat(t(4)),o={mode:exports.CryptoJS.mode.ECB,padding:exports.CryptoJS.pad.NoPadding};return exports.CryptoJS.AES.encrypt(n,e,o).ciphertext}function processPasswordR2R3R4(r){void 0===r&&(r="");for(var e=new Buffer(32),t=r.length,n=0;n<t&&n<32;){var o=r.charCodeAt(n);if(o>255)throw new Error("Password contains one or more invalid characters.");e[n]=o;n++}for(;n<32;){e[n]=PASSWORD_PADDING[n-t];n++}return exports.CryptoJS.lib.WordArray.create(e)}function processPasswordR5(r){void 0===r&&(r="");r=unescape(encodeURIComponent(saslprep(r)));for(var e=Math.min(127,r.length),t=new Buffer(e),n=0;n<e;n++)t[n]=r.charCodeAt(n);return exports.CryptoJS.lib.WordArray.create(t)}function lsbFirstWord(r){return(255&r)<<24|(65280&r)<<8|r>>8&65280|r>>24&255}function wordArrayToBuffer(r){for(var e=[],t=0;t<r.sigBytes;t++)e.push(r.words[Math.floor(t/4)]>>8*(3-t%4)&255);return Buffer.from(e)}var PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];wijmo_1._registerModule("wijmo.pdf.security",selfModule);
14
+ "use strict";var __importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(null!=r)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);e.default=r;return e};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.pdf.security")),K_MAX_LENGTH=2147483647;function createBuffer(r){if(r>K_MAX_LENGTH)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);Object.setPrototypeOf(e,Buffer.prototype);return e}function Buffer(r,e,t){if("number"==typeof r){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(r)}return from(r,e,t)}exports.Buffer=Buffer;function from(r,e,t){if(ArrayBuffer.isView(r))return fromArrayLike(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(isInstance(r,ArrayBuffer)||r&&isInstance(r.buffer,ArrayBuffer))return fromArrayBuffer(r,e,t);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(r,SharedArrayBuffer)||r&&isInstance(r.buffer,SharedArrayBuffer)))return fromArrayBuffer(r,e,t);if("number"==typeof r)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(null!=n&&n!==r)return Buffer.from(n,e,t);var o=fromObject(r);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof r[Symbol.toPrimitive])return Buffer.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}Buffer.from=function(r,e,t){return from(r,e,t)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(r){if("number"!=typeof r)throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function allocUnsafe(r){assertSize(r);return createBuffer(r<0?0:0|checked(r))}function fromArrayLike(r){for(var e=r.length<0?0:0|checked(r.length),t=createBuffer(e),n=0;n<e;n+=1)t[n]=255&r[n];return t}function fromArrayBuffer(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===t?new Uint8Array(r):void 0===t?new Uint8Array(r,e):new Uint8Array(r,e,t);Object.setPrototypeOf(n,Buffer.prototype);return n}function fromObject(r){if(Buffer.isBuffer(r)){var e=0|checked(r.length),t=createBuffer(e);if(0===t.length)return t;r.copy(t,0,0,e);return t}return void 0!==r.length?"number"!=typeof r.length||numberIsNaN(r.length)?createBuffer(0):fromArrayLike(r):"Buffer"===r.type&&Array.isArray(r.data)?fromArrayLike(r.data):void 0}function checked(r){if(r>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|r}Buffer.isBuffer=function isBuffer(r){return null!=r&&!0===r._isBuffer&&r!==Buffer.prototype};function slowToString(r,e,t){var n=!1;(void 0===e||e<0)&&(e=0);if(e>this.length)return"";(void 0===t||t>this.length)&&(t=this.length);if(t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";r||(r="utf8");for(;;)switch(r){case"hex":return hexSlice(this,e,t);case"utf8":case"utf-8":return utf8Slice(this,e,t);case"ascii":return asciiSlice(this,e,t);case"latin1":case"binary":return latin1Slice(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();n=!0}}Buffer.prototype._isBuffer=!0;Buffer.prototype.toString=function toString(){var r=this.length;return 0===r?"":0===arguments.length?utf8Slice(this,0,r):slowToString.apply(this,arguments)};function utf8Slice(r,e,t){t=Math.min(r.length,t);for(var n,o,i,s,a=[],c=e;c<t;){var f=r[c],u=null,p=f>239?4:f>223?3:f>191?2:1;if(c+p<=t)switch(p){case 1:f<128&&(u=f);break;case 2:128==(192&(n=r[c+1]))&&(s=(31&f)<<6|63&n)>127&&(u=s);break;case 3:n=r[c+1];o=r[c+2];128==(192&n)&&128==(192&o)&&(s=(15&f)<<12|(63&n)<<6|63&o)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:n=r[c+1];o=r[c+2];i=r[c+3];128==(192&n)&&128==(192&o)&&128==(192&i)&&(s=(15&f)<<18|(63&n)<<12|(63&o)<<6|63&i)>65535&&s<1114112&&(u=s)}if(null===u){u=65533;p=1}else if(u>65535){u-=65536;a.push(u>>>10&1023|55296);u=56320|1023&u}a.push(u);c+=p}return decodeCodePointsArray(a)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(r){var e=r.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;){var o=Math.min(n+MAX_ARGUMENTS_LENGTH,e);t+=String.fromCharCode.apply(String,r.slice(n,o));n=o}return t}function asciiSlice(r,e,t){var n="";t=Math.min(r.length,t);for(var o=e;o<t;++o)n+=String.fromCharCode(127&r[o]);return n}function latin1Slice(r,e,t){var n="";t=Math.min(r.length,t);for(var o=e;o<t;++o)n+=String.fromCharCode(r[o]);return n}function hexSlice(r,e,t){var n=r.length;(!e||e<0)&&(e=0);(!t||t<0||t>n)&&(t=n);for(var o="",i=e;i<t;++i)o+=hexSliceLookupTable[r[i]];return o}function utf16leSlice(r,e,t){for(var n=r.slice(e,t),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}Buffer.prototype.slice=function slice(r,e){var t,n=this.length;(r=~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n);(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n);e<r&&(e=r);return t=this.subarray(r,e)(Object).setPrototypeOf(t,Buffer.prototype)};Buffer.prototype.copy=function copy(r,e,t,n){if(!Buffer.isBuffer(r))throw new TypeError("argument should be a Buffer");t||(t=0);n||0===n||(n=this.length);e>=r.length&&(e=r.length);e||(e=0);n>0&&n<t&&(n=t);if(n===t)return 0;if(0===r.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);r.length-e<n-t&&(n=r.length-e+t);var o=n-t;if(this===r&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,t,n);else if(this===r&&t<e&&e<n)for(var i=o-1;i>=0;--i)r[i+e]=this[i+t];else Uint8Array.prototype.set.call(r,this.subarray(t,n),e);return o};function isInstance(r,e){return r instanceof e||null!=r&&null!=r.constructor&&null!=r.constructor.name&&r.constructor.name===e.name}function numberIsNaN(r){return r!=r}var hexSliceLookupTable=function(){for(var r=new Array(256),e=0;e<16;++e)for(var t=16*e,n=0;n<16;++n)r[t+n]="0123456789abcdef"[e]+"0123456789abcdef"[n];return r}();function inRange(r,e){if(r<e[0])return!1;for(var t=0,n=e.length/2;t<=n;){var o=Math.floor((t+n)/2),i=2*o;if(r>=e[i]&&r<=e[i+1])return!0;r>e[i+1]?t=o+1:n=o-1}return!1}exports.inRange=inRange;var unassigned_code_points=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037];exports.isUnassignedCodePoint=function(r){return inRange(r,unassigned_code_points)};var commonly_mapped_to_nothing=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279];exports.isCommonlyMappedToNothing=function(r){return inRange(r,commonly_mapped_to_nothing)};var non_ASCII_space_characters=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288];exports.isNonASCIISpaceCharacter=function(r){return inRange(r,non_ASCII_space_characters)};var non_ASCII_controls_characters=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],non_character_codepoints=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],prohibited_characters=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109];exports.isProhibitedCharacter=function(r){return inRange(r,non_ASCII_space_characters)||inRange(r,prohibited_characters)||inRange(r,non_ASCII_controls_characters)||inRange(r,non_character_codepoints)};var bidirectional_r_al=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276];exports.isBidirectionalRAL=function(r){return inRange(r,bidirectional_r_al)};var bidirectional_l=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109];exports.isBidirectionalL=function(r){return inRange(r,bidirectional_l)};var mapping2space=exports.isNonASCIISpaceCharacter,mapping2nothing=exports.isCommonlyMappedToNothing,getCodePoint=function(r){return r.codePointAt(0)},first=function(r){return r[0]},last=function(r){return r[r.length-1]};function toCodePoints(r){for(var e=[],t=r.length,n=0;n<t;n+=1){var o=r.charCodeAt(n);if(o>=55296&&o<=56319&&t>n+1){var i=r.charCodeAt(n+1);if(i>=56320&&i<=57343){e.push(1024*(o-55296)+i-56320+65536);n+=1;continue}}e.push(o)}return e}function fromCodePoint(){if(String.fromCodePoint)return String.fromCodePoint.apply(null,arguments);for(var r=[],e=0,t="",n=0,o=arguments.length;n!==o;++n){var i=+arguments[n];if(!(i<1114111&&i>>>0===i))throw RangeError("Invalid code point: "+i);if(i<=65535)e=r.push(i);else{i-=65536;e=r.push(55296+(i>>10),i%1024+56320)}if(e>=16383){t+=String.fromCharCode.apply(null,r);r.length=0}}return t+String.fromCharCode.apply(null,r)}function saslprep(r,e){void 0===e&&(e={});if("string"!=typeof r)throw new TypeError("Expected string.");if(0===r.length)return"";var t=toCodePoints(r).map((function(r){return mapping2space(r)?32:r})).filter((function(r){return!mapping2nothing(r)})),n=fromCodePoint.apply(null,t).normalize("NFKC"),o=toCodePoints(n);if(o.some(exports.isProhibitedCharacter))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned){if(o.some(exports.isUnassignedCodePoint))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5")}var i=o.some(exports.isBidirectionalRAL),s=o.some(exports.isBidirectionalL);if(i&&s)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");var a=exports.isBidirectionalRAL(getCodePoint(first(n))),c=exports.isBidirectionalRAL(getCodePoint(last(n)));if(i&&(!a||!c))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return n}exports.saslprep=saslprep;exports.CryptoJS=function(r,e){var t;"undefined"!=typeof window&&window.crypto&&(t=window.crypto);!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto);var cryptoSecureRandomInt=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(r){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(r){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function F(){}return function(r){var e;F.prototype=r;e=new F;F.prototype=null;return e}}(),o={},i=o.lib={},s=i.Base={extend:function(r){var e=n(this);r&&e.mixIn(r);e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)});e.init.prototype=e;e.$super=this;return e},create:function(){var r=this.extend();r.init.apply(r,arguments);return r},init:function(){},mixIn:function(r){for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=s.extend({init:function(r,e){r=this.words=r||[];this.sigBytes=null!=e?e:4*r.length},toString:function(r){return(r||f).stringify(this)},concat:function(r){var e=this.words,t=r.words,n=this.sigBytes,o=r.sigBytes;this.clamp();if(n%4)for(var i=0;i<o;i++){var s=t[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=s<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)e[n+i>>>2]=t[i>>>2];this.sigBytes+=o;return this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8;e.length=r.ceil(t/4)},clone:function(){var r=s.clone.call(this);r.words=this.words.slice(0);return r},random:function(r){for(var e=[],t=0;t<r;t+=4)e.push(cryptoSecureRandomInt());return new a.init(e,r)}}),c=o.enc={},f=c.Hex={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],o=0;o<t;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16));n.push((15&i).toString(16))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n+=2)t[n>>>3]|=parseInt(r.substr(n,2),16)<<24-n%8*4;return new a.init(t,e/2)}},u=c.Latin1={stringify:function(r){for(var e=r.words,t=r.sigBytes,n=[],o=0;o<t;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(r){for(var e=r.length,t=[],n=0;n<e;n++)t[n>>>2]|=(255&r.charCodeAt(n))<<24-n%4*8;return new a.init(t,e)}},p=c.Utf8={stringify:function(r){try{return decodeURIComponent(escape(u.stringify(r)))}catch(r){throw new Error("Malformed UTF-8 data")}},parse:function(r){return u.parse(unescape(encodeURIComponent(r)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new a.init;this._nDataBytes=0},_append:function(r){"string"==typeof r&&(r=p.parse(r));this._data.concat(r);this._nDataBytes+=r.sigBytes},_process:function(e){var t,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,c=i/(4*s),f=(c=e?r.ceil(c):r.max((0|c)-this._minBufferSize,0))*s,u=r.min(4*f,i);if(f){for(var p=0;p<f;p+=s)this._doProcessBlock(o,p);t=o.splice(0,f);n.sigBytes-=u}return new a.init(t,u)},clone:function(){var r=s.clone.call(this);r._data=this._data.clone();return r},_minBufferSize:0}),d=(i.Hasher=h.extend({cfg:s.extend(),init:function(r){this.cfg=this.cfg.extend(r);this.reset()},reset:function(){h.reset.call(this);this._doReset()},update:function(r){this._append(r);this._process();return this},finalize:function(r){r&&this._append(r);return this._doFinalize()},blockSize:16,_createHelper:function(r){return function(e,t){return new r.init(t).finalize(e)}},_createHmacHelper:function(r){return function(e,t){return new d.HMAC.init(r,t).finalize(e)}}}),o.algo={});return o}(Math);!function(r){var e=exports.CryptoJS,t=e.lib,n=t.WordArray,o=t.Hasher,i=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*r.abs(r.sin(e+1))|0}();var a=i.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var n=e+t,o=r[n];r[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=r[e+0],c=r[e+1],f=r[e+2],u=r[e+3],p=r[e+4],h=r[e+5],d=r[e+6],y=r[e+7],l=r[e+8],g=r[e+9],v=r[e+10],_=r[e+11],m=r[e+12],S=r[e+13],w=r[e+14],C=r[e+15],B=i[0],x=i[1],A=i[2],R=i[3];B=FF(B,x,A,R,a,7,s[0]);R=FF(R,B,x,A,c,12,s[1]);A=FF(A,R,B,x,f,17,s[2]);x=FF(x,A,R,B,u,22,s[3]);B=FF(B,x,A,R,p,7,s[4]);R=FF(R,B,x,A,h,12,s[5]);A=FF(A,R,B,x,d,17,s[6]);x=FF(x,A,R,B,y,22,s[7]);B=FF(B,x,A,R,l,7,s[8]);R=FF(R,B,x,A,g,12,s[9]);A=FF(A,R,B,x,v,17,s[10]);x=FF(x,A,R,B,_,22,s[11]);B=FF(B,x,A,R,m,7,s[12]);R=FF(R,B,x,A,S,12,s[13]);A=FF(A,R,B,x,w,17,s[14]);B=GG(B,x=FF(x,A,R,B,C,22,s[15]),A,R,c,5,s[16]);R=GG(R,B,x,A,d,9,s[17]);A=GG(A,R,B,x,_,14,s[18]);x=GG(x,A,R,B,a,20,s[19]);B=GG(B,x,A,R,h,5,s[20]);R=GG(R,B,x,A,v,9,s[21]);A=GG(A,R,B,x,C,14,s[22]);x=GG(x,A,R,B,p,20,s[23]);B=GG(B,x,A,R,g,5,s[24]);R=GG(R,B,x,A,w,9,s[25]);A=GG(A,R,B,x,u,14,s[26]);x=GG(x,A,R,B,l,20,s[27]);B=GG(B,x,A,R,S,5,s[28]);R=GG(R,B,x,A,f,9,s[29]);A=GG(A,R,B,x,y,14,s[30]);B=HH(B,x=GG(x,A,R,B,m,20,s[31]),A,R,h,4,s[32]);R=HH(R,B,x,A,l,11,s[33]);A=HH(A,R,B,x,_,16,s[34]);x=HH(x,A,R,B,w,23,s[35]);B=HH(B,x,A,R,c,4,s[36]);R=HH(R,B,x,A,p,11,s[37]);A=HH(A,R,B,x,y,16,s[38]);x=HH(x,A,R,B,v,23,s[39]);B=HH(B,x,A,R,S,4,s[40]);R=HH(R,B,x,A,a,11,s[41]);A=HH(A,R,B,x,u,16,s[42]);x=HH(x,A,R,B,d,23,s[43]);B=HH(B,x,A,R,g,4,s[44]);R=HH(R,B,x,A,m,11,s[45]);A=HH(A,R,B,x,C,16,s[46]);B=II(B,x=HH(x,A,R,B,f,23,s[47]),A,R,a,6,s[48]);R=II(R,B,x,A,y,10,s[49]);A=II(A,R,B,x,w,15,s[50]);x=II(x,A,R,B,h,21,s[51]);B=II(B,x,A,R,m,6,s[52]);R=II(R,B,x,A,u,10,s[53]);A=II(A,R,B,x,v,15,s[54]);x=II(x,A,R,B,c,21,s[55]);B=II(B,x,A,R,l,6,s[56]);R=II(R,B,x,A,C,10,s[57]);A=II(A,R,B,x,d,15,s[58]);x=II(x,A,R,B,S,21,s[59]);B=II(B,x,A,R,p,6,s[60]);R=II(R,B,x,A,_,10,s[61]);A=II(A,R,B,x,f,15,s[62]);x=II(x,A,R,B,g,21,s[63]);i[0]=i[0]+B|0;i[1]=i[1]+x|0;i[2]=i[2]+A|0;i[3]=i[3]+R|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;t[o>>>5]|=128<<24-o%32;var i=r.floor(n/4294967296),s=n;t[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);t[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);e.sigBytes=4*(t.length+1);this._process();for(var a=this._hash,c=a.words,f=0;f<4;f++){var u=c[f];c[f]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var r=o.clone.call(this);r._hash=this._hash.clone();return r}});function FF(r,e,t,n,o,i,s){var a=r+(e&t|~e&n)+o+s;return(a<<i|a>>>32-i)+e}function GG(r,e,t,n,o,i,s){var a=r+(e&n|t&~n)+o+s;return(a<<i|a>>>32-i)+e}function HH(r,e,t,n,o,i,s){var a=r+(e^t^n)+o+s;return(a<<i|a>>>32-i)+e}function II(r,e,t,n,o,i,s){var a=r+(t^(e|~n))+o+s;return(a<<i|a>>>32-i)+e}e.MD5=o._createHelper(a);e.HmacMD5=o._createHmacHelper(a)}(Math);!function(r){var e=exports.CryptoJS,t=e.lib,n=t.WordArray,o=t.Hasher,i=e.algo,s=[],a=[];!function(){function isPrime(e){for(var t=r.sqrt(e),n=2;n<=t;n++)if(!(e%n))return!1;return!0}function getFractionalBits(r){return 4294967296*(r-(0|r))|0}for(var e=2,t=0;t<64;){if(isPrime(e)){t<8&&(s[t]=getFractionalBits(r.pow(e,.5)));a[t]=getFractionalBits(r.pow(e,1/3));t++}e++}}();var c=[],f=i.SHA256=o.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(r,e){for(var t=this._hash.words,n=t[0],o=t[1],i=t[2],s=t[3],f=t[4],u=t[5],p=t[6],h=t[7],d=0;d<64;d++){if(d<16)c[d]=0|r[e+d];else{var y=c[d-15],l=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,g=c[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[d]=l+c[d-7]+v+c[d-16]}var _=n&o^n&i^o&i,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),S=h+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&u^~f&p)+a[d]+c[d];h=p;p=u;u=f;f=s+S|0;s=i;i=o;o=n;n=S+(m+_)|0}t[0]=t[0]+n|0;t[1]=t[1]+o|0;t[2]=t[2]+i|0;t[3]=t[3]+s|0;t[4]=t[4]+f|0;t[5]=t[5]+u|0;t[6]=t[6]+p|0;t[7]=t[7]+h|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;t[o>>>5]|=128<<24-o%32;t[14+(o+64>>>9<<4)]=r.floor(n/4294967296);t[15+(o+64>>>9<<4)]=n;e.sigBytes=4*t.length;this._process();return this._hash},clone:function(){var r=o.clone.call(this);r._hash=this._hash.clone();return r}});e.SHA256=o._createHelper(f);e.HmacSHA256=o._createHmacHelper(f)}(Math);!function(){var r=exports.CryptoJS,e=r.lib.Base,t=r.enc.Utf8;r.algo.HMAC=e.extend({init:function(r,e){r=this._hasher=new r.init;"string"==typeof e&&(e=t.parse(e));var n=r.blockSize,o=4*n;e.sigBytes>o&&(e=r.finalize(e));e.clamp();for(var i=this._oKey=e.clone(),s=this._iKey=e.clone(),a=i.words,c=s.words,f=0;f<n;f++){a[f]^=1549556828;c[f]^=909522486}i.sigBytes=s.sigBytes=o;this.reset()},reset:function(){var r=this._hasher;r.reset();r.update(this._iKey)},update:function(r){this._hasher.update(r);return this},finalize:function(r){var e=this._hasher,t=e.finalize(r);e.reset();return e.finalize(this._oKey.clone().concat(t))}})}();exports.CryptoJS.lib.Cipher||function(r){var e=exports.CryptoJS,t=e.lib,n=t.Base,o=t.WordArray,i=t.BufferedBlockAlgorithm,s=e.enc,a=(s.Utf8,s.Base64),c=e.algo.EvpKDF,f=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(r,e){return this.create(this._ENC_XFORM_MODE,r,e)},createDecryptor:function(r,e){return this.create(this._DEC_XFORM_MODE,r,e)},init:function(r,e,t){this.cfg=this.cfg.extend(t);this._xformMode=r;this._key=e;this.reset()},reset:function(){i.reset.call(this);this._doReset()},process:function(r){this._append(r);return this._process()},finalize:function(r){r&&this._append(r);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(r){return"string"==typeof r?_:g}return function(r){return{encrypt:function(e,t,n){return selectCipherStrategy(t).encrypt(r,e,t,n)},decrypt:function(e,t,n){return selectCipherStrategy(t).decrypt(r,e,t,n)}}}}()}),u=(t.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),p=t.BlockCipherMode=n.extend({createEncryptor:function(r,e){return this.Encryptor.create(r,e)},createDecryptor:function(r,e){return this.Decryptor.create(r,e)},init:function(r,e){this._cipher=r;this._iv=e}}),h=u.CBC=function(){var r=p.extend();r.Encryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize;xorBlock.call(this,r,e,n);t.encryptBlock(r,e);this._prevBlock=r.slice(e,e+n)}});r.Decryptor=r.extend({processBlock:function(r,e){var t=this._cipher,n=t.blockSize,o=r.slice(e,e+n);t.decryptBlock(r,e);xorBlock.call(this,r,e,n);this._prevBlock=o}});function xorBlock(r,e,t){var n,o=this._iv;if(o){n=o;this._iv=void 0}else n=this._prevBlock;for(var i=0;i<t;i++)r[e+i]^=n[i]}return r}(),d=(e.pad={}).Pkcs7={pad:function(r,e){for(var t=4*e,n=t-r.sigBytes%t,i=n<<24|n<<16|n<<8|n,s=[],a=0;a<n;a+=4)s.push(i);var c=o.create(s,n);r.concat(c)},unpad:function(r){var e=255&r.words[r.sigBytes-1>>>2];r.sigBytes-=e}},y=(t.BlockCipher=f.extend({cfg:f.cfg.extend({mode:h,padding:d}),reset:function(){var r;f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)r=n.createEncryptor;else{r=n.createDecryptor;this._minBufferSize=1}if(this._mode&&this._mode.__creator==r)this._mode.init(this,t&&t.words);else{this._mode=r.call(n,this,t&&t.words);this._mode.__creator=r}},_doProcessBlock:function(r,e){this._mode.processBlock(r,e)},_doFinalize:function(){var r,e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);r=this._process(!0)}else{r=this._process(!0);e.unpad(r)}return r},blockSize:4}),t.CipherParams=n.extend({init:function(r){this.mixIn(r)},toString:function(r){return(r||this.formatter).stringify(this)}})),l=(e.format={}).OpenSSL={stringify:function(r){var e=r.ciphertext,t=r.salt;return(t?o.create([1398893684,1701076831]).concat(t).concat(e):e).toString(a)},parse:function(r){var e,t=a.parse(r),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){e=o.create(n.slice(2,4));n.splice(0,4);t.sigBytes-=16}return y.create({ciphertext:t,salt:e})}},g=t.SerializableCipher=n.extend({cfg:n.extend({format:l}),encrypt:function(r,e,t,n){n=this.cfg.extend(n);var o=r.createEncryptor(t,n),i=o.finalize(e),s=o.cfg;return y.create({ciphertext:i,key:t,iv:s.iv,algorithm:r,mode:s.mode,padding:s.padding,blockSize:r.blockSize,formatter:n.format})},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);return r.createDecryptor(t,n).finalize(e.ciphertext)},_parse:function(r,e){return"string"==typeof r?e.parse(r,this):r}}),v=(e.kdf={}).OpenSSL={execute:function(r,e,t,n){n||(n=o.random(8));var i=c.create({keySize:e+t}).compute(r,n),s=o.create(i.words.slice(e),4*t);i.sigBytes=4*e;return y.create({key:i,iv:s,salt:n})}},_=t.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(r,e,t,n){var o=(n=this.cfg.extend(n)).kdf.execute(t,r.keySize,r.ivSize);n.iv=o.iv;var i=g.encrypt.call(this,r,e,o.key,n);i.mixIn(o);return i},decrypt:function(r,e,t,n){n=this.cfg.extend(n);e=this._parse(e,n.format);var o=n.kdf.execute(t,r.keySize,r.ivSize,e.salt);n.iv=o.iv;return g.decrypt.call(this,r,e,o.key,n)}})}();!function(){if("function"==typeof ArrayBuffer){var r=exports.CryptoJS.lib.WordArray,e=r.init;(r.init=function(r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));(r instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));if(r instanceof Uint8Array){for(var t=r.byteLength,n=[],o=0;o<t;o++)n[o>>>2]|=r[o]<<24-o%4*8;e.call(this,n,t)}else e.apply(this,arguments)}).prototype=r}}();exports.CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};!function(){var r=exports.CryptoJS,e=r.lib.WordArray;r.enc.Base64={stringify:function(r){var e=r.words,t=r.sigBytes,n=this._map;r.clamp();for(var o=[],i=0;i<t;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<t;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(r){var t=r.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=r.indexOf(s);-1!==a&&(t=a)}return function parseLoop(r,t,n){for(var o=[],i=0,s=0;s<t;s++)if(s%4){var a=n[r.charCodeAt(s-1)]<<s%4*2,c=n[r.charCodeAt(s)]>>>6-s%4*2,f=a|c;o[i>>>2]|=f<<24-i%4*8;i++}return e.create(o,i)}(r,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();!function(){var r=exports.CryptoJS,e=r.lib,t=e.Base,n=e.WordArray,o=r.algo,i=o.MD5,s=o.EvpKDF=t.extend({cfg:t.extend({keySize:4,hasher:i,iterations:1}),init:function(r){this.cfg=this.cfg.extend(r)},compute:function(r,e){for(var t,o=this.cfg,i=o.hasher.create(),s=n.create(),a=s.words,c=o.keySize,f=o.iterations;a.length<c;){t&&i.update(t);t=i.update(r).finalize(e);i.reset();for(var u=1;u<f;u++){t=i.finalize(t);i.reset()}s.concat(t)}s.sigBytes=4*c;return s}});r.EvpKDF=function(r,e,t){return s.create(t).compute(r,e)}}();!function(){var r=exports.CryptoJS,e=r.lib.BlockCipher,t=r.algo,n=[],o=[],i=[],s=[],a=[],c=[],f=[],u=[],p=[],h=[];!function(){for(var r=[],e=0;e<256;e++)r[e]=e<128?e<<1:e<<1^283;var t=0,d=0;for(e=0;e<256;e++){var y=d^d<<1^d<<2^d<<3^d<<4;y=y>>>8^255&y^99;n[t]=y;o[y]=t;var l=r[t],g=r[l],v=r[g],_=257*r[y]^16843008*y;i[t]=_<<24|_>>>8;s[t]=_<<16|_>>>16;a[t]=_<<8|_>>>24;c[t]=_;_=16843009*v^65537*g^257*l^16843008*t;f[y]=_<<24|_>>>8;u[y]=_<<16|_>>>16;p[y]=_<<8|_>>>24;h[y]=_;if(t){t=l^r[r[r[v^l]]];d^=r[r[d]]}else t=d=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],y=t.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var r=this._keyPriorReset=this._key,e=r.words,t=r.sigBytes/4,o=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],s=0;s<o;s++)if(s<t)i[s]=e[s];else{y=i[s-1];if(s%t)t>6&&s%t==4&&(y=n[y>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y]);else{y=n[(y=y<<8|y>>>24)>>>24]<<24|n[y>>>16&255]<<16|n[y>>>8&255]<<8|n[255&y];y^=d[s/t|0]<<24}i[s]=i[s-t]^y}for(var a=this._invKeySchedule=[],c=0;c<o;c++){s=o-c;if(c%4)var y=i[s];else y=i[s-4];a[c]=c<4||s<=4?y:f[n[y>>>24]]^u[n[y>>>16&255]]^p[n[y>>>8&255]]^h[n[255&y]]}}},encryptBlock:function(r,e){this._doCryptBlock(r,e,this._keySchedule,i,s,a,c,n)},decryptBlock:function(r,e){var t=r[e+1];r[e+1]=r[e+3];r[e+3]=t;this._doCryptBlock(r,e,this._invKeySchedule,f,u,p,h,o);t=r[e+1];r[e+1]=r[e+3];r[e+3]=t},_doCryptBlock:function(r,e,t,n,o,i,s,a){for(var c=this._nRounds,f=r[e]^t[0],u=r[e+1]^t[1],p=r[e+2]^t[2],h=r[e+3]^t[3],d=4,y=1;y<c;y++){var l=n[f>>>24]^o[u>>>16&255]^i[p>>>8&255]^s[255&h]^t[d++],g=n[u>>>24]^o[p>>>16&255]^i[h>>>8&255]^s[255&f]^t[d++],v=n[p>>>24]^o[h>>>16&255]^i[f>>>8&255]^s[255&u]^t[d++],_=n[h>>>24]^o[f>>>16&255]^i[u>>>8&255]^s[255&p]^t[d++];f=l;u=g;p=v;h=_}l=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&h])^t[d++],g=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^t[d++],v=(a[p>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^t[d++],_=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^t[d++];r[e]=l;r[e+1]=g;r[e+2]=v;r[e+3]=_},keySize:8});r.AES=e._createHelper(y)}();!function(){var r=exports.CryptoJS,e=r.lib.StreamCipher,t=r.algo,n=t.RC4=e.extend({_doReset:function(){for(var r=this._key,e=r.words,t=r.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var s=o%t,a=e[s>>>2]>>>24-s%4*8&255;i=(i+n[o]+a)%256;var c=n[o];n[o]=n[i];n[i]=c}this._i=this._j=0},_doProcessBlock:function(r,e){r[e]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var r=this._S,e=this._i,t=this._j,n=0,o=0;o<4;o++){t=(t+r[e=(e+1)%256])%256;var i=r[e];r[e]=r[t];r[t]=i;n|=r[(r[e]+r[t])%256]<<24-8*o}this._i=e;this._j=t;return n}r.RC4=e._createHelper(n);var o=t.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var r=this.cfg.drop;r>0;r--)generateKeystreamWord.call(this)}});r.RC4Drop=e._createHelper(o)}();exports.CryptoJS.mode.ECB=function(){var r=exports.CryptoJS.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(r,e){this._cipher.encryptBlock(r,e)}});r.Decryptor=r.extend({processBlock:function(r,e){this._cipher.decryptBlock(r,e)}});return r}();var _PDFSecurity=function(){function _PDFSecurity(r,e){void 0===e&&(e={});if(!e.ownerPassword&&!e.userPassword)throw new Error("None of owner password and user password is defined.");this.document=r;this._setupEncryption(e)}_PDFSecurity.generateFileID=function(r){void 0===r&&(r={});var e=r.CreationDate.getTime()+"\n";for(var t in r)r.hasOwnProperty(t)&&(e+=t+": "+r[t]+"\n");return wordArrayToBuffer(exports.CryptoJS.MD5(e))};_PDFSecurity.generateRandomWordArray=function(r){return exports.CryptoJS.lib.WordArray.random(r)};_PDFSecurity.create=function(r,e){void 0===e&&(e={});return e.ownerPassword||e.userPassword?new _PDFSecurity(r,e):null};_PDFSecurity.prototype._setupEncryption=function(r){switch(r.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}var e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,r);break;case 5:this._setupEncryptionV5(e,r)}this.dictionary=this.document.ref(e)};_PDFSecurity.prototype._setupEncryptionV1V2V4=function(r,e,t){var n,o;switch(r){case 1:n=2;this.keyBits=40;o=getPermissionsR2(t.permissions);break;case 2:n=3;this.keyBits=128;o=getPermissionsR3(t.permissions);break;case 4:n=4;this.keyBits=128;o=getPermissionsR3(t.permissions)}var i,s=processPasswordR2R3R4(t.userPassword),a=t.ownerPassword?processPasswordR2R3R4(t.ownerPassword):s,c=getOwnerPasswordR2R3R4(n,this.keyBits,s,a);this.encryptionKey=getEncryptionKeyR2R3R4(n,this.keyBits,this.document._id,s,c,o);i=2===n?getUserPasswordR2(this.encryptionKey):getUserPasswordR3R4(this.document._id,this.encryptionKey);e.V=r;r>=2&&(e.Length=this.keyBits);if(4===r){e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}};e.StmF="StdCF";e.StrF="StdCF"}e.R=n;e.O=wordArrayToBuffer(c);e.U=wordArrayToBuffer(i);e.P=o};_PDFSecurity.prototype._setupEncryptionV5=function(r,e){this.keyBits=256;var t=getPermissionsR3(e.permissions),n=processPasswordR5(e.userPassword),o=e.ownerPassword?processPasswordR5(e.ownerPassword):n;this.encryptionKey=getEncryptionKeyR5(_PDFSecurity.generateRandomWordArray);var i=getUserPasswordR5(n,_PDFSecurity.generateRandomWordArray),s=getUserEncryptionKeyR5(n,exports.CryptoJS.lib.WordArray.create(i.words.slice(10,12),8),this.encryptionKey),a=getOwnerPasswordR5(o,i,_PDFSecurity.generateRandomWordArray),c=getOwnerEncryptionKeyR5(o,exports.CryptoJS.lib.WordArray.create(a.words.slice(10,12),8),i,this.encryptionKey),f=getEncryptedPermissionsR5(t,this.encryptionKey,_PDFSecurity.generateRandomWordArray);r.V=5;r.Length=this.keyBits;r.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}};r.StmF="StdCF";r.StrF="StdCF";r.R=5;r.O=wordArrayToBuffer(a);r.OE=wordArrayToBuffer(c);r.U=wordArrayToBuffer(i);r.UE=wordArrayToBuffer(s);r.P=t;r.Perms=wordArrayToBuffer(f)};_PDFSecurity.prototype.getEncryptFn=function(r,e){var t,n;this.version<5&&(t=this.encryptionKey.clone().concat(exports.CryptoJS.lib.WordArray.create([(255&r)<<24|(65280&r)<<8|r>>8&65280|255&e,(65280&e)<<16],5)));if(1===this.version||2===this.version){var o=exports.CryptoJS.MD5(t);o.sigBytes=Math.min(16,this.keyBits/8+5);return function(r){return wordArrayToBuffer(exports.CryptoJS.RC4.encrypt(exports.CryptoJS.lib.WordArray.create(r),o).ciphertext)}}n=4===this.version?exports.CryptoJS.MD5(t.concat(exports.CryptoJS.lib.WordArray.create([1933667412],4))):this.encryptionKey;var i=_PDFSecurity.generateRandomWordArray(16),s={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.Pkcs7,iv:i};return function(r){return wordArrayToBuffer(i.clone().concat(exports.CryptoJS.AES.encrypt(exports.CryptoJS.lib.WordArray.create(r),n,s).ciphertext))}};_PDFSecurity.prototype.end=function(){this.dictionary.end()};return _PDFSecurity}();exports._PDFSecurity=_PDFSecurity;function getPermissionsR2(r){void 0===r&&(r={});var e=-64;r.printing&&(e|=4);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);return e}function getPermissionsR3(r){void 0===r&&(r={});var e=-3904;"lowResolution"===r.printing&&(e|=4);"highResolution"===r.printing&&(e|=2052);r.modifying&&(e|=8);r.copying&&(e|=16);r.annotating&&(e|=32);r.fillingForms&&(e|=256);r.contentAccessibility&&(e|=512);r.documentAssembly&&(e|=1024);return e}function getUserPasswordR2(r){return exports.CryptoJS.RC4.encrypt(processPasswordR2R3R4(),r).ciphertext}function getUserPasswordR3R4(r,e){for(var t=e.clone(),n=exports.CryptoJS.MD5(processPasswordR2R3R4().concat(exports.CryptoJS.lib.WordArray.create(r))),o=0;o<20;o++){for(var i=Math.ceil(t.sigBytes/4),s=0;s<i;s++)t.words[s]=e.words[s]^(o|o<<8|o<<16|o<<24);n=exports.CryptoJS.RC4.encrypt(n,t).ciphertext}return n.concat(exports.CryptoJS.lib.WordArray.create(null,16))}function getOwnerPasswordR2R3R4(r,e,t,n){for(var o=n,i=r>=3?51:1,s=0;s<i;s++)o=exports.CryptoJS.MD5(o);var a=o.clone();a.sigBytes=e/8;var c=t;i=r>=3?20:1;for(s=0;s<i;s++){for(var f=Math.ceil(a.sigBytes/4),u=0;u<f;u++)a.words[u]=o.words[u]^(s|s<<8|s<<16|s<<24);c=exports.CryptoJS.RC4.encrypt(c,a).ciphertext}return c}function getEncryptionKeyR2R3R4(r,e,t,n,o,i){for(var s=n.clone().concat(o).concat(exports.CryptoJS.lib.WordArray.create([lsbFirstWord(i)],4)).concat(exports.CryptoJS.lib.WordArray.create(t)),a=r>=3?51:1,c=0;c<a;c++)(s=exports.CryptoJS.MD5(s)).sigBytes=e/8;return s}function getUserPasswordR5(r,e){var t=e(8),n=e(8);return exports.CryptoJS.SHA256(r.clone().concat(t)).concat(t).concat(n)}function getUserEncryptionKeyR5(r,e,t){var n=exports.CryptoJS.SHA256(r.clone().concat(e)),o={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(t,n,o).ciphertext}function getOwnerPasswordR5(r,e,t){var n=t(8),o=t(8);return exports.CryptoJS.SHA256(r.clone().concat(n).concat(e)).concat(n).concat(o)}function getOwnerEncryptionKeyR5(r,e,t,n){var o=exports.CryptoJS.SHA256(r.clone().concat(e).concat(t)),i={mode:exports.CryptoJS.mode.CBC,padding:exports.CryptoJS.pad.NoPadding,iv:exports.CryptoJS.lib.WordArray.create(null,16)};return exports.CryptoJS.AES.encrypt(n,o,i).ciphertext}function getEncryptionKeyR5(r){return r(32)}function getEncryptedPermissionsR5(r,e,t){var n=exports.CryptoJS.lib.WordArray.create([lsbFirstWord(r),4294967295,1415668834],12).concat(t(4)),o={mode:exports.CryptoJS.mode.ECB,padding:exports.CryptoJS.pad.NoPadding};return exports.CryptoJS.AES.encrypt(n,e,o).ciphertext}function processPasswordR2R3R4(r){void 0===r&&(r="");for(var e=new Buffer(32),t=r.length,n=0;n<t&&n<32;){var o=r.charCodeAt(n);if(o>255)throw new Error("Password contains one or more invalid characters.");e[n]=o;n++}for(;n<32;){e[n]=PASSWORD_PADDING[n-t];n++}return exports.CryptoJS.lib.WordArray.create(e)}function processPasswordR5(r){void 0===r&&(r="");r=unescape(encodeURIComponent(saslprep(r)));for(var e=Math.min(127,r.length),t=new Buffer(e),n=0;n<e;n++)t[n]=r.charCodeAt(n);return exports.CryptoJS.lib.WordArray.create(t)}function lsbFirstWord(r){return(255&r)<<24|(65280&r)<<8|r>>8&65280|r>>24&255}function wordArrayToBuffer(r){for(var e=[],t=0;t<r.sigBytes;t++)e.push(r.words[Math.floor(t/4)]>>8*(3-t%4)&255);return Buffer.from(e)}var PASSWORD_PADDING=[40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122];wijmo_1._registerModule("wijmo.pdf.security",selfModule);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mescius/wijmo.pdf.security",
3
- "version": "5.20261.45-nightly.d20260106.t072437",
3
+ "version": "5.20261.45-nightly.d20260108.t163148",
4
4
  "description": "UI library for pure JS, Angular, React, Vue and more...",
5
5
  "author": "MESCIUS inc",
6
6
  "license": "Commercial",
7
7
  "main": "./index.js",
8
8
  "types": "./index.d.ts",
9
9
  "dependencies": {
10
- "@mescius/wijmo": "5.20261.45-nightly.d20260106.t072437"
10
+ "@mescius/wijmo": "5.20261.45-nightly.d20260108.t163148"
11
11
  },
12
12
  "homepage": "https://developer.mescius.com/wijmo",
13
13
  "bugs": {